Binary numbers
Bits, bytes and place value
Goal: Read binary numbers using place values · 8 min
Computers store everything as bits: 0 or 1, off or on. Eight bits form a byte.
Our decimal system has ten digits and place values 1, 10, 100, … (powers of 10). Binary has two digits and place values powers of 2:
| 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
|---|---|---|---|---|---|---|---|
| 0 | 1 | 0 | 0 | 1 | 1 | 0 | 1 |
0100 1101₂ = 64 + 8 + 4 + 1 = 77. Just add the place values of the 1-bits.
With n bits you can store 2ⁿ different values, from 0 to 2ⁿ − 1. One byte: 0 … 255.
Worked example: Reading 10110₂
- Place values from the right: 1, 2, 4, 8, 16.
- 1-bits at 16, 4 and 2.
- 16 + 4 + 2 = 22.