Comet wants Beacon to send the morning water reading, 75, to mission control. "Easy," she says. "Just send 75."
Wren points at the relay screen. "Our relay link only sends two kinds of pulse: on and off."
"Two symbols?" Comet says. "How do you send 75 with only two symbols?"
Nova hovers over the bench and projects a row of eight little lights. Some glow and some stay dark.
"Every number Beacon stores is already made of these," she says. "Would you like a hint? Each light is worth a different amount."
Wren leans closer. "What do you notice about the amounts?"
Comet counts along the row. "They double. One, two, four, eight..."
This week asks: how can only 0s and 1s stand for numbers, letters, colors and sound?
Computing devices store data digitally. That means the smallest parts of any value are bits.
Bit is short for binary digit. A bit is either 0 or 1. A byte is 8 bits.
Binary, or base 2, uses only combinations of the digits 0 and 1.
As in our everyday base 10 numbers, a digit's position decides what it is worth.
Each position's place value is the base raised to the power of the position. Positions are numbered from 0 at the right.
So in binary, the place values from the right are 1, 2, 4, 8, 16, 32, 64 and 128. Each one doubles the one before.
| Position | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|---|---|---|---|---|---|---|---|---|
| Place value | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
To read a binary number, add the place values wherever there is a 1. The binary number 0101 has 1s in the 4 and 1 places, so it is 5.
| Statement | True or false? |
|---|---|
| A bit is either 0 or 1. | ? |
| Binary uses the digits 0 through 9. | ? |
| Binary positions are numbered starting from 0 at the right. | ? |
| Each binary place value is double the one to its right. | ? |
Good start, developer. Tomorrow you will turn readings into binary and back.