Apex › Hardware

The CPU cache — sets, ways & the address split

The small fast SRAM that hides main memory's ~100 ns latency behind ~1 ns hits, by exploiting locality. A physical address splits into tag / set-index / byte-offset; the index picks a set, and the tag is compared against every way in it — a hit is fast, a miss fetches the 64-byte line and evicts the least-recently-used way. Change the associativity and run access patterns to watch conflict misses appear on a direct-mapped cache and vanish on a set-associative one.

More in Hardware