This document discusses memory hierarchy and caching. It begins by describing the memory hierarchy pyramid from fastest and smallest (registers) to slowest and largest (disk). The key concepts of locality of reference—temporal and spatial locality—are introduced. Cache aims to exploit locality by storing recently accessed data in faster memory closer to the CPU. Direct mapping, set associative mapping, and fully associative mapping are described as techniques for mapping memory blocks to cache lines. Replacement policies for determining which cache line to overwrite are also discussed.