Skip to main content

Memory hierarchy

Short answer

Memory hierarchy arranges memories from fast, small, expensive near CPU to slow, large, cheap far away. It is formed because no single memory balances speed, size, and cost; locality of reference ensures most accesses hit upper levels, giving illusion of fast large memory.

What is memory hierarchy and why is it formed in a computer system? Draw the memory hierarchy.

The memory hierarchy arranges the different memories of a computer in levels, from small, fast and costly memory near the CPU to large, slow and cheap memory far from it.

It is formed because no single memory is at once fast, large and cheap. Going down the hierarchy: (i) cost per bit decreases, (ii) capacity increases, (iii) access time increases, and (iv) the frequency of access by the CPU decreases. Because of locality of reference, most accesses are satisfied by the upper levels, so the system behaves almost as fast as the top level and almost as large and cheap as the bottom level.

Memory hierarchy

          Faster, smaller, costlier per bit
              /\
             /  \        CPU registers
            /----\       Cache (L1, L2, L3)
           /------\      Main memory (RAM)
          /--------\     Secondary: hard disk / SSD
         /----------\    Tertiary: optical disc, tape
        Slower, larger, cheaper per bit

✓ Answer checked by Claude Opus 5.5 (high effort)

All Computer Organization and Architecture chapter 6 questions →