Binary Place Value

Category: Number Theory   Level: 101

13 = 8 + 4 + 0 + 1 = 11012

In base 2 each place is worth twice the place to its right: 1, 2, 4, 8, and so on. Fill places from the left with the biggest power that fits.

Step through it

Watch it

Animated walkthrough

Step by step

Step 1: Places are powers of two

In base 10 the places are 1, 10, 100. In base 2 they are 1, 2, 4, 8, each one double the last. Each place holds a digit 0 or 1, never more.

places: 23, 22, 21, 20 = 8, 4, 2, 1

Step 1: Places are powers of two

Step 2: Does 8 fit? Yes

8 fits into 13, so the 8s place gets a 1. That uses 8 units and leaves 5.

13 - 8 = 5

Step 2: Does 8 fit? Yes

Step 3: Does 4 fit? Yes

4 fits into 5, so the 4s place gets a 1. One unit is left.

5 - 4 = 1

Step 3: Does 4 fit? Yes

Step 4: Does 2 fit? No

2 is bigger than the 1 unit left, so the 2s place gets a 0. A zero is a placeholder, not nothing.

2 > 1 ⇒ digit 0

Step 4: Does 2 fit? No

Step 5: Does 1 fit? Yes

The last unit fills the 1s place. Nothing is left, so the digits are done.

1 - 1 = 0

Step 5: Does 1 fit? Yes

Step 6: Read the digits left to right

The digits spell 1101. Add up the places that hold a 1 to check: 8 + 4 + 1 = 13. There are 10 kinds of people: those who read binary and those who do not.

11012 = 1 · 8 + 1 · 4 + 0 · 2 + 1 · 1 = 13

Step 6: Read the digits left to right

All steps at once

Storyboard

Generate it yourself

cd svg-generator
python3 -m svgmath render binary-place-value --out /tmp/binary-place-value

Source: svgmath/diagrams/binary.py