Caffeinated Coder
Book an appointment
Lesson 35 · Computer architecture

Caches: keeping memory close to the CPU

Main memory is slow next to a CPU, so every processor keeps a cache: a small, fast copy of memory it used recently. Watch a tiny cache at work, one address at a time. Each address splits into tag, index and offset; the index picks a row, the tag says whether the row holds the right line, and a miss brings the whole line in from memory. Then compare direct-mapped with 2-way set-associative placement, see LRU pick a line to evict, follow a store through write-through and write-back, and work out how hit rate sets the average access time.

14 min11 steps5 questionsAdvanced
Fig 35 · Interactive
Loading figure…
or ← →

Quiz Unlocks after the last step.