Binary to decimal
| Decimal | Binary | Octal | Hex |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 1 | 1 | 1 | 1 |
| 8 | 1000 | 10 | 8 |
| 10 | 1010 | 12 | A |
| 15 | 1111 | 17 | F |
| 16 | 10000 | 20 | 10 |
| 64 | 1000000 | 100 | 40 |
| 100 | 1100100 | 144 | 64 |
| 255 | 11111111 | 377 | FF |
| 256 | 100000000 | 400 | 100 |
| 1024 | 10000000000 | 2000 | 400 |
| 65535 | 1111111111111111 | 177777 | FFFF |
From the right, the places are 1, 2, 4, 8, 16, 32, 64, 128. Add the ones where a bit is set: 10101010 has bits at 128, 32, 8 and 2, which totals 170. With practice a byte is readable directly, which is why the eight powers of two up to 128 are worth memorising.
Each binary place is a power of two, doubling from the right: 1, 2, 4, 8, 16 and so on. Add the values where a bit is set. 10101010 is 128 + 32 + 8 + 2 = 170.
How to convert binary to decimal
Grouping matters more than it looks. A long binary string is nearly unreadable, which is why it is conventionally written in groups of four or eight — 11111111 rather than the same eight digits run together with others. Four bits is a nibble and maps to one hex digit; eight is a byte and maps to two. The grouped output above uses nibbles for exactly that reason.
Questions
Ten. The places are 8, 0, 2, 0.