Index

Free, with Google

Keep going, free.

A free account opens lessons 2 and 3 of every track, 33 more lessons, and keeps your progress and review cards on every device.

Start free with Google

A chalk plan

Open everything on chalk.

Every lesson, board, video, lab and paper, and the full review decks. Yearly is $39/year.

See plansStart free instead

How Computers Work the lesson

Everything Is a Number a show in 8 chapters

Goal: read one row of 8 switches as a number, a letter and a colour

1 of 8 Your guess

Before we start

Your laptop holds photos, messages and songs. Yet it is built from switches, wired by the million, and each one is only ever on or off.

Which picture is closest to what is really inside?

Pick the closest. You find out which fits at the end.

offdarkTtailsNever half on: one of two, every time.

2 of 8 Try it

1947: one switch, then more

Engineers at Bell Labs kept writing out "binary digit": one answer that is only ever yes or no, on or off, nothing between.

A light switch is one. A coin, once it lands, is one. Flip it.

Off. Flip it and watch the lamp.

Step 1 of 2

65tens columnones column6 × 10 = 605 × 1 = 5

3 of 8 The idea

Place values

Patterns are not numbers yet. To count with switches, borrow the trick you already use for 65.

In 65 the 6 sits in the tens column, so it is worth 6 tens. The 5 sits in the ones column. Each column is worth ten times the one to its right, because decimal has ten symbols, 0 to 9.

Step 1 of 4

8 switches, read as one= 0all off: the smallest= 255all on: 128 + 64 + 32 + 16 + 8 + 4 + 2 + 102550 counts too: 255 + 1 = 256 values

4 of 8 The idea

1956: eight at once

In June 1956, at IBM, Werner Buchholz was designing the Stretch computer. He needed a name for the group of switches it would handle as one unit, enough to hold one letter of text.

He called it a byte, misspelling "bite" on purpose so a typo could never turn it into "bit".

Step 1 of 2

4 switches: 2 × 2 × 2 × 2 = 16 patterns0123456789A= 10B= 11C= 12D= 13E= 14F= 15

5 of 8 The fix

Reading eight switches without going blind

Eight zeros and ones for every byte gets unreadable fast. So engineers took four switches at a time.

Four switches make 16 patterns. Each gets one symbol: 0 to 9, then A to F for the six values one decimal digit can't hold.

Sixteen symbols a column: that is hex, short for hexadecimal, base sixteen.

Step 1 of 3

the same 8 switches, never movedread as anumberread as anASCII letterread as onepaint channel65Aplace valuescode 65 in ASCII65 of 255 bright

64 + 1 = 65

6 of 8 The cost

Same switches, new rule

Take 01000001 and hand it to three programs. One reads it as a whole number: 65. One reads it with the alphabet code called ASCII: the letter A. One reads it as one channel of a paint mix: a grey.

Flip a switch under the picture and all three answers change together.

Why is 65 the letter A?

ASCII is a table people agreed on, one number per letter. It puts A at 65 and B at 66. The switches only say 65. The table says A.

Nothing inside the byte says "I am a number" or "I am a letter". The rule brought to it decides. That rule is the byte's type.

Step 1 of 3

7 of 8 Your guess

Your picture now

Goal met: 01000001 is 64 + 1 = 65 as a number, 0x41 in hex, A as a letter, and a grey as paint. Which picture is closest now?

Pick one.

Everything is a numberRows of on/off switches. The rule brought to them decides what they mean.123One switch is one bit.Each extra switch doubles.2562 × 2 × 2 × 2 × 2 × 2 × 2 × 2patterns in 8 switches, one byte1286432168421Add the lit place values.6564 + 1 = 65, in hex 0x41:4 × 16 + 1The same byte, read three ways:65AnumberlettergreyNothing inside says which.The rule, called its type,is brought by the reader.chalkbrain.com
Everything is a numberOn/off switches. The rule broughtto them decides what they mean.1One switch is one bit. Eachextra switch doubles.256patterns in 8 switches, one byte2Add the lit place values.6564 + 1 = 65, in hex 0x413The same byte: a number, aletter or a grey. The rule decides.65ANothing inside says which.chalkbrain.com

8 of 8 Keep this

Keep this

A computer is switches. Each is one bit, and each extra switch doubles the patterns: eight of them, one byte, make 256.

The same byte is a number, a letter or a colour. The switches never move. The rule brought to them, its type, decides.

Read the full lesson