Question: Consider the following C code. int a [ 1 0 2 4 ] , b [ 1 0 2 4 ] , c [ 1

Consider the following C code. int a[1024], b[1024], c[1024], d[1024]; void main(){ int s=0; for(int i=0; i<1024; ++i){ s += a[i]*b[i]+c[i]*d[i]; }} Assume that the starting addresses of a, b, c, d are 0x0000,0x1000,0x2000, and 0x3000, respectively. (a)(10pt) Consider a direct mapped cache which has 8 blocks and the block size is 16-word. Compute the data cache miss rate for the above program. (b)(10pt) For the above program, what is the minimal associativity to minimize the conflict cache misses. And for the revised cache, what is the data cache miss rate? (c)(10pt) Change the program to improve the cache hit rate by splitting the for-loop and write the revised program. In addition, for the same cache (16 word block size) in (a), compute the data cache 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 Programming Questions!