What a Computer Actually Is 🧠
Before you tell a machine what to do, it helps to know what the machine is. Good news: it is much dumber than you think, and that is exactly why it works.
The world's fastest, dumbest kitchen
Picture a kitchen with one cook. The cook is unbelievably fast: billions of actions per second. The cook is also completely literal and has no imagination whatsoever. If your recipe says "add salt" without saying how much, the cook does not guess. The cook stops and files a complaint.
That kitchen is your computer. The parts:
| The part | In the kitchen | What it really does |
|---|---|---|
| CPU | The cook | Follows instructions, one at a time, absurdly fast |
| RAM (memory) | The counter top | Holds what you are working on right now. Wiped when the power goes |
| Disk (storage) | The pantry | Keeps things after you switch off. Slower to reach |
| Input | Someone shouting an order | Keyboard, mouse, microphone, network |
| Output | The plate leaving the window | Screen, speakers, files, network |
That is it. That is the whole machine. Every app you have ever used, every game, every video call, is that loop: get input, move things around on the counter, produce output. Repeat several billion times a second until someone pulls the plug.
The pattern has a name: the stored-program computer, sketched out by John von Neumann and colleagues in 1945. The radical idea was that instructions and data could live in the same memory. Before that, you rewired the machine to change the program. Literally. With cables.
Why everything is numbers
A computer stores everything using switches that are either off or on. One switch is a bit. Eight of them make a byte, which gives 256 possible combinations, which is enough for one letter in the old days or a fragment of a character today.
Counting with two symbols instead of ten is binary. You already know how this works, you just do it with ten fingers instead of two:
| Binary | Meaning | In decimal |
|---|---|---|
0001 | one 1 | 1 |
0010 | one 2 | 2 |
0011 | one 2 and one 1 | 3 |
1010 | one 8 and one 2 | 10 |
11111111 | 128+64+32+16+8+4+2+1 | 255 |
Text is numbers too. There is a giant agreed-upon table called Unicode that says "the number 65 means capital A" and "the number 128013 means 🐍". Images are numbers for colours. Sound is numbers for air pressure. Your holiday photos, your bank balance and the entire internet are, at the bottom, extremely long numbers being pushed around by a very fast idiot.
Think of a game's tick: 60 times a second the console reads your controller, updates every position, and draws a frame. That is input, process, output, sixty times a second. Your program will do the same thing, just slower and with fewer explosions.
What "running a program" means
A program is a file full of instructions. Running it means: copy the instructions from the pantry (disk) onto the counter (memory), then let the cook (CPU) work through them. When the cook reaches the end, the program stops and the counter is cleared.
The CPU does not understand English, or Python, or anything you would recognise as language. It understands a few hundred numeric instructions with names like "add these two numbers" and "jump back four instructions". Everything else, every language you have ever heard of, exists to spare you from writing that by hand.
Look closer at the phrase 'jump back four instructions'. That is a loop. That is the whole idea of a loop, at the bottom of the machine, and you will meet it again in Lesson 8 wearing a nicer coat.
Fast, but not magic
A modern CPU runs at a few billion cycles per second. Some scale, so the numbers stop being abstract:
| Operation | Roughly how long | If one CPU cycle were one second |
|---|---|---|
| Add two numbers | under a nanosecond | 1 second |
| Read from memory (RAM) | about 100 nanoseconds | about 2 minutes |
| Read from a fast SSD | about 100 microseconds | about 1 day |
| Fetch a web page | about 100 milliseconds | about 3 years |
This table explains most performance advice you will ever hear. Touching the network is millions of times slower than doing arithmetic, which is why programs that feel slow are almost never "doing too much maths" and almost always "waiting for something".
Name the parts
Without looking back up the page: which part of the computer forgets everything when you turn the power off, and which part remembers?
Reveal solution
RAM (memory) forgets. Disk (storage) remembers. That is why an app asks you to save: saving means copying from the counter to the pantry.
This is also why 'have you tried turning it off and on again' works so often. It wipes the counter and starts clean.
Count like a computer
What is 0110 in ordinary decimal numbers? The columns, from right to left, are worth 1, 2, 4, 8.
Reveal solution
6. There is a 4 and a 2 switched on: 4 + 2 = 6.
The Rusty School's Level 0 covers the same ground from a systems angle, and goes further into how memory is laid out: How a Computer Thinks. Two explanations of the same thing from different angles is one of the best learning tricks there is.