๐Ÿ–ฅ๏ธ
๐Ÿ–ฅ๏ธ How Computers Work ยท CS-101 ยท Session 3 of 6

What a CPU Actually Does

The CPU is the computer's engine โ€” and what it does is surprisingly humble: fetch a tiny instruction, do it, repeat, billions of times a second. Understanding that loop demystifies the whole machine.

โฑ 8 min read๐Ÿ“… Updated 2026-07-29๐Ÿ“Š Tables, charts & examples

The CPU (central processing unit) is called the computer's 'brain', but that oversells it. What a CPU actually does is humble and repetitive: fetch one tiny instruction, carry it out, move to the next - over and over, billions of times a second. The power comes not from cleverness but from doing incredibly simple steps incredibly fast. Once you see that loop, the machine stops being mysterious.

The fetch-decode-execute loop

At its core the CPU repeats one cycle forever, each time handling a single, tiny instruction.

StepWhat happens
FetchGet the next instruction from memory
DecodeWork out what it says to do
ExecuteDo it (add, compare, move a value...)
RepeatMove to the next instruction

That's the whole engine. The instructions are astonishingly basic - 'add these two numbers', 'compare these', 'if equal, jump to there', 'copy this value'. A running program is millions of these little steps, ticking past faster than you can imagine.

Simple steps, staggering speed

The CPU can't do much in one step - but it does steps at a rate that's hard to grasp.

Roughly how many simple steps per secondA person doing sums~1Early home computer~1,000,000A modern CPU~1,000,000,000+A modern processor runs on the order of billions of simple instructions per second (and has several 'cores' doing this at once). No single step is clever - but a billion humble steps a second is enough to render a game, play video, or run everything on this page.

Humble steps, done fast

  • The CPU repeats fetch -> decode -> execute, forever.
  • Instructions are tiny - add, compare, jump, copy a value.
  • The power is speed - billions of simple steps per second.
  • A program is just millions of these little steps in order.

๐Ÿงฉ Do it with LarzOS

Turn this lesson into action with the exact free tools and AI workflows for the job:

๐ŸŽฏ Key takeaways

  • A CPU repeats one humble loop: fetch an instruction, decode it, execute it, repeat.
  • The instructions are tiny - add, compare, jump, copy a value - not clever on their own.
  • The power comes from speed: billions of simple steps per second, across several cores.
  • A running program is just millions of these little steps carried out in order.

Frequently asked

If each instruction is so simple, how do computers do such complex things?

Through sheer volume and speed, plus clever layering. No single instruction is impressive - 'add two numbers', 'compare two values', 'jump to another instruction if this one was zero'. But a modern CPU does billions of these every second, and complexity is built up in layers: simple instructions combine into small operations (like adding up a list), which combine into functions (like sorting), which combine into features (like a spreadsheet recalculating), which combine into whole applications. Each layer hides the simplicity of the one below. It's a bit like how a novel is 'just' letters - true, but arranged in layers of words, sentences, chapters and story. The computer's genius isn't in any single step; it's that billions of trivial steps per second, organised into layers of abstraction by programmers, add up to something that feels intelligent. This is also why programming is powerful: you work at a high layer, and all those tiny steps happen for you underneath.

What's the difference between a CPU and having multiple 'cores'?

A core is a unit that can run the fetch-decode-execute loop - essentially one worker carrying out instructions one after another. A traditional CPU had a single core, so it did one stream of instructions at a time (very fast, but one at a time). A modern CPU has several cores (dual-core, quad-core, and so on), which means it has multiple workers that can each run their own stream of instructions simultaneously - genuine parallel work, not just fast switching. This helps when there are several things to do at once: one core handles your music while another handles your browser, or a well-written program splits a big job across cores to finish faster. There's a catch: not every task splits neatly across cores (some steps must happen in order, each depending on the last), so more cores don't always mean proportionally faster - it depends on whether the work can be done in parallel. But for running many programs at once, or for software designed to use them, multiple cores are a real speed boost. Think of it as going from one very fast worker to several very fast workers.

Session 3 of 6 complete

Next up: From Code to Running Program

Continue to Session 4 โ†’

Related lessons

More in this course

Course home → · Browse all courses →