Architecture

Cache

A small, fast memory that stores copies of frequently accessed data to reduce average access time.

Detailed Explanation

Caches exploit locality—programs tend to access the same data (temporal locality) and nearby data (spatial locality) repeatedly. When data is found in cache (hit), access is fast. When not found (miss), data must be fetched from slower main memory.

Cache organization involves lines (unit of storage, typically 32-64 bytes), sets (groups of lines), and ways (associativity). Direct-mapped caches have one way; fully associative caches allow any line in any position; set-associative is a practical middle ground.