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.
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.
| Step | What happens |
|---|---|
| Fetch | Get the next instruction from memory |
| Decode | Work out what it says to do |
| Execute | Do it (add, compare, move a value...) |
| Repeat | Move 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.
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.
Related lessons
How Data Is Stored
Numbers, text, images, sound โ all of it becomes bits by agreeing on a code. Understandingโฆ
How Computers WorkFrom Code to Running Program
You write Python; the CPU only understands tiny binary instructions. Something has to bridโฆ
Data Structures & AlgorithmsAlgorithms & Big-O Made Simple
An algorithm is just a recipe for solving a problem โ and Big-O is a simple way to talk abโฆ