Question: You are given the following code to analyze: 1 . int x [ 2 ] [ 1 2 8 ] ; 2 . int i

You are given the following code to analyze:
1. int x[2][128];
2. int i, sum =0;
3. for (i =0; i <128; i++)
4. sum += x[0][i]* x[1][i];
Assume the code is executed under the following conditions:
sizeof(int)=4
Array x begins at mem. addr. 0x0 and is stored in row-major order.
Cache initially empty
Only mem. accesses are to elements of x. Rest of the variables are in
registers.
(a) Case 1: Assume cache is 512 bytes, direct-mapped, with 16 byte blocks.
What is the miss rate? Explain.

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 Programming Questions!