Question: computer of 32 bits with a data cache memory of 32 KB has lines of 64 bytes. The cache is 2-way associative. Consider the following

computer of 32 bits with a data cache memory of 32 KB has lines of 64 bytes. The cache is 2-way
associative. Consider the following code fragment: int m[512][512];
sum = 0;
for (i = 0; i < 512; i ++)
for (j = 0; j < 512; j++) sum = sum + m[i][j];
int m[512][512];
sum = 0;
for (i = 0; i < 512; i ++)
for (j = 0; j < 512; j++)
sum = sum + m[j][i];
Assuming that the sum variable is stored in a register, calculate the hit ratio that produce this code fragment. (the matrix
is stored by rows).

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!