Question: struct algae _ position { float x; float y; } ; struct algae _ position grid [ 1 6 ] [ 1 6 ] ;
struct algae
position
float x;
float y;
;
struct algae
position grid
;
float total
x
total
y
;
int i
j;
You should also assume the following:
sizeof
float
grid begins at memory address
The cache is initially empty.
The only memory accesses are to the entries of the grid array grid. the variables i
j
total x
total y are stored in registers.
We consider the following code:
for
i
; i
; i
for
j
; j
; j
total
x
grid
j
i
x;
total
y
grid
j
i
y;
Analyze the cache performance of this code provide some short explanations so we see how you got the result; it helps to draw the cache:
a What is the total number of reads?
b What is the total number of reads that miss in the cache?
c What is the miss rate?
d What would the miss rate be if the cache were twice as big?
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
