๐Ÿง  What's Inside a Computer?

CPU Simulator โ€” Von Neumann Architecture

The CPU is the "brain" of the computer. But how does it actually work? Watch data flow through the processor, step by step, as it fetches, decodes and executes instructions.

CS GCSE ยง1.1.1 CS A-Level Unit 1 DigiTech GCSE ยง1.1.2

๐Ÿค” What is the Von Neumann architecture?

In 1945, mathematician John von Neumann designed a computer layout that's still used in every PC, phone and games console today. The key idea: instructions and data are stored in the same memory, and the CPU fetches them one at a time.

๐Ÿ• Analogy: Imagine a chef (the CPU) in a kitchen. The recipe (instructions) and ingredients (data) are both stored in the same cupboard (RAM). The chef reads one step, gets the ingredients needed, does the task, then reads the next step. That's the Fetch-Decode-Execute cycle.
๐Ÿ”ง

The CPU โ€” interactive diagram

Click "Step" to watch one Fetch-Decode-Execute cycle. Watch data move between components along the buses.

Ready โ€” click Step or Auto-run
๐Ÿง  Central Processing Unit (CPU)
Control Unit (CU) โ€” the "manager"
PC (Program Counter)
0
Where are we in the program?
CIR (Current Instruction)
โ€”
What instruction are we running?
ALU (Arithmetic Logic Unit) โ€” the "calculator"
ACC (Accumulator)
0
Result of calculations
MAR (Memory Address)
โ€”
Which address to read/write?
MDR (Memory Data)
โ€”
What data was read/written?
๐Ÿ“ Address Bus โ†’ ๐Ÿ“ฆ Data Bus โ†” โšก Control Bus โ†’
๐Ÿ’พ RAM (Main Memory)
๐Ÿ”„

The Fetch-Decode-Execute Cycle

This cycle repeats billions of times per second. Every instruction goes through these three stages:

๐Ÿ“ฅ
1. Fetch
PC โ†’ address bus โ†’ MAR
RAM sends instruction โ†’ MDR
MDR โ†’ CIR
PC increases by 1
๐Ÿ”
2. Decode
Control Unit reads the CIR
Splits it into:
โ€ข Opcode (what to do)
โ€ข Operand (data/address)
โšก
3. Execute
Carries out the instruction:
โ€ข Calculate (ALU does maths)
โ€ข Load/store data from/to RAM
โ€ข Branch (jump to different address)
๐Ÿ“ Exam tip: You must know the role of each register (PC, MAR, MDR, CIR, ACC) and the three buses (address = where, data = what, control = read/write signal). The FDE cycle is one of the most commonly examined topics.
โšก

What makes a CPU faster?

FactorWhat it meansAnalogy
Clock SpeedHow many cycles per second (measured in GHz). 3 GHz = 3 billion cycles/sec.How fast the chef reads the recipe
CoresMultiple CPUs on one chip. 4 cores = 4 tasks at once.4 chefs in one kitchen
CacheTiny, super-fast memory inside the CPU. Stores frequently used data.Ingredients on the counter vs in the cupboard
Word SizeHow many bits processed at once. 64-bit CPU handles 64 bits per cycle.Size of the chef's hands โ€” bigger = carry more