Question:medium

A computer has a memory hierarchy consisting of two-level cache (L1 and L2) and a main memory. If the processor needs to access data from memory, it first looks into L1 cache. If the data is not found in L1 cache, it goes to L2 cache. If it fails to get the data from L2 cache, it goes to main memory, where the data is definitely available. Hit rates and access times of various memory units are shown in the figure. The average memory access time in nanoseconds (ns) is __________. (rounded off to two decimal places)
\includegraphics[width=0.5\linewidth]{53.png}

Show Hint

The average memory access time can be calculated by considering the hit and miss rates for each level of cache and the main memory. Multiply the hit rate by the access time for each level and then sum up the results.
Updated On: Jan 30, 2026
Show Solution

Correct Answer: 11.83

Solution and Explanation

Every memory access first goes to the L1 cache, which responds in 10 ns. Since the L1 cache succeeds 95% of the time, this fast access dominates most memory operations.

Only in the remaining 5% of cases does the access proceed beyond L1. When this happens, the request reaches the L2 cache, where it is satisfied with probability 85% at an effective time of 20 ns. If L2 also fails, which occurs in 15% of L1 misses, the access finally goes to main memory, costing 200 ns.

The average extra delay incurred during an L1 miss is therefore:

\(0.85 \times 20 + 0.15 \times 200 = 47\)

Since this situation arises only 5% of the time, its contribution to the overall access time is:

\(0.05 \times 47 = 2.35\)

Adding this to the typical L1 access time:

\(10 \times 0.95 + 2.35 = 11.85\)

Hence, the average memory access time is \(\boxed{11.85 \text{ ns}}\).

Was this answer helpful?
0