Question: Given the following C code definitions: struct point_color { int c; int m; int y; int k; }; struct point_color square[16][16]; int i, j; and

Given the following C code definitions:

struct point_color { int c; 
 int m; int y; int k; 

};

struct point_color square[16][16]; int i, j; 

and the following assumptions:

sizeof(int)==4 square begins at mem addr 0 cache initially empty only mem accesses are to entries of array square; i and j are stored in registers.

determine the cache performance of the following code when the cache is a 2048-byte direct- mapped cache with 32-byte blocks:

for (j=0; j<16; j++) { for (i=0; i<16; i++) { 
 square[i][j].c = 0; square[i][j].m = 0; square[i][j].y = 0; square[i][j].k = 0; 

} }

What is the total number of writes? What is the total number of writes that miss in the cache? What is the miss rate?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!