📊

Trace: Memory Operations

Follow data as it moves through the memory hierarchy step by step.

How to use this activity:

  1. Read the scenario and starting state
  2. Click "Next Step" to advance through each operation
  3. Watch how data moves between different memory types
  4. 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

BIOS Code
POST Instructions
Boot Loader

RAM (8GB)

-
-
-
-

Hard Drive

Windows Kernel
System Files
Desktop Manager
User Programs
Initial

Power Off State: RAM is empty (volatile), ROM has BIOS (non-volatile), Hard drive has OS files (non-volatile).

Step 1

Power On: CPU reads first instruction from ROM. BIOS begins executing.

Step 2

POST: BIOS tests hardware - checks RAM, keyboard, display are working.

Step 3

Find OS: BIOS searches for bootable device (hard drive) and finds Windows.

Step 4

Load Kernel: Windows Kernel copied from hard drive → RAM.

Step 5

Load System Files: Essential system files copied from hard drive → RAM.

Step 6

Load Desktop: Desktop manager loaded into RAM. Computer ready to use!

Step 0 of 6

Trace 2: Virtual Memory in Action

Trace what happens when RAM becomes full and virtual memory is used.

RAM (4GB Total)

OS (1GB)
Free (3GB)
Used: 1GB / 4GB

Virtual Memory (Page File)

-
-
Initial

Starting State: OS using 1GB RAM. 3GB free. Page file empty.

Step 1

Open Chrome: Chrome loads, needs 1.5GB RAM. Total now 2.5GB used.

Step 2

Open Photoshop: Photoshop needs 1.5GB. Total now 4GB - RAM is FULL!

Step 3

Open Game: Game needs 1GB but RAM is full! OS must use virtual memory.

Step 4

Swap Out: Least-used Chrome tabs (0.5GB) moved to page file on hard drive.

Step 5

Game Loads: Game uses the freed RAM space. System slower due to swapping.

Step 6

Switch to Chrome: Swapped tabs needed - loaded back from page file (causes delay!).

Step 0 of 6

Trace 3: Cache Memory Access

Trace how the CPU uses cache to speed up data access.

L1 Cache (64KB)
Empty
L2 Cache (256KB)
Empty
L3 Cache (8MB)
Empty
RAM
Document.docx data
Access Time: -
Initial

Starting State: User opens Document.docx. Data is in RAM, caches are empty.

Step 1

First Access: CPU needs paragraph 1. Checks L1 → MISS. Checks L2 → MISS. Checks L3 → MISS.

Step 2

Load from RAM: Data fetched from RAM (100ns). Copied to L3, L2, and L1 cache.

Step 3

User types: CPU needs same paragraph again. Checks L1 → HIT! Data found instantly.

Step 4

Scroll down: CPU needs paragraph 5. Not in L1 but found in L3 → Partial HIT.

Step 5

Cache fills: L1 now full. Old data pushed to L2, then L3. Hierarchy maintained.

Step 0 of 5

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
← Previous: Example Next: Parsons →