Trace: Memory Operations
Follow data as it moves through the memory hierarchy step by step.
How to use this activity:
- Read the scenario and starting state
- Click "Next Step" to advance through each operation
- Watch how data moves between different memory types
- Pay attention to what happens at each stage
Trace 1: Computer Boot Sequence
Trace how a computer starts up and loads the operating system.
ROM
RAM (8GB)
Hard Drive
Power Off State: RAM is empty (volatile), ROM has BIOS (non-volatile), Hard drive has OS files (non-volatile).
Power On: CPU reads first instruction from ROM. BIOS begins executing.
POST: BIOS tests hardware - checks RAM, keyboard, display are working.
Find OS: BIOS searches for bootable device (hard drive) and finds Windows.
Load Kernel: Windows Kernel copied from hard drive → RAM.
Load System Files: Essential system files copied from hard drive → RAM.
Load Desktop: Desktop manager loaded into RAM. Computer ready to use!
Trace 2: Virtual Memory in Action
Trace what happens when RAM becomes full and virtual memory is used.
RAM (4GB Total)
Virtual Memory (Page File)
Starting State: OS using 1GB RAM. 3GB free. Page file empty.
Open Chrome: Chrome loads, needs 1.5GB RAM. Total now 2.5GB used.
Open Photoshop: Photoshop needs 1.5GB. Total now 4GB - RAM is FULL!
Open Game: Game needs 1GB but RAM is full! OS must use virtual memory.
Swap Out: Least-used Chrome tabs (0.5GB) moved to page file on hard drive.
Game Loads: Game uses the freed RAM space. System slower due to swapping.
Switch to Chrome: Swapped tabs needed - loaded back from page file (causes delay!).
Trace 3: Cache Memory Access
Trace how the CPU uses cache to speed up data access.
L1 Cache (64KB)
L2 Cache (256KB)
L3 Cache (8MB)
RAM
Starting State: User opens Document.docx. Data is in RAM, caches are empty.
First Access: CPU needs paragraph 1. Checks L1 → MISS. Checks L2 → MISS. Checks L3 → MISS.
Load from RAM: Data fetched from RAM (100ns). Copied to L3, L2, and L1 cache.
User types: CPU needs same paragraph again. Checks L1 → HIT! Data found instantly.
Scroll down: CPU needs paragraph 5. Not in L1 but found in L3 → Partial HIT.
Cache fills: L1 now full. Old data pushed to L2, then L3. Hierarchy maintained.
What You've Learned
Boot Sequence
- BIOS in ROM starts the process
- OS loaded from hard drive to RAM
- CPU executes from RAM
Virtual Memory
- Used when RAM is full
- Data swapped to hard drive
- Causes slowdowns
Cache Memory
- Stores frequently used data
- Much faster than RAM
- Cache hits = fast access