Florence's Computing · Data · Lesson 1
0 / 1

Everything,
made of two.

A computer has no words, no pictures, no music inside it — only millions of tiny switches, each one on or off. From those two states alone, it builds the whole world it shows you.
For Florence,
counting in twos.
Florence's Computing · Lesson 1
Why two

A machine that only knows on and off.

Open up a computer and there is nothing in there that looks like a photograph or a song. There are no little letters stored in tiny boxes. What there is — billions of times over — is a switch. A microscopic switch that can be in one of two states: letting electricity through, or not. On, or off. That is the whole vocabulary the machine has to work with.

It would seem easier to build a machine that could tell apart ten levels of electricity, one for each digit nought to nine. Engineers tried. The trouble is that electricity is noisy — voltages wobble, wires warm up, signals fade along a cable. A machine asked to tell "level six" from "level seven" makes mistakes. But a machine asked only "is there a signal, yes or no?" almost never does. Two states are far apart, and far apart is reliable. So the whole of computing is built on the steadiest question there is: on or off?

We write those two states as numbers — 0 for off and 1 for on. A number system with only two digits is called binary. Everything else in this lesson grows out of that one idea: if you have enough switches, and a way of agreeing what the pattern of 0s and 1s means, you can store anything at all.

Binary in one line

We count in tens because we have ten fingers — that is called decimal, or base ten. A computer counts in twos because each digit is a switch — that is binary, or base two. Same idea, different number of digits to play with.

A detail worth knowing
30–45 seconds · MF 1
Cool fact

The word bit is short for "binary digit". It was coined by a mathematician named John Tukey in 1947, and the scientist Claude Shannon used it in the paper that founded the whole field of information theory a year later. A single bit is the smallest possible piece of information there is: the answer to one yes-or-no question.

Florence's Computing · Lesson 1
The building blocks

A bit, and a byte.

A single 0 or 1 is a bit. One bit on its own can't say much — only "off" or "on", which is two possibilities. But bits gang up. Put bits in a row and each one you add doubles the number of patterns you can make. Two bits give four patterns (00, 01, 10, 11). Three bits give eight. The number you reach for most often is eight bits together, and that group has its own name: a byte.

Why eight? It turned out to be a comfortable size — big enough to hold a single letter, a small number, or one shade of grey, and it has stuck as the standard chunk computers move around. When someone says a file is "two thousand bytes", they mean it is sixteen thousand on-or-off switches, arranged in a particular pattern.

ONE BIT 1 a single 0 or 1 — one switch ONE BYTE — EIGHT BITS 1 0 1 1 0 1 0 1 8 bits = 1 byte
One bit is a single switch. Eight of them side by side make a byte — the standard chunk a computer works with. Original schematic
Each bit doubles the patterns

1 bit → 2 patterns. 2 bits → 4. 3 bits → 8. Keep going and a byte of 8 bits reaches 256 patterns. Each switch you add to the row doubles how much the row can say.

Cool fact

A group of four bits — half a byte — has the cheerful official name nibble. Computer engineers really did name it that, as a small joke about a byte. A nibble holds sixteen patterns, which is exactly why programmers like writing numbers in groups of sixteen, a system called hexadecimal.

Florence's Computing · Lesson 1
Counting in twos

Place values — the trick that makes binary click.

You already know how place value works in decimal, even if you've never said it aloud. In the number 235, the 2 is worth two hundreds, the 3 is worth three tens, the 5 is worth five ones. Each column to the left is worth ten times the one before. Binary does exactly the same thing — except each column is worth twice the one before, not ten times.

So reading from the right, the columns in a byte are worth: 1, 2, 4, 8, 16, 32, 64, 128. To turn a binary number into an ordinary number, you add up the column values wherever there is a 1. Here is the pattern 00001011 worked out:

128 64 32 16 8 4 2 1 0 0 0 0 1 0 1 1 8 2 1 8 + 2 + 1 = 11
The three shaded columns hold a 1, so we add their values: 8 + 2 + 1 = 11. Original schematic

Going the other way — turning an ordinary number into binary — you work from the biggest column down. Take 19. The biggest place value that fits is 16, so write a 1 there; that leaves 3. Next is 8 — too big, write 0. Then 4 — too big, write 0. Then 2 — it fits, write 1, leaving 1. Then 1 — it fits, write 1, leaving 0. So 19 in binary is 10011. You can always check: 16 + 2 + 1 = 19.

A detail worth knowing
30–45 seconds · MF 1

Tap each card — a few binary patterns and what they come to:

0001 Only the 1s column → 1.
0010 Only the 2s column → 2.
0101 4 + 1 → 5.
1010 8 + 2 → 10.
1111 8 + 4 + 2 + 1 → 15.
Cool fact

With four fingers and a thumb on one hand, treating each finger as a binary digit, you can count from 0 all the way to 31 on a single hand — far past the usual 5. Add the other hand and you reach 1,023. Each finger is one switch, up or down, holding one bit.

Florence's Computing · Lesson 1
From numbers to letters

One byte, 256 values — and how text becomes numbers.

A byte has eight columns, and if all eight hold a 1, you get 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1 = 255. Counting the all-zeros pattern as well, a single byte can hold any whole number from 0 to 255 — that's 256 different values. This is the reason 256 turns up everywhere in computing: it is what one byte can hold.

So a byte can store a number. But how do you store a letter? The answer is wonderfully simple: you agree, in advance, on a number for every letter, and store that number. The oldest agreement of this kind is called ASCII. In ASCII, capital A is the number 65, B is 66, C is 67, and so on. Lower-case a is 97. A space is 32. The word "Hi" is two bytes: 72, then 105.

The letter A = 65 in ASCII = 128 64 32 16 8 4 2 1 0 1 0 0 0 0 0 1 64 + 1 = 65, the code for A
Stored on a real computer, the letter A is the byte 01000001 — two switches on, six off. Original schematic
Why letters near each other have near numbers

The ASCII codes for A, B, C run 65, 66, 67 in order, and a, b, c run 97, 98, 99. That tidy ordering is deliberate — it means a computer can sort words into alphabetical order by comparing their numbers.

Cool fact

ASCII only had room for English. Today most computers use a much larger code called Unicode, which has a number for nearly every character in every written language on Earth — Arabic, Chinese, Tamil, ancient Egyptian hieroglyphs — and even every emoji. There are now over 150,000 characters with their own agreed number.

Florence's Computing · Lesson 1
Pictures and sound

Even photographs and music are only numbers.

Once you can store numbers, you can store almost anything — you need only a way of turning the thing into numbers first. A digital photograph is broken into a grid of tiny squares called pixels. Each pixel is a single solid colour, and that colour is recorded as three numbers — how much red, how much green, how much blue, each from 0 to 255. Millions of pixels, each with its three numbers, and you have a photograph. Zoom right in and you can see the squares.

ONE PIXEL'S COLOUR red    = 168 green = 94 blue  = 62 three bytes — that exact shade
Each square is one pixel. The colour of any pixel is stored as three numbers — red, green and blue. Original schematic

Sound works on the same idea, only across time instead of space. A microphone measures how much the air is pushing on it, thousands of times a second, and writes down each measurement as a number. Those measurements are called samples. Play the numbers back through a speaker in the right order, at the right speed, and you hear the original sound. A single second of music can be more than forty thousand numbers — which is why songs are big files.

The one idea behind all of it

Letters, photographs, music, video — every kind of file is the same trick underneath. Turn the thing into numbers; store the numbers as bytes; store each byte as a row of on-or-off switches. Agree what the pattern means, and you can store anything.

Florence's Computing · Lesson 1
Measuring it

Bits, bytes, and the words for bigger piles.

Bytes pile up fast, so we need shorter words for big piles of them — the same way we say "kilometre" rather than "a thousand metres". Each step up is about a thousand times bigger than the one before. Roughly:

UnitShort forRoughly how much
bita single 0 or 1one switch
byte (B)8 bitsone letter of text
kilobyte (KB)about 1,000 bytesa short paragraph
megabyte (MB)about 1,000 KBa minute of music, or a photo
gigabyte (GB)about 1,000 MBa couple of hours of video
terabyte (TB)about 1,000 GBa whole laptop's hard drive
Each step is about a thousand times the one before. (A computer counts in twos, so the exact step is 1,024 — close enough to a thousand for everyday use.) Original schematic

This is the scale behind everything you see on a screen. When your phone says a photo is "3 MB", that's roughly three million bytes — twenty-four million on-or-off switches — every one of them set precisely to hold that one picture. When you next see a file size, you'll know what it is really counting.

Watch the small and capital letters

A capital B means bytes; a small b means bits. So "100 MB" (megabytes) is eight times more than "100 Mb" (megabits). Internet speeds are usually given in bits, which is why a "100 Mb" connection downloads a 100 MB file in about eight seconds, not one.

Try it

Eight switches, any number.

Click the bits — each one is worth double the one to its right. Watch the total change as you flip them, then take on the little challenge underneath.

Decimal total
0
The byte
00000000
No switches are on, so the total is 0.

Why 0 to 255? Each of the eight switches doubles the one before it (1, 2, 4, 8, 16, 32, 64, 128). All off gives 0; all on gives 128+64+32+16+8+4+2+1 = 255. That is 256 different patterns in total — 256 values from 0 up to 255. This is how every number, letter and colour inside a computer is really just a pattern of on and off.

Florence's Computing · Lesson 1
Watch

Binary and data, brought to life.

You've worked through bits, bytes and place values on paper. Now watch the same idea in motion. As you watch, listen for two things you already know: that every kind of data is stored as numbers, and that every number is stored as a row of on-or-off switches.

Code.org — “How Computers Work: Binary & Data”.YouTube
Florence's Computing · Lesson 1
Question 1 · circle the correct answer

Why two states?

Computers store everything using only two states, 0 and 1. What is the main reason they use two, rather than ten?
Question 2 · circle the correct answer

Bits and bytes.

How many bits are there in one byte?
Question 3 · type your answer

Binary to decimal.

Using the place values 8 4 2 1, turn the binary number 1101 into an ordinary number. Add up the columns that hold a 1.
1101 =
Work along the row: 8 (yes), 4 (yes), 2 (no), 1 (yes). Add the yeses.
Question 4 · type your answer

Decimal to binary.

Now the other way. Turn the ordinary number 19 into binary. Work from the biggest place value that fits (16) downwards, and write the row of 0s and 1s.
19 = in binary
Ask of each column, biggest first: does it fit? 16 (yes), 8 (no), 4 (no), 2 (yes), 1 (yes).
Florence's Computing · Lesson 1
Question 5 · circle the correct answer

How many values in a byte?

A byte has eight bits. How many different values can one byte hold altogether, counting all-zeros as one of them?
Question 6 · circle the correct answer

Storing a letter.

In ASCII, the letter A is stored as the number 65. What is the letter C stored as?
Question 7 · circle the correct answer

What a pixel holds.

A digital photograph is made of pixels. What is stored for each single pixel?
Question 8 · circle the correct answer

The order of the units.

Putting the units in order from smallest to largest, which row is right?
Florence's Computing · Lesson 1
Question 9 · in your own words

Explain how a single letter ends up as switches.

Imagine explaining it to someone who has never thought about it. Start with the letter on the screen and follow it all the way down to the switches. Three or four sentences is plenty. Try to use, in your own way, the words ASCII, number, byte and bit — and show the order things happen in.

0 words
reading what you wrote…

A few thoughts on your explanation, Florence

strong You kept the chain in the right order — letter, then its ASCII number, then the byte, then the row of bits. That order is the whole point, and you held onto it the whole way down. The line about the switches being "either on or off, nothing in between" is the heart of it.

try this One sentence does two jobs at once — it names the number and the byte in the same breath, which makes it move a little fast. Give the byte its own short sentence: eight bits, in one group. Slower here reads clearer.

to add You could close with the leap that makes it land: the same trick stores a whole photograph, only with millions of these patterns instead of one. That sentence turns a description into an idea.

Watch together

Films and series on the machine that runs on two.

Sit down with Dad for any of these. They show where binary, code and computers came from, and the people behind them. Heavier titles flagged for a chat first.

Documentary · BBC · 2008 · PG
The Secret Life of the Machine — Tim Hunkin
A gentle, hand-drawn series taking everyday machines apart to show how they really work. The episode on the computer builds up from switches exactly the way this lesson does.
Drama · 2014 · 12A
The Imitation Game
Alan Turing and the code-breakers at Bletchley Park in the Second World War — the people who first turned machines loose on information. Heavier in places — chat afterwards.
Documentary · BBC · 2015 · PG
Calculating Ada: The Countess of Computing
Ada Lovelace saw, in the 1840s, that a machine could do far more than sums — that it could handle any kind of information, if you coded it right. She was a century early.
Documentary · 1992 · U
The Machine That Changed the World
A five-part history of the computer, from the very first ideas to the early internet. Calm, clear, and full of the people who built it.
Drama · 2016 · PG
Hidden Figures
The mathematicians whose calculations sent NASA into space — and who lived through the arrival of the first room-sized computers. About numbers, and the people behind them.
Florence's Computing · Lesson 1
Glossary

The words from today.

Binary
A number system using only two digits, 0 and 1 — the language of a machine made of switches.
Bit
A single 0 or 1 — the smallest piece of information there is. Short for "binary digit".
Byte
A group of eight bits. One byte can hold any number from 0 to 255 — 256 values in all.
Place value
What each column in a number is worth. In binary the columns double: 1, 2, 4, 8, 16, 32, 64, 128.
ASCII
An agreed code giving every letter and symbol its own number, so text can be stored as bytes. 'A' is 65.
Pixel
One of the tiny coloured squares a digital image is made of. Its colour is stored as numbers for red, green and blue.
End of lesson one

You've seen what's underneath.

You learned why computers use binary — two states, far apart and reliable. You met the bit and the byte, counted in twos with place values, and turned numbers both ways. You saw how letters, pictures and sound all become numbers, and you learned the words from bit to gigabyte. Next time you see a file size, you'll know what every one of those switches is doing. Florence, this is computing.

F.M. · Computing · Data · Lesson 1
Images · Used Punchcard (5151286161).jpg — a punched card, an early way of storing data as a pattern of holes (present or absent — itself a kind of binary). Photograph by Pete Birkinshaw, CC BY 2.0. Source. · All diagrams in this lesson — the bit and byte boxes, the place-value rows, the ASCII worked example, the pixel grid and the units table — are original SVG line-art, drawn for this lesson. Use them freely.
Film recommendations are factual reference only — see each title's own copyright owner.