The power is out again, so Nova turns on four tiny lights in a row. Some are lit and some are dark. "I am sending you a number," she says.
Rocket squints. "Lights are not numbers!" Raven looks longer. "What do you notice? Each light is either on or off. Nothing in between."
Nova flickers. "Inside a processor, everything is a switch," she says. "On or off. Would you like a hint? Give each light a value."
Deep inside a processor are billions of tiny switches. Each switch is either on or off. There is no half on.
We write on as 1 and off as 0. One switch, one 1 or 0, is called a bit.
A number system that uses only 1 and 0 is called binary. Every number, letter, picture and sound in a computer is stored as bits.
Here is how four lights can make a number. Each light has a value. From right to left, the values are 1, 2, 4 and 8.
Add up the values of the lights that are on. Ignore the lights that are off.
| Light values | 8 | 4 | 2 | 1 | Number |
|---|---|---|---|---|---|
| Nova's lights | off | on | off | on | 4 + 1 = 5 |
| Example | off | off | on | on | 2 + 1 = 3 |
| Example | on | off | on | off | 8 + 2 = 10 |
| Example | on | on | on | on | 8 + 4 + 2 + 1 = 15 |
In binary, we write on as 1 and off as 0. So Nova's lights, off on off on, are written 0101. That is the number 5.
Four bits can show every number from 0 to 15. More bits can show bigger numbers.
| Statement | True or false? |
|---|---|
| A switch inside a processor can be half on. | ? |
| Binary uses only 1 and 0. | ? |
| Binary 1000 is the number 8. | ? |
| Four bits can show the number 20. | ? |
You can read binary now, Crew Technician! Tomorrow you will put the clock, the switches and the instructions together.