Daylila
How computers actually work

Lesson 1 of 13

The bit: on or off

Explain that a computer stores and moves everything as one of two states (on/off, 1/0), and why two states — not ten — is the choice that makes it reliable.

01 · Learn · the idea

Flip a light switch. It is on, or it is off. There is no “slightly on,” no “two-thirds on.” That hard, dumb, two-way certainty is the most important idea in this whole course. A computer is built from millions of switches exactly like it — and everything it ever does, every photo it holds and every sum it works out, is stored as a pattern of those switches sitting on or off.

That’s the claim. It sounds too simple to be true. Let’s see why it has to be that way.

A computer holds everything as one of two states

Inside the machine, a tiny switch is either letting electricity through or it isn’t. We give those two states names: on and off, or 1 and 0, or true and false — same thing, different words. One such switch holds one bit. A bit is the smallest piece of information there is: the answer to a single yes-or-no question.

One bit can’t say much. But line up enough of them and a pattern of ons and offs can stand for anything you like — a number, a letter, the colour of one dot on your screen. We’ll see exactly how in the next two lessons. For now, hold the picture: under every file, every app, every video, there is nothing but a long row of switches, each one plainly on or off.

Why two states, and not ten?

Here’s the obvious question. We count in tens. A wire could carry a low voltage or a high one — why not use ten voltage levels and pack ten times as much into every wire? It seems wasteful to use only two.

The answer is the quiet hero of the digital age: two states survive a messy world; ten don’t.

Electricity is never perfectly clean. Wires pick up interference. Voltages sag and spike a little. A signal that left as exactly 6 volts might arrive as 5.7 or 6.4. That wobble — call it noise — is always there.

A worked example: the noisy wire

Imagine a wire that can carry 0 to 9 volts, and we use ten levels: 0 V means the digit 0, 1 V means 1, 2 V means 2, and so on up to 9 V for 9. The levels sit just 1 volt apart.

Now send the digit 6 — that’s 6 volts. Along the way it picks up half a volt of noise and arrives as 6.5. The machine at the far end has to guess: is that a slightly-high 6, or a slightly-low 7? The levels are so close together that a little noise pushes one digit into the next. The message corrupts. Send a million digits and a steady fraction of them arrive wrong.

Now do it with two states. Let 0 volts mean 0, and 9 volts mean 1 — and agree on a simple rule: anything below 4.5 volts is a 0, anything above is a 1. Send a 1: that’s 9 volts. The same half-volt of noise makes it 8.5, or even a full 2 volts of noise makes it 7. Still miles above 4.5. Still unmistakably a 1. To flip a 1 into a 0 you’d have to knock 4.5 volts off it — a wallop of noise, not a wobble.

Same wire, same noise. The ten-level scheme drowns in it; the two-level scheme shrugs it off. That enormous gap between “definitely off” and “definitely on” is exactly what buys the reliability. You give up packing more per wire, and you get back a machine that can run billions of operations a second and get every one of them right.

Cheap, fast, and never quite sure — but always decisive

There’s a second reason two states win. A switch that only has to be fully on or fully off can be made absurdly small, absurdly cheap, and flipped absurdly fast. A modern chip holds billions of them. If each switch had to hold ten distinct, stable voltage levels, it would be slower, fussier, and far harder to shrink. Two states is the design that scales.

So the machine pays a price — it can only ever say yes or no, never “maybe.” And it makes up for that bluntness with sheer numbers and speed. A blurry analogue signal degrades a little every time you copy it. A row of clean on/off bits can be copied a billion times and the billionth copy is identical to the first. That is why a song streamed across the planet sounds exactly as it was recorded, and a photo forwarded a hundred times never fades.

The whole tower stands on this

Everything else we build in this course — counting, arithmetic, memory, the processor, the operating system, the app in front of you — sits on top of this one decision: represent the world with switches that are firmly on or off, and never anything in between. It looks like a limitation. It’s the foundation.

It’s worth sitting with how much rests on so little. The device in your hand feels clever, almost knowing. Underneath, it is millions of the dumbest possible objects — switches — each doing the one thing a switch can do, fast and in unison. There is no cleverness down there at all. The cleverness is entirely in how the simple parts are arranged, layer on layer, all the way up. We start the climb next, with how a few switches learn to count.

02 · Try · the lab

03 · Check · quick quiz

1. What is a single bit?

  • The answer to one yes-or-no question — a switch that is on or off
  • A tiny picture made of eight dots
  • One letter of text
  • A number between 0 and 9
Answer

The answer to one yes-or-no question — a switch that is on or off — A bit is the smallest piece of information: one switch, on or off, 1 or 0. Letters, pictures and bigger numbers are all built by lining up many bits — which is the next two lessons.

2. Why do computers use just two states (on/off) instead of ten voltage levels per wire, which would pack in more?

  • Two states are easier for people to read on a screen
  • Ten levels were tried and turned out to be illegal
  • With only two states the gap between them is huge, so noise can't flip one into the other
  • Two states use less electricity than ten
Answer

With only two states the gap between them is huge, so noise can't flip one into the other — The win is reliability. Real wires pick up noise. Ten levels sit close together, so a small wobble tips one digit into the next. Two states sit far apart, so it takes a huge jolt to mistake a 1 for a 0.

3. A wire carries 0–9 volts. In a two-state scheme, anything above 4.5 V counts as a 1. You send a 1 (9 V) and it picks up about 2 volts of noise on the way. What does the far end read?

  • A 0 — the noise corrupted it
  • A 1 — 7 volts is still well above the 4.5 V line
  • Something in between, like 0.7
  • Nothing — the wire rejects noisy signals
Answer

A 1 — 7 volts is still well above the 4.5 V line — 9 volts minus 2 of noise is 7 volts — still far above the 4.5 V threshold, so it reads as a clean 1. To flip it to a 0 you'd have to knock off more than 4.5 volts. That wide margin is the whole point.

4. A song is streamed to a phone on the other side of the world, copied across many machines on the way. Why does it arrive sounding identical to the original?

  • The internet is fast enough that the signal has no time to fade
  • Each copy is checked by a person before it is sent on
  • It is a row of clean on/off bits, and copying on/off values introduces no fading
  • Streaming services re-record the song at each step
Answer

It is a row of clean on/off bits, and copying on/off values introduces no fading — An analogue signal degrades a little with every copy. A pattern of bits is just 'on or off' — copying it perfectly is easy, so the billionth copy matches the first. That faithful copying is a direct payoff of using two clean states.