Virtual Memory — Demand Paging & CPU Execution

Program chopped into pages → stored on disk → loaded into RAM on demand → executed by CPU. 3 physical frames + 4 program pages = page faults and FIFO replacement.
Speed: Step 0  |  Hits: 0   Faults: 0  |  Evictions: 0

CPU

Program Counter
0
page 0, offset 0
— press Step to begin —

Disk (Swap / Backing Store) all 4 program pages

Page on disk Being read Already loaded

Physical Memory (RAM) 3 frames — limited!

Just loaded Being evicted Accessed

Page Table

PageValidFrame
Valid bit = ✓ means page is in RAM.
✗ means page is still on disk → page fault!
Replacement policy: FIFO

Execution Log

Key concepts illustrated