Article
The binary number system
Your phone can store the number 11 as 1011. How can four digits, made only of 0s and 1s, mean eleven? The idea is the same as decimal place value, with just one change.
Same idea, only two digits
In the binary number system you use only two digits, 0 and 1. These are the bits you already know. Each place is worth 2 times the place on its right, not 10 times. This is called base two.
So the place values, from the right, are 1, 2, 4, 8, 16, and so on. Each one is double the one before:
| Place | 8th | 7th | 6th | 5th | 4th | 3rd | 2nd | 1st |
|---|---|---|---|---|---|---|---|---|
| Value | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
The places continue to the left in the same way: each new place doubles the one before it.
Check your understanding
In binary, what is the place value of the ninth digit from the right?
Reading a binary number
To find the value of a binary number:
- Write the place values above the digits, starting with 1 on the right.
- Pick out the places that have a 1. Ignore the places that have a 0.
- Add the place values you picked.
Reading a binary number
Write the places
from the right: 1, 2, 4, 8...
look for 1sPick the 1s
ignore the 0s
addAdd them up
1011 gives 8 + 2 + 1 = 11
The number 1011:
| Digit | 1 | 0 | 1 | 1 |
|---|---|---|---|---|
| Place value | 8 | 4 | 2 | 1 |
| Digit × place value | 8 | 0 | 2 | 1 |
8 + 0 + 2 + 1 = 11, so 1011 in binary is 11 in decimal. Try the widget: flip bits and watch the decimal value change.
00000000 = 0 (largest with 8 bits: 255)
Check your understanding
What is the decimal value of the binary number 10110?
Counting in binary
Counting works like decimal counting, but you run out of digits after 1, not after 9. Then you reset to 0 and add 1 to the next place:
| Decimal | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
|---|---|---|---|---|---|---|---|---|
| Binary | 0 | 1 | 10 | 11 | 100 | 101 | 110 | 111 |
Notice that 10 in binary means two, not ten. When you write a binary number, it helps to say "binary" or to write it in code style, like 10.
Worked example: a whole byte
Read 10010110:
| Digit | 1 | 0 | 0 | 1 | 0 | 1 | 1 | 0 |
|---|---|---|---|---|---|---|---|---|
| Place value | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
The places with a 1 are 128, 16, 4 and 2. Add them: 128 + 16 + 4 + 2 = 150. So the byte 10010110 is the number 150.
Common mistakes
- Reading from the left. The 1s place is the rightmost digit.
- Reading binary as decimal.
1011is eleven, not one thousand and eleven. - Using 1, 2, 3, 4 as place values. The places double: 1, 2, 4, 8.
- Adding the places that have a 0. Only the places with a 1 are added.
On the exam
You will often need to turn a binary number with up to 8 digits into decimal, usually by hand. Write the place values above the digits first. It makes the task quick and reduces mistakes.
Key words
Binary number system: a way of writing numbers using only the digits 0 and 1.
Base two: each place is worth twice the place on its right.
Place value (binary): 1, 2, 4, 8, 16, … from the right.