Chapter 9 · Simulation

Paging and Address Translation

← Chapter 9
Size
Pages 8
Frames 6
TLB 4
1.5/s
1Virtual address 2Split p | d 3TLB 4Page table 5Physical
Virtual–
Physical–
Page tablepage · present · frame
Physical memory

Paging and Address Translation

The CPU generates virtual addresses. Each virtual address is split into a page number p (high bits) and an offset d (low bits). The TLB is consulted first; on a TLB miss the page table is read. A page that is present in memory supplies its frame f, and the physical address is f × page size + d. Accessing a page whose present bit is 0 causes a page fault.

Usage

  • The top row sets the page size, the number of virtual pages, the number of physical frames and the number of TLB entries.
  • Type virtual addresses (decimal, space-separated) or pick a preset list; the shuffle button fills the page table randomly.
  • Play the five stages of each translation or step through them.
  • The page table can be edited at any step: click a present bit or type a frame number.
  • The chart button compares the hits of TLBs of size 1–8 on the same address list; clicking a bar selects that size.

Terms

p
Page number = virtual address div page size (high bits).
d
Offset = virtual address mod page size (low bits); copied unchanged.
TLB
A cache of recently used page → frame mappings; the least recently used (LRU) entry is replaced.
Present
1 = the page is in a frame; 0 = page fault.
PA
Physical address = frame × page size + d.
Editing
Each frame holds at most one page (choosing an occupied frame swaps the pages). The edited page’s TLB entry is invalidated.

Legend

p bits d bits f bits / new TLB entry ✓ TLB hit ✗ miss / page fault

Keys

←→ stepSpace playHomeEnd first / lastEsc close