Question: The loop appearing below is executed on a machine that has a 1-K-word data cache with four words per cache line. a. How must x
The loop appearing below is executed on a machine that has a 1-K-word data cache with four words per cache line.
a. How must x and a be placed relative to each other in memory to produce a conflict miss every time the inner loop’s body is executed?
b. How must x and a be placed relative to each other in memory to produce a conflict miss one out of every four times the inner loop’s body is executed?
c. How must x and a be placed relative to each other in memory to produce no conflict misses?
for (i = 0; i < 50; i++)
for (j = 0; j < 4; j++)
x[i][j] = a[i][j] * c[i];
Step by Step Solution
3.41 Rating (164 Votes )
There are 3 Steps involved in it
SOLUTION To answer this question we need to understand how the data cache works and how memory addresses are mapped to cache lines In a directmapped c... View full answer
Get step-by-step solutions from verified subject matter experts
