subject

The heart of the recent hit game SimAquarium is a tight loop that calculates the average position of 256 algae. You are evaluating its cache performance on a machine with a 1024-byte direct-mapped data cache with 16-byte blocks (B = 16).

You are given the following definitions:

//Code

struct algae_position {
int x;
int y;
};

struct algae_position grid[16][16];
int total_x = 0, total_y = 0;
int i, j;

//End of Code
Assuming the cache starts empty, when the following code is executed:

//Code

for (i = 0; i < 16; i++) {
for (j = 0; j < 16; j++) {
total_x += grid[i][j].x;
}
}
for (i = 0; i < 16; i++) {
for (j = 0; j < 16; j++) {
total_y += grid[i][j].y;
}
}

//End of Code

There are (Blank_1) total reads or loads and (Blank_2) reads or loads that miss in the cache,
resulting in a cache miss rate of (Blank_3) %.

Assuming the cache is emptied again, when the following code is executed:

//Code

for (i = 0; i < 16; i++) {
for (j = 0; j < 16; j++) {
total_x += grid[i][j].x;
total_y += grid[i][j].y;
}
}

//End of code
There are (Blank_4) total reads or loads and (Blank_5) reads or loads that miss in the cache,
resulting in a cache miss rate of (Blank_6) %.

If the cache was twice as big, the miss rate would be (Blank_7) %.

A: I got Blank_1 = 512, Blank_2 = 256 and Blank_3 = 50%.
I can't seem to figure out the answers for the second loop

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 15:30
Communication is the exchange of information. true or false?
Answers: 1
question
Computers and Technology, 22.06.2019 11:00
Which are examples of note-taking tools? check all that recording devices sticky notes digital highlighters paper flags highlighting pens digital displays digital flags
Answers: 1
question
Computers and Technology, 22.06.2019 13:00
Write a program which asks you to enter a name in the form of first middle initial last. so you might enter for example samuel p. clemens. use getline to read in the string because it contains spaces. also, apparently the shift key on your keyboard doesn’t work, because you enter it all lower case. pass the string to a function which uses .find to locate the letters which need to be upper case and use toupper to convert those characters to uppercase. the revised string should then be returned to main in the form last, first mi where it will be displayed.
Answers: 1
question
Computers and Technology, 22.06.2019 23:30
Jaina and tomas are being considered as new tenants in an apartment. the landlord looks at their creditworthiness because he wants to be sure his new tenant pays the rent on time and in full. the table below summarizes the information that was on their applications. application information questions jaina tomas how many years have you had your job? 5 2 what is your monthly salary? $1,850 $2,500 how many credit cards do you have? 4 1 how much debt do you have? $13,000 $7,000 how many times were you late with payments on credit cards in the past year? 5 1 who will the landlord decide to be more creditworthy and why? tomas because the ratio of his debt to income is less. jaina because she has had her job longer, which makes her look more stable. jaina because she has more credit cards available to her. tomas because he makes more money per month.
Answers: 2
You know the right answer?
The heart of the recent hit game SimAquarium is a tight loop that calculates the average position of...
Questions
question
Physics, 10.11.2020 21:30
question
Mathematics, 10.11.2020 21:30
question
History, 10.11.2020 21:30
question
Mathematics, 10.11.2020 21:30
Questions on the website: 13722360