Program Editor
One instruction per line (0–15)
Input Stream (for INP)
Comma or space-separated integers
Output Tape (from OUT)
Values emitted by AC during execution
CPU Internal Registers
Tracks current & before-last-write valuesHolds RAM address of the next instruction
Drives target address onto the Address Bus
Buffers instruction/data sent over Data Bus
Holds current instruction being decoded
Primary working register for ALU arithmetic (ADD, SUB), loads/stores (LDA, STA), and I/O (INP, OUT)
System Buses (CPU ↔ RAM Interconnect)
Live signal conduitsMain Memory (RAM — 16 Cells)
Shared Von Neumann memory for instructions & data. Click any cell to edit live.
Beyond One Instruction: Memory Hierarchy, Multi-Core & Pipelining
Explore how modern processors overcome the Von Neumann bottleneck using inclusive LRU caches, parallel cores, and instruction pipelines.
Memory Hierarchy — Follow a Read (Fully Associative Inclusive Cache with LRU)
Checking starts at L1 (+1 cost) → L2 (+3 cost) → L3 (+8 cost) → RAM (+25 cost) only on a MISS. A HIT supplies the value immediately, moves the entry to the MRU (Most Recently Used) front of each checked cache, and copies it into any cache level that missed. Inclusive eviction rule: When a larger cache evicts its LRU entry, any copy in smaller caches is removed too.
L1 CACHE (2 Slots)
Lookup Cost: +1 cycle
L2 CACHE (4 Slots)
Lookup Cost: +3 cycles
L3 CACHE (6 Slots)
Lookup Cost: +8 cycles
MAIN MEMORY (RAM)
Lookup Cost: +25 cycles
Independent Cores — Share the Work (1-Core vs. 2-Core Machine & Where a GPU Fits)
Both machines square the same six independent inputs: 2, 3, 4, 5, 6, 7 (producing 4, 9, 16, 25, 36, 49). Each task takes 2 work units on one core. Watch how independent tasks scale across cores.
1-Core Machine (Sequential)
1 core executes all 6 tasks one after another (12 steps total)
2-Core Machine (Parallel)
Core 0 & Core 1 work simultaneously (Finishes in 6 steps!)
Where a GPU Fits (SIMT / Massive Data Parallelism)
While a CPU has a handful of complex cores optimized for sequential branching and low latency, a GPU contains hundreds or thousands of simpler ALUs executing the same instruction across many data elements simultaneously. Because squaring 2, 3, 4, 5, 6, 7 has zero data dependencies between elements, a GPU dispatches all 6 elements in parallel and finishes the entire batch in just 2 steps!
Four-Stage Instruction Pipeline (Sequential vs. 4-Stage Pipelined Execution)
Compare running 5 instructions (LDA 5, ADD 6, STA 7, OUT, HLT) across 4 hardware stages:
F (Fetch),
D (Decode),
E (Execute), and
W (Write-back).
Without pipelining takes 20 clock cycles; overlapping stages in a 4-stage pipeline finishes all 5 instructions in 8 clock cycles!