Intuition What this page is for
The parent Average memory access time (AMAT) note gave you the formula and two examples. Here we hunt down every case class AMAT can throw at you: the easy ones, the sneaky degenerate ones (miss rate = 0 or = 1 ), the multi-level nesting, the local-vs-global trap, a real-world word problem, and an exam twist. Miss none of them and no exam AMAT question can surprise you.
Intuition Where AMAT can possibly land (know this before any example)
Because a hit costs H T and a miss costs H T + M P , every access takes somewhere between those two. So the average must obey
H T ≤ AMAT ≤ H T + M P .
The low end is a cache that never misses (m = 0 ); the high end is one that always misses (m = 1 ). Any AMAT you compute outside this band is a computation error — this is your first sanity check on every single example below.
Every AMAT problem is one (or a blend) of these cells. Each worked example below is tagged with the cell it lands on.
Cell
What makes it special
Example
A. Baseline single-level
plain H T + m ⋅ M P , ordinary numbers
Ex 1
B. Degenerate m = 0
perfect cache, never misses
Ex 2
C. Degenerate m = 1
every access misses (limiting worst case)
Ex 2
D. Unit mismatch
all terms of the formula must share ONE unit before you combine — mixing cycles and ns is the classic trap
Ex 3
E. Two-level nesting (local rates)
penalty of L1 = AMAT of L2
Ex 4
F. Global-vs-local trap
given global rate, must convert
Ex 5
G. Solve backwards
AMAT known, find the unknown m or M P
Ex 6
H. Real-world word problem
translate a story into the formula
Ex 7
I. Exam twist — design tradeoff
bigger cache lowers m but raises H T ; which wins?
Ex 8
We'll walk them in order. Every numeric answer here is machine-checked in the verify block.
Figure 1 — Anatomy of AMAT.
Look at the split in Figure 1 : every access pays the flat green "hit" bar on the left. Only the fraction m of accesses continues into the long coral "penalty" bar. AMAT is the green bar plus the coral bar scaled down by m . Keep this image in mind — every example is just choosing numbers for those two bars.
Worked example Ex 1 — Cell A: baseline single-level
A cache has hit time H T = 2 ns, miss rate m = 4% = 0.04 , miss penalty M P = 80 ns. Find AMAT.
Forecast: Guess before computing — will AMAT be closer to 2 ns or to 80 ns? (Hint: misses are rare.)
Write the formula: AMAT = H T + m ⋅ M P .
Why this step? This is the expected time: the flat hit cost plus the penalty gated by the miss probability.
Plug in: AMAT = 2 + 0.04 × 80 .
Why this step? 0.04 × 80 = 3.2 ns is the average extra time misses add per access.
Add: 2 + 3.2 = 5.2 ns.
Why this step? Combine the unconditional and conditional costs.
Verify: 5.2 ns sits just above the 2 ns hit time — close to the fast case, as forecast, because most accesses hit. Bounds check: 5.2 lies in [ H T , H T + M P ] = [ 2 , 82 ] ns. ✅
Worked example Ex 2 — Cells B & C: the two degenerate extremes
Same cache as Ex 1 (H T = 2 ns, M P = 80 ns), but test the limits: (B) miss rate m = 0 , (C) miss rate m = 1 .
Forecast: What should AMAT equal when the cache never misses? When it always misses?
Case B, m = 0 : AMAT = 2 + 0 × 80 = 2 ns.
Why this step? If nothing ever misses, the coral penalty bar disappears — you only ever pay the hit. AMAT collapses to H T , the lower end of the band.
Case C, m = 1 : AMAT = 2 + 1 × 80 = 82 ns.
Why this step? Every access misses, so every access pays hit then penalty: H T + M P . This is the upper end of the band, the absolute worst case.
Verify: These are exactly the two endpoints of the band [ H T , H T + M P ] = [ 2 , 82 ] ns promised at the top. Ex 1's 5.2 ns lives strictly between them. ✅
Worked example Ex 3 — Cell D: unit mismatch (cycles vs ns)
A cache hits in 1 clock cycle . Miss rate = 5% . A miss costs 100 cycles . The CPU clock period is 0.5 ns. Find AMAT in nanoseconds .
Forecast: Do you multiply by the clock period before or after combining? Does it matter?
Check the units first: H T and M P are both in cycles , so they already share one unit — safe to combine. (If one were in ns and one in cycles, you'd have to convert before adding.)
Why this step? The AMAT formula only makes sense when H T and M P carry the same unit; adding a cycle count to a nanosecond count would be nonsense.
Compute AMAT in cycles: AMAT = 1 + 0.05 × 100 = 6 cycles.
Why this step? All inputs are cycles, so the formula's output is cycles.
Convert to ns: 6 cycles × 0.5 cycle ns = 3 ns.
Why this step? One cycle lasts 0.5 ns, so multiply the cycle count by the period. Beginners forget this or convert only one term.
Verify: Because the conversion is a single multiply, converting first then combining gives the same: ( 1 × 0.5 ) + 0.05 × ( 100 × 0.5 ) = 0.5 + 2.5 = 3 ns. Same answer → order didn't matter. ✅ Units: cycles × (ns/cycle) = ns. ✅
Worked example Ex 4 — Cell E: two-level cache, local rates
H T L 1 = 1 ns, m L 1 = 8% ; H T L 2 = 8 ns, m L 2 = 25% (local ); DRAM penalty M P L 2 = 150 ns. Find AMAT.
The pattern (kept here so you needn't leave this page): a multi-level AMAT is just the single-level formula nested . The "miss penalty of L1" is not a fixed DRAM number — it is itself an AMAT: H T L 2 + m L 2 ⋅ M P L 2 . So you compute the inner (L2) subsystem's AMAT first, then feed it in as L1's penalty:
AMAT = H T L 1 + m L 1 ( L1’s real miss penalty H T L 2 + m L 2 ⋅ M P L 2 ) .
Forecast: The L1 miss penalty is not 150 ns — it's whatever an L1 miss really costs. Guess: bigger or smaller than 150?
Inner subsystem (what an L1 miss actually costs) = H T L 2 + m L 2 ⋅ M P L 2 = 8 + 0.25 × 150 = 8 + 37.5 = 45.5 ns.
Why this step? An L1 miss drops into L2: it always pays L2's hit time, and only the 25% that also miss L2 pay the DRAM trip. That's an AMAT in its own right — it becomes L1's effective penalty.
Plug into L1: AMAT = H T L 1 + m L 1 × 45.5 = 1 + 0.08 × 45.5 = 1 + 3.64 = 4.64 ns.
Why this step? Now L1's formula uses its real penalty 45.5 ns, not the raw DRAM 150 ns.
Verify: The scary 150 ns DRAM cost only reaches the CPU on the global fraction m L 1 × m L 2 = 0.08 × 0.25 = 0.02 , contributing 0.02 × 150 = 3 ns. Add L2's own hit cost 0.08 × 8 = 0.64 and the flat 1 : 1 + 0.64 + 3 = 4.64 ns. ✅ Same answer two ways.
Worked example Ex 5 — Cell F: global-vs-local trap
You're told: overall (global ) L2 miss rate is 2% , and m L 1 = 8% . What is L2's local miss rate, and does the recursive AMAT formula want local or global here?
Forecast: Is the local rate bigger or smaller than the global 2% ?
Recall the link: global = m L 1 × m L 2 , local .
Why this step? L2 only sees accesses L1 forwarded (the L1 misses). Global counts against all CPU accesses, a bigger denominator, so global is smaller.
Solve for local: m L 2 , local = m L 1 global = 0.08 0.02 = 0.25 = 25% .
Why this step? Divide the global rate by the fraction that even reached L2.
The recursive AMAT term H T L 2 + m L 2 ⋅ M P L 2 uses the local 25% .
Why this step? Inside that term we're standing at L2, and L2 only measures against the traffic it actually receives.
Verify: Convert back: m L 1 × m L 2 , local = 0.08 × 0.25 = 0.02 = 2% global. ✅ Notice these are exactly the numbers from Ex 4 — the local 25% is what plugged into that nested term.
Worked example Ex 6 — Cell G: solve backwards for the unknown
A single-level cache has H T = 2 ns and M P = 100 ns. Measured AMAT = 7 ns. What is the miss rate m ?
Forecast: Roughly what percent — under 10% or over?
Start from AMAT = H T + m ⋅ M P : 7 = 2 + m × 100 .
Why this step? Everything is known except m ; treat the formula as an equation in m .
Isolate the penalty part: 7 − 2 = m × 100 ⇒ 5 = 100 m .
Why this step? Subtract the unconditional hit time to strip AMAT down to the miss contribution.
Divide: m = 100 5 = 0.05 = 5% .
Why this step? Undo the multiply by M P to recover the probability.
Verify: Forward-check: 2 + 0.05 × 100 = 2 + 5 = 7 ns. ✅ And 5% is under 10% , matching a modest AMAT of 7 ns.
Worked example Ex 7 — Cell H: real-world word problem
A web server serves requests. 92% of the time the answer is already in an in-memory cache (hit ), taking 0.3 ms. The other 8% require a disk read (miss ) that adds 12 ms on top of the cache check. What is the average response time?
Forecast: Will the average be near 0.3 ms or near 12 ms? (Think: how heavy is that 8% ?)
Map the story to AMAT: H T = 0.3 ms (always paid — every request checks the cache), m = 0.08 , M P = 12 ms (extra, "on top of").
Why this step? The phrase "adds ... on top of" confirms M P is the extra cost, not the total — matching the standard definition.
Apply: AMAT = 0.3 + 0.08 × 12 = 0.3 + 0.96 = 1.26 ms.
Why this step? Same formula; only the story's words changed.
Verify: The miss contribution 0.96 ms is over three times the hit cost 0.3 ms even though misses are only 8% — the rare-but-expensive misses dominate the average, the whole moral of AMAT. Bounds check: 1.26 lies in [ 0.3 , 12.3 ] ms. ✅
Worked example Ex 8 — Cell I: exam twist, the design tradeoff
You may keep the current cache (H T A = 1 ns, m A = 10% ) or switch to a bigger, slower cache (H T B = 2 ns, m B = 4% ). Both share M P = 100 ns. Which gives the lower AMAT? (See Cache Associativity & Hit Time tradeoff .)
Forecast: Doubling hit time but more than halving miss rate — intuition says B wins... but check!
Cache A: AMAT A = 1 + 0.10 × 100 = 1 + 10 = 11 ns.
Why this step? Baseline to beat.
Cache B: AMAT B = 2 + 0.04 × 100 = 2 + 4 = 6 ns.
Why this step? Higher hit time (+ 1 ns), but far fewer expensive misses (− 6 ns of penalty).
Compare: 6 < 11 , so Cache B wins by 5 ns.
Why this step? The saved penalty (6 ns) beats the extra hit cost (1 ns).
Verify: Net change = ( H T B − H T A ) + ( m B − m A ) M P = ( + 1 ) + ( − 0.06 ) ( 100 ) = 1 − 6 = − 5 ns. ✅ Matches 6 − 11 = − 5 . The lesson: a bigger cache is worth it only when the penalty it saves outweighs the hit time it adds — always plug in, never eyeball.
Figure 2 — Ex 8 tradeoff bars.
Figure 2 makes Ex 8 visible: Cache B's green (hit) bar is taller, but its coral (penalty) bar shrinks far more — the total stack is shorter.
Recall Cover and answer
When m = 0 , AMAT equals what? ::: Exactly the hit time H T (the lower end of the band).
When m = 1 , AMAT equals what? ::: H T + M P — the worst case, every access pays both (the upper end).
AMAT is always bounded between which two values? ::: [ H T , H T + M P ] .
Given global L2 miss rate and m L 1 , how to get local L2 rate? ::: Divide: m L 2 , local = global / m L 1 .
In Ex 8, why did the bigger, slower cache still win? ::: The penalty it saved (6 ns) exceeded the extra hit time it cost (1 ns).
Mnemonic Every scenario, one habit
Always plug in — never eyeball. Bounds first ([ H T , H T + M P ] ), units next, then compute.