This page assumes you know nothing. Before you can read the parent note and follow every line of the AMAT derivation (we spell that acronym out in section 7), you must be able to read every symbol in it. We build them one at a time, each on top of the last.
Look at the figure. The CPU is on the left, the warehouse on the right. The red arrow is one trip to fetch a fact. That trip is long. If the CPU had to make that long trip for every single fact it needs, it would spend nearly all its time waiting and almost none working. That waiting is the whole problem this topic exists to solve.
When the parent note says "L1 hits in 4 cycles" and "DRAM costs 200 cycles", it means: fetching from the far warehouse takes 50 times more ticks than fetching from the nearby notebook. That ratio is the enemy.
How the cache is internally arranged (rows, ways, sets) is the subject of Cache Organization — here we only need the black-box behaviour: you ask it for a fact, and it either has it or doesn't.
Look at the figure. Two paths leave the CPU. The short path (a hit) stays inside the fast notebook. The red long path (a miss) is forced to travel onward to the next level. Every access takes exactly one of these two paths. There is no third option — this is why hit and miss rates always add to 1 (we'll see that next).
The parent note's central formula for a single-level cache is:
AMAT=TL1+mL1⋅Tmem
Read it with the symbols we just built: TL1 is the L1 hit time (always paid), mL1 is the L1 miss rate, and Tmem is the DRAM fetch cost paid only on a miss.
Look at the bar in the figure. Every access pays the black base (TL1). Only the miss fraction stacks the red extra on top, and because it's a fraction, the red block is shrunk by m. The height of the whole bar is the AMAT. Making m small (a good cache) squashes the red block toward zero.
Recall Why can't we just add
TL1+Tmem?
Because that would assume every access goes to DRAM, which is false ::: only the miss fraction m does, so we weight the DRAM cost by m.
Multiply (⋅): "how often" × "how much" = average cost of that penalty.
Nest (parentheses inside parentheses): the miss penalty of one level is itself an AMAT of the next level. Compute the innermost parentheses first, then work outward. That's why the parent solves the 3-level example inside-out: L3+mem gives 60, then L2 wraps it to 24, then L1 wraps it to 5.2.
Everything on this page flows downward into the parent topic. Related paths you'll meet later: what happens on a write (Write Policies), how the cache decides what to throw out (Cache Replacement Policies), keeping shared caches consistent (Cache Coherence), and address translation (TLB and Virtual Memory). How caches sit inside the instruction flow is CPU Pipeline.