1010 = 1 × 23 + 0 × 22 + 1 × 21 + 0 × 20 = 8 + 0 + 2 + 0 = 10
It
is convenient to remember the above fact.
If you know it, then it takes just a moment to
recognize
Power of 2 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
---|---|---|---|---|---|---|---|---|---|---|---|
Decimal | 1024 | 512 | 256 | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
Include? | 1 | 0 | 1 | 0 | 1 | 0 | 1 | 0 |
Now think of the bits of the binary representation as turning on or off
the numbers to include in the sum.
For example, with
A particular number is represented by 1010 1010 (binary representation). What is the number represented in base ten?