Question: Consider the following code that accesses three values in memory scalar integers x and s, and an integer vector y[i]. What is the memory latency
Consider the following code that accesses three values in memory scalar integers x and s, and an integer vector y[i]. What is the memory latency in clock cycles for a trip round the loop ( after the first iteration)? Assume that the array is not cached and each new access to the array results in a miss.
The system has both Ll and L2 caches. The access time of the Ll cache is two cycles, the access time of the L2 cache is 6 cycles and main memory has an access time of 50 cycles. In this case all memory and cache memory accesses take place in parallel.
![for (i = 0; i < 100; i++) { X = y [i]; S = S + X; }](https://dsd5zvtm8ll6.cloudfront.net/images/question_images/1705/9/1/5/36465ae33e4733451705915364081.jpg)
for (i = 0; i < 100; i++) { X = y[i]; S = S + X; }
Step by Step Solution
3.45 Rating (152 Votes )
There are 3 Steps involved in it
The first array load results in a miss and me... View full answer
Get step-by-step solutions from verified subject matter experts
