A switch that is a number: what a bit is, how many patterns two bits make, place value in base 2, and why 10 in base 2 is two.
Step 1 of 5 · One bit
Step 1 of 5
One bit
A computer is built from billions of tiny switches, transistors, and each can be in only one of two states: conducting or not, high voltage or low. The two states are called and . A digit like that, with only two values, is a bit, short for binary digit.
The board has two switches, A and B, and each is a bit. The gates and lights after them are the next Unit’s subject; for now, look only at the switches. One bit tells only two things apart: yes and no, on and off. How many things can two bits tell apart?
Step 2 of 5
Place value
For two switches to hold a number, each place is given a value. In a decimal number like the 3 is worth thirty, because it is in the tens place. In base 2 each place is worth twice the place to its right: the rightmost is worth , the next , then , and so on.
On the board A is the 2s place and B the 1s place, so the switches are worth
Number in the controls is that value in base ten, and the switches show it in base 2. Predict, and then Number will move to .
Step 3 of 5
One one
To keep the bases apart, the base is written as a subscript: is “one zero in base 2”, that is two, and a plain is ten. Now go the other way: move Number until the switches show , and read what it is in base ten.
Step 4 of 5
More bits
Two bits only reach . To hold bigger numbers you add bits on the left, each worth twice the one before. Four bits are the places
To read a binary number, write the place values over the bits and add the ones with a 1 under them. A 0 bit adds nothing, but it holds the place, just like the 0 in .
Step 5 of 5
The largest number
Each extra bit doubles the number of patterns, because every pattern of the earlier bits comes once with a 0 and once with a 1. So bits give
patterns, and they are the numbers to . Eight bits are a byte: values. You will meet that number a lot.
Loading the interactive version…
Loading the interactive version…
Each step sets up the Scene for you, and a control marked “fixed” stays put for that step.
Practice · Calculate
The board has two switches, A and B, and each can be set to 0 or 1. How many different patterns can the two switches make?
Practice · Calculate
The board has two switches, A and B, and each can be set to 0 or 1. How many different patterns can the two switches make?
Practice · Predict, then look
Number is at 0, and both switches are down. A is the 2s place and B the 1s place. How will the switches stand when the number is ?
Practice · Predict, then look
Number is at 0, and both switches are down. A is the 2s place and B the 1s place. How will the switches stand when the number is ?
Practice · Reach the target
Move Number until both switches are up, the bits 11, and press Check. Which number is it?
Practice · Reach the target
Move Number until both switches are up, the bits 11, and press Check. Which number is it?
Practice · Calculate
Add two more switches on the left, in the 4s and 8s places. The four switches show 1011. Which decimal number is that?
Practice · Calculate
Add two more switches on the left, in the 4s and 8s places. The four switches show 1011. Which decimal number is that?
Practice · Calculate
What is the largest number four bits can hold?
Practice · Calculate
What is the largest number four bits can hold?
Lesson complete. Every practice question here is done.