Computers and Technology
Computers and Technology, 14.03.2020 00:27, lolo8787

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

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 23:00, brooklynmikestovgphx
Suppose s, t, and w are strings that have already been created inside main. write a statement or statements, to be added to main, that will determine if the lengths of the three strings are in order by length, smallest to largest. that is, your code should determine if s is strictly shorter than t, and if t is strictly shorter than w. if these conditions hold your code should print (the boolean value) true. if not, your code should print false. (strictly means: no ties) example: if s, t, and w are "cat", "hats", and "skies" your code should print true - their lengths are 3-4-5; but if s, t, and w are "cats" "shirt", and "trust", then print false - their lengths are 4-5-5 enter your code in the box below
Answers: 2
image
Computers and Technology, 24.06.2019 03:00, greenhappypiggies
Using a conditional expression, write a statement that increments numusers if updatedirection is 1, otherwise decrements numusers. ex: if numusers is 8 and updatedirection is 1, numusers becomes 9; if updatedirection is 0, numusers becomes 7.
Answers: 1
image
Computers and Technology, 24.06.2019 19:00, taridunkley724
Which of the following "invisible" marks represents an inserted tab?
Answers: 1
image
Computers and Technology, 26.06.2019 01:30, sanchez626
When measuring an unknown voltage with an analog vom, you should first a. ground the circuit. b. set the switch to the lowest range and then move it to a higher range until you get an accurate reading. c. ground the meter. d. set the switch to the highest range and then move it to a range that gives the most accurate reading.
Answers: 1
Do you know the correct answer?
The heart of the recent hit game SimAquarium is a tight loop that calculates the average position of...

Questions in other subjects:

Konu
Business, 03.11.2020 19:10
Konu
English, 03.11.2020 19:10