Cache Average Access Time: Solving the Given Multiple-Choice Problem
To compute the average (effective) memory access time of a two-level hierarchy (cache + main memory), we use the standard expected-time model: with probability hit ratio the access completes at cache time; with probability miss ratio it goes to main memory after (effectively) paying the cache access cost as well. This is typically written as
For the common “cache access time then, on miss, main memory access time ” setup, this simplifies to the widely taught form:
Here, we apply it to:
- cache access time
- main memory access time
- hit ratio
Effective Access Time Hit Ratio Miss Ratio Cache Hit Time
Compute Average Access Time from Hit Ratio
- 1Step 1
Cache time , main memory time , hit ratio (so miss ratio is ).
- 2Step 2
Use .
- 3Step 3
(units in ns).
- 4Step 4
.
- 5Step 5
The result corresponds to option (iii).
Quick sanity check
Because the hit ratio is high (), the average should be closer to cache time ( ns) than main memory time ( ns). A value of ns fits this intuition.
Common pitfall: double-counting the cache time
Some variants define miss cost differently (e.g., as “extra penalty beyond cache time”). If your course uses -style definitions, confirm what represents (total time vs. miss penalty). Here, the standard choice yields ns, matching the intended answer.
Memory Access Lifecycle (Cache-Based)
Cache lookup
Step 1Check whether the requested block is in cache."
Hit path
Step 2If hit, complete in cache time ns."
Miss path
Step 3If miss (probability ), fetch from main memory in ns."
Expected time
Step 4Compute weighted average using and ."
Expected Time Contribution (Hits vs Misses)
Weighted contributions using , ns, ns.
Answer Explanation and Option Selection
Knowledge Check
Given cache time , main memory time , and hit ratio , what is the average access time?