Level 0 · Base Camp

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 partIn the kitchenWhat it really does
CPUThe cookFollows instructions, one at a time, absurdly fast
RAM (memory)The counter topHolds what you are working on right now. Wiped when the power goes
Disk (storage)The pantryKeeps things after you switch off. Slower to reach
InputSomeone shouting an orderKeyboard, mouse, microphone, network
OutputThe plate leaving the windowScreen, 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.

ENCYCLOPEDIA[Easy: Success]

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:

BinaryMeaningIn decimal
0001one 11
0010one 22
0011one 2 and one 13
1010one 8 and one 210
11111111128+64+32+16+8+4+2+1255

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.

🎮 Game metaphor

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.

PERCEPTION[Medium: Success]

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:

OperationRoughly how longIf one CPU cycle were one second
Add two numbersunder a nanosecond1 second
Read from memory (RAM)about 100 nanosecondsabout 2 minutes
Read from a fast SSDabout 100 microsecondsabout 1 day
Fetch a web pageabout 100 millisecondsabout 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".

Exercise 1

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.

Exercise 2

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.

📚 Want the deeper version?

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.

+100 XP