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.
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
8 fits into 13, so the 8s place gets a 1. That uses 8 units and leaves 5.
13 - 8 = 5
4 fits into 5, so the 4s place gets a 1. One unit is left.
5 - 4 = 1
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
The last unit fills the 1s place. Nothing is left, so the digits are done.
1 - 1 = 0
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
cd svg-generator python3 -m svgmath render binary-place-value --out /tmp/binary-place-value
Source: svgmath/diagrams/binary.py