Caches and virtual memory
The memory hierarchy and locality, how a cache finds and replaces blocks, and how virtual memory translates addresses with page tables and a TLB.
About 3 hours of study
Learning objectives
- Compute AMAT for one or two cache levels
- Split an address into tag, index and offset and simulate a cache
- Translate virtual addresses with a page table and a TLB
Lessons
- 1
The memory hierarchy Intermediate
Why computers have registers, caches, main memory and disks: speed against size, locality, and the average memory access time.
- 2
Cache memory Intermediate
How a cache finds data: blocks, direct-mapped and set-associative placement, the tag, index and offset bits of an address, replacement and write policies.
- 3
Virtual memory, page tables and the TLB Intermediate
How every program gets its own address space: pages and frames, page tables that translate addresses, page faults, and the TLB cache that makes translation fast.
Module practice
- Average memory access timeEasy
- Row order or column orderMedium
- Where do the accesses goHard
- Split an address into tag, index and offsetEasy
- A direct-mapped cacheMedium
- A set-associative LRU cacheHard
- Page number and offsetEasy
- Translate with a page tableMedium
- Page translation with a TLBHard
Module quiz
‹ The datapath and the pipelineDevices, interrupts and parallel hardware ›