Unit 1: Digital information · Binary numbers

Article

The binary number system

6 min read

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:

Place8th7th6th5th4th3rd2nd1st
Value1286432168421

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:

  1. Write the place values above the digits, starting with 1 on the right.
  2. Pick out the places that have a 1. Ignore the places that have a 0.
  3. Add the place values you picked.

Reading a binary number

  1. Write the places

    from the right: 1, 2, 4, 8...

    look for 1s
  2. Pick the 1s

    ignore the 0s

    add
  3. Add them up

    1011 gives 8 + 2 + 1 = 11

The same three steps work for any length of binary number.

The number 1011:

Digit1011
Place value8421
Digit × place value8021

8 + 0 + 2 + 1 = 11, so 1011 in binary is 11 in decimal. Try the widget: flip bits and watch the decimal value change.

128
64
32
16
8
4
2
1

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:

Decimal01234567
Binary011011100101110111

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:

Digit10010110
Place value1286432168421

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. 1011 is 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.

AP® is a trademark registered by the College Board, which is not affiliated with, and does not endorse, this site. All lessons and questions here are written by JrCodex.