Open the 3D lab
Tech 19 · COMPUTER

Processor
(CPU)

Billions of times a second, each core grabs an instruction, works out what it means, does the sum and saves the answer. Slow it down three billion times and you can watch one core run a tiny program.

TitleHow a processor (cpu) worksDwg no.FIG. 19
DrawnTestIt3DUpdatedRevC
ScaleNTSReading8 minModelLive 3D
FIG. 19 · live model · drag to turn Processor (CPU) 3D model, paused
3.5 GHzticks a second (billions)
0.29 nsone tick at 3.5 GHz
8cores, 16 threads
90 nsto fetch from RAM
95 °Climit before it slows (203 °F)
The short of it

How does a CPU work?

A CPU works by running a list of tiny instructions, one clock tick at a time. Each core fetches an instruction from its cache, decodes it, executes it in the arithmetic unit and writes the answer back to a register. At 3.5 GHz a tick lasts 0.29 ns, so one core can finish billions of instructions every second.

Four clock ticks

Grab. Unpack. Compute. Save.

About one nanosecond in real life: grab, unpack, compute, save.

Processor (CPU) in 3D: fetch
01

Fetch

grab

The program counter points at the next instruction, and the core reads it from its small, fast L1 cache. If it is not there, the core has to wait for RAM, hundreds of ticks away.

Processor (CPU) in 3D: decode
02

Decode

unpack

The core works out what the instruction asks for and which registers hold its numbers, and reads them. Meanwhile the next instruction is already being fetched.

Processor (CPU) in 3D: execute
03

Execute

compute

The arithmetic unit does the work: an addition, an address or a jump. Loads and stores reach out to the L1 data cache.

Processor (CPU) in 3D: write back
04

Write back

save

The answer goes into its register. With four instructions in flight, one finishes every tick, 3.5 billion a second at 3.5 GHz.

Inside one core

What happens in a nanosecond

About 8 minutes of reading.

How does a CPU work? Follow one instruction

Every program you run, a browser, a game, a spreadsheet, ends up as a long list of very small orders. Add these two numbers. Fetch the number stored at this address. Go back to line 0. The processor (CPU, central processing unit) reads that list and carries it out. It never does anything cleverer than that. It just does it absurdly fast.

Our model runs a five-line loop that totals a list of numbers (12, 7, 30, 5, 18 and on). LOAD R1,[R3] pulls the next number from memory into a register, ADD R3,R3,1 moves the pointer along, ADD R2,R2,R1 adds it to the running total, STORE R2,[100] saves the total and JUMP 0 sends the core back to the top. Registers are the core's own scratch slots, the handful of numbers it's using right now. In DETAIL A you can watch R1, R2 and R3 change, plus the PC (program counter), which holds the address of the next instruction.

Each instruction passes through four stages, one tick per stage. Fetch grabs it from the L1 instruction cache. Decode works out the job and reads the input registers. Execute pushes the numbers through the ALU (arithmetic logic unit), the V-shaped block where 121 + 12 becomes 133. Write back stores the result. The stages overlap, so while one instruction executes, the next is being decoded and the one after that fetched. Four are in flight and one finishes every tick. That's a pipeline, and it's why a 3.5 GHz core can finish 3.5 billion instructions a second even though each one spends four ticks inside.

School computer science teaches this as the fetch-decode-execute cycle, usually drawn as one instruction going all the way round before the next begins. The steps are right. The timing is a long way from a modern chip, as the comparison further down shows.

What does GHz mean in a processor?

Open the Performance tab of your task manager while reading this and the CPU speed will probably sit near 1 GHz. Start a game and it leaps to 4 or 5 GHz in a blink. That figure is the clock, the number of ticks per second of the timing signal fed to every part of the chip. Hertz means once a second and giga means a billion, so 3.5 GHz is 3.5 billion ticks.

One tick at 3.5 GHz lasts 0.29 ns (billionths of a second). Light covers only 8.6 cm (3.4 in) in that time, about the long side of a bank card.

The model's Clock speed slider goes from 0.8 GHz, where a desktop chip idles, through the 3.5 GHz base it's rated to hold with every core busy, to a 5.5 GHz boost it reaches only with power and temperature to spare. Real chips hop between these by themselves many times a second.

Why can a newer 3 GHz CPU beat an older 4 GHz one?

Because GHz counts ticks, and what you care about is work. Speed is ticks per second multiplied by work per tick, and engineers call the second number IPC, instructions per clock.

Our teaching core finishes at most one instruction a tick. Real desktop cores have 15 to 20 stages and start 4 to 8 instructions every tick. They read ahead, find instructions that don't depend on each other and run whichever is ready first (out-of-order execution), then put the results back in program order. They also guess which way each jump will go before they know for sure, and they guess right most of the time.

Put rough numbers on it. An older chip that averages 1.5 instructions per tick at 4 GHz manages 6 billion a second. A newer one averaging 3 per tick at 3 GHz manages 9 billion, half as much again, on a slower and cooler clock. We picked those round IPC figures to show the sum; they aren't measurements of any real chip. So compare GHz only between chips of the same design, and across generations look at benchmark results for the work you actually do.

What is cache memory, and why are L1, L2 and L3 so close to the core?

At these speeds the real enemy is waiting. A core with nothing to work on just burns ticks, so each one keeps small, quick stores of recently used instructions and data. In our chip every core has 32 KB of L1 for instructions and 48 KB for data, answering in about 4 ticks (1.1 ns), then 1 MB of L2 at 14 ticks (4 ns). All eight cores share 32 MB of L3 at about 42 ticks (12 ns). RAM, out on the motherboard, takes about 90 ns. At 3.5 GHz that's 315 ticks.

Press Cache miss and watch. The status line reads checking L1, then L1 said no, checking L2, then the same for L3, then out to RAM. A dot runs along the copper memory bus to the RAM stick and back, filling L3, L2 and L1 on the way, so the next fetches hit. Meanwhile the stages ahead drain into empty (bubble) slots that do no work. We drew that wait about 20 times shorter than life; the tick count in the This fetch readout is real.

Now set Clock speed to 5.5 GHz and miss again. RAM still needs 90 ns, which is 495 ticks this time, against 72 at 0.8 GHz. A faster clock makes every miss dearer, and that's why so much of the die is cache.

What are cores and threads?

Tick the All 8 cores layer and the other seven tiles light up. A core is a complete pipeline with its own L1 and L2, able to run its own list of instructions. Eight cores, eight lists at once, and the Instructions per second readout goes from 3.5 billion to 28.0 billion.

The box also says 16 threads. Each core can hold two programs' registers and program counters at once and feed both into the same machinery, so when one stalls on a miss the other fills the gaps. That earns some extra work from idle slots, nowhere near a second core. Our model shows one thread per core.

Video export, 3D rendering and compiling code split happily across every core. Most games and everyday apps lean on a few, so for them clock speed and work per tick count for more.

Why is my CPU so hot, and what is throttling?

Nearly all the power a processor draws ends up as heat in a sliver of silicon about 1.5 cm² (0.23 sq in). It has to cross the thermal paste and the metal heat spreader before the cooler can carry it off. The paste is there to fill tiny gaps that would otherwise trap air, which insulates.

Power rises with voltage squared times clock speed, and a faster clock needs more voltage to switch cleanly. The model's core runs 1.10 V at 3.5 GHz and 1.41 V at 5.5 GHz, so one busy core goes from about 10 W to about 26 W for 57% more clock. Switch on All 8 cores and drag Clock speed to the top. The DIE TEMPERATURE gauge reaches 95 °C (203 °F), the chip's limit, and the Clock readout changes to 4.2 GHz · held back, too hot. That's throttling, the chip cutting its own clock and voltage to stay safe, here at about 126 W.

If your computer throttles in everyday use, check the cooling before blaming the chip. Dust packed into the cooler fins is the usual culprit, then a slow or dead fan, then paste that has dried out over the years. Laptops on a bed or sofa cushion choke their own vents. And room temperature adds straight on, so the same PC runs hotter on a 40 °C (104 °F) afternoon in Delhi or Phoenix than in an air-conditioned office. Unplug before you clean anything, and leave repasting to a repair shop if you're unsure.

Waiting times

How far away is the data?

The model's numbers at 3.5 GHz, plus a human-scale version where one tick lasts one second.

SizeWait in ticksWait in nsIf a tick took 1 s
L1 cache32 KB + 48 KB per core41.14 seconds
L2 cache1 MB per core14414 seconds
L3 cache32 MB, shared by 8 cores421242 seconds
RAM16-32 GB typical315about 90about 5 minutes
SSD, typical0.5-2 TB typicalabout 175,000-350,000about 50,000-100,0002 to 4 days

Cache and RAM figures are the model's rounded values; real chips differ by design. The SSD row is a rough typical read for a fast drive and varies a lot between drives.

Heat arithmetic

Why the last 2 GHz cost so much power

One busy core, using the model's rule that power follows voltage squared times clock.

Base clock and voltage3.5 GHz at 1.10 V
Boost clock and voltage5.5 GHz at 1.41 V
Clock rises by5.5 ÷ 3.5 = 1.57×
Voltage squared rises by1.99 ÷ 1.22 = about 1.63×
Power per core rises by1.57 × 1.63 = about 2.6×
One busy coreabout 10 W, then about 26 W
Power readout, one core busy26 W at 1.10 V, then 41 W at 1.41 V
Die temperature, one core busy48 °C (118 °F), then 73 °C (164 °F)
All 8 cores at 5.5 GHz would needabout 220 W, far past 95 °C
So the chip settles atabout 4.2 GHz, 126 W, 95 °C (203 °F)

Teaching values: about 12 W for the shared caches, memory controller and I/O, and a good tower cooler in a 25 °C (77 °F) room. Real chips vary with silicon, cooler and case airflow.

Socket to lid

Twelve layers of a desktop chip

Every one is labelled in the 3D lab. Turn the model to find them.

Exploded view of the parts of a processor (cpu)
Illustration of the main parts. Find each one moving in the 3D lab.
  1. Heat spreader
  2. Thermal paste
  3. Silicon die
  4. CPU core
  5. Shared L3 cache
  6. Memory controller
  7. Substrate
  8. Gold LGA pads
  9. Socket pins
  10. RAM stick
  11. I/O to graphics and SSD
  12. Memory bus
Classroom vs chip

The school fetch-decode-execute cycle vs a real desktop core

The textbook loop is a fair first picture. This is what it leaves out.

Textbook cycle

StepsFetch, decode, execute
Instructions in progressOne at a time
OrderExactly as written
JumpsFollowed when reached
Where data comes fromMain memory
Finished per tickLess than one
Registers you meetPC, MAR, MDR, CIR, accumulator

Desktop core today

StepsAbout 15 to 20 pipeline stages
Instructions in progressHundreds, across stages and queues
OrderOut of order, results put back in order
JumpsGuessed in advance (branch prediction)
Where data comes fromL1, L2, L3 first; RAM only on a miss
Finished per tickSeveral, on friendly code
Registers you meetNamed ones, with many hidden copies behind them

Our 3D model sits between the two: four stages, one instruction in each, one finished per tick, and a stall only when the cache misses.

CPU questions

What people ask before they upgrade

Short, straight answers. Open one to read it.

What does GHz mean in a processor?

GHz is billions of clock ticks per second. A 3.5 GHz processor ticks 3.5 billion times a second, and each tick moves every instruction in the pipeline one step on. It only compares fairly between chips of the same design, because newer cores do more work per tick.

What is a CPU core?

A core is one complete processing unit inside the chip, with its own pipeline, registers and small L1 and L2 caches. An 8-core processor can run eight separate streams of instructions at the same time, while all of them share the larger L3 cache and the memory controller.

Are 16 threads the same as 16 cores?

No. Threads let each core juggle two programs at once, filling idle moments in one with work from the other. That adds a modest amount of throughput on jobs that split well, but an 8-core, 16-thread chip is still eight cores, and it falls well short of a true 16-core chip.

Is 90 °C too hot for a CPU?

Under heavy load many desktop and laptop chips are designed to run close to their limit, which is often 95 to 105 °C, and they slow themselves down to stay under it. Hitting 90 °C while browsing or sitting idle is different; that points to dust, a failing fan or blocked vents.

How many cores do I need?

As a typical guide, 4 to 6 cores handle browsing, office work and schoolwork comfortably, 6 to 8 suit most gaming, and video editing, 3D rendering or compiling large projects keep making use of 12 or more. Work per tick and cache size matter as much as the count.

Which CPU brand is better?

It's one of the most common questions, and there's no permanent winner. The big desktop chip makers both build good processors and trade the lead between generations. Compare independent benchmarks for the programs you use, at your budget, and include the cost of the motherboard and cooler.

Why does my CPU speed keep changing?

That's normal. The chip drops its clock, often below 1 GHz, when there's little to do, saving power and keeping the fan quiet, then boosts within milliseconds when you open something demanding. It also eases off if it runs short of cooling or power.

What is the fetch-decode-execute cycle?

It's the basic loop every processor follows. Fetch reads the next instruction from memory using the program counter, decode works out what it asks for, and execute carries it out, often with a write-back step to save the result. Real cores overlap many instructions at different stages instead of doing one at a time.

Chip talk

Words from the box and the settings screen

Clock speed
How many timing ticks the processor makes each second, measured in GHz (billions per second).
Core
A complete processing unit inside the chip that can run its own stream of instructions.
Thread
One stream of instructions; many cores can keep two threads going at once to fill idle slots.
Register
A tiny storage slot inside the core holding a number it is working on right now.
ALU
Arithmetic logic unit, the part of a core that adds, compares and calculates addresses.
Pipeline
Overlapping stages that let a core work on several instructions at once, each at a different step.
Cache
Small, fast memory on the chip (L1, L2, L3) that keeps recently used instructions and data close to the cores.
IPC
Instructions per clock, the average amount of work a core gets done in each tick.
Throttling
The processor lowering its own clock and voltage to stay under its temperature or power limit.
Spec-sheet traps

CPU beliefs that don't hold up

"More GHz always means a faster CPU." Only between chips of the same design. A newer core that does twice the work per tick can beat an older one clocked 1 GHz higher.

"Eight cores make every program eight times faster." Only work that splits into independent pieces, such as video export or rendering, scales like that. Many games and everyday apps lean on a few cores.

"The processor reads everything straight from RAM." Most fetches come from the L1 cache in about 1 ns. A trip to RAM takes around 90 ns, hundreds of ticks, so the chip does it as rarely as it can.

"A CPU that slows down when hot is broken." Throttling is built-in protection. Clean the cooler and check the fan, and the full speed usually comes back.

Cool and quick

Keeping a processor out of the red

  • A higher GHz number only compares fairly between chips of the same design; newer cores do more work per tick.
  • Heat rises much faster than clock speed, because a faster clock needs a higher voltage too.
  • A CPU that reaches its temperature limit slows itself down to stay safe. Clean dust from the cooler and check the fan before blaming the chip.
Your turn

Tell us what to build next

Name a machine you have always wondered about. We build the most requested ones first.

We read every idea. The most asked-for machines get built first. See our privacy policy.