Binary to Denary Conversion
To convert a binary pattern to denary you work out what each bit is worth and add up the bits that are set to 1. Binary is a positional number system: what a bit is worth depends on where it sits, not just on the digit itself, and the base of the system tells you how much each step to the left is worth.
Binary is base 2, so every position is worth a power of 2. The rightmost position is worth 1, and each step to the left doubles the value. In an 8-bit pattern the place values from left to right are 128, 64, 32, 16, 8, 4, 2 and 1, so the leftmost bit carries the largest value and the rightmost bit carries the smallest.
Line every bit up with its place value, then add only the place values where the bit is 1. Take 10110010:
| Bit | 1 | 0 | 1 | 1 | 0 | 0 | 1 | 0 |
|---|---|---|---|---|---|---|---|---|
| Place value | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
| Count it? | yes | no | yes | yes | no | no | yes | no |
The bits set to 1 are worth 128, 32, 16 and 2: 128 + 32 + 16 + 2 = 178, so 10110010 is 178 in denary. The order you add them in does not change the answer, but each place value must stay in line with its own bit, or the total will be wrong.
If all eight bits are set to 1, every place value counts. Adding the place values from the leftmost (128) down to the rightmost (1) gives 255. So an unsigned 8-bit pattern represents denary values from 0 (00000000) up to 255 (11111111).
Edexcel GCSE Computer Science · Binary to Denary Conversion
Edexcel GCSE Computer Science · Denary to Binary Conversion
Edexcel GCSE Computer Science · Adding Binary Numbers