serversim
LearnSimulatorTemplatesPricing
…
…
Open menu
Learn↗Simulator↗Templates↗Pricing↗
My DocumentsDocs
Foundations contents/2 / 85min

What does a CPU actually do?

The trapPeople say a CPU "does the math" — but how many different things can it actually do?

See the picture

fetch1 / 3

1. Fetch — take one instruction out of drawer 102

The CPU pulls instructions one at a time out of numbered drawers (memory). This one says "go read the value in drawer 200".

speed

what a person wrote

total = price + tax
compile ↓

what the CPU actually sees

LOAD → ADD → STORE → HALT
MEMORY · numbered drawersinstructions102LOAD R1, [200]103ADD R1, [201]104STORE R1, [202]105HALTdata2007 (price)2015 (tax)202— (total)address bus →← data bus →CPU · where small states changenext drawer number103instruction in handLOAD R1, [200]which button is thisLOADvalue in hand—arithmeticidlecontrol unit · sends the next signalLOADon the move: instruction “LOAD”

what to watch now

A separate slot remembers the drawer number, so as soon as one is taken the number moves on to the next.

state log

next drawer number
103
instruction in hand
LOAD R1, [200]
value in hand
—
drawer 202
—

Follow the sentences

1/38

What exactly does a CPU do?

Text mode advances to the next sentence every 3 seconds.

Picture it this way

A CPU is less a universal calculator than a remote control with very few buttons: read in, add, store, stop.

Only one button can be pressed at a time. And every press goes through the same three steps — take an instruction out of a numbered drawer, work out which button it is, then move a value exactly as told.

Press "next change" above to walk those three steps one at a time. A single line of your code is this three-step bundle, repeated many times over.

Now the numbers

computed · just now

The program on this screen uses only 4 kinds of button — read in, add, store, stop. And every single press goes through the same 3 steps.

If one press costs one beat, a 3GHz CPU can press 3,000,000,000 buttons per second. The next chapter shows why that number does not become performance on its own.

These numbers are not written into the sentence. They are worked out while this page renders.

In one sentence

A CPU is fast not because it is clever, but because it repeats something extremely simple an enormous number of times.

Progress is stored in this browser only (no account, no sync between devices).

Quick check

0 / 3 correct
  1. 1.How does the CPU handle one line like `total = price + tax`?

  2. 2.Memory holds instructions and values side by side. How does the CPU tell them apart?

  3. 3.If a CPU only ever presses one button at a time, why does a computer look like it does many things at once?

New words here

instruction
One button the CPU knows — "fetch this", "add these" — small enough that it cannot be split further.
register
A very small slot holding the one or two values the CPU is handling right now. It is the "value in hand" on the screen above.
memory address
The number on the drawer a value sits in. A CPU finds values by that number, never by a name.

Previous

How do ones and zeros become letters?

Next

Does double the GHz really mean double the speed?

serversim

Learn why servers slow down and fail, then reproduce the same mechanism in a simulator.

© 2025-2026 serversim · Architecture simulation tool

Product

  • Learn
  • Simulator
  • Templates
  • Pricing

Resources

  • Docs
  • Benchmarks
  • Blog

Legal

  • Privacy
  • Terms
  • Refund