What a digit's position means
You already use a positional number system. In 372, the 3 means three hundreds because of where it sits: 3×100 + 7×10 + 2×1. Each position is worth ten times the one to its right, because we count in base 10.
Nothing about this needs ten. In base 2, or binary, the digits are only 0 and 1, and each position is worth twice the one to its right: 1, 2, 4, 8, 16, 32 and so on. Binary suits hardware because each digit is one wire.
Loading the animation…
Worked example: Binary to decimal
What is 101101₂ in decimal?
- Write the position values above the digits: 32, 16, 8, 4, 2, 1.
- Keep the values where the digit is 1: 32 + 8 + 4 + 1.
Answer:45
Loading the circuit…
- Set the input to 13. Add the values of the lit bits: 8 + 4 + 1.
- Count from 0 to 7 and watch b0. It flips every step, b1 every two steps, b2 every four.