Decimal-to-binary conversion represents a decimal value as binary digits. For an 8-bit number, the positions have values 128, 64, 32, 16, 8, 4, 2, and 1; each digit records whether that value is used. section 7.2.2
Convert a decimal number by subtracting from the largest bit value downward:
- Try subtracting 128. Write 1 if possible and continue with the remainder; otherwise write 0 and keep the current remainder. section 7.2.2
- Repeat for 64, 32, 16, 8, 4, 2, and 1 until every bit position is filled. section 7.2.2
- Remember that 8 bits represent values from 0 to 255, producing 256 possible values. section 7.2.2
Convert 206
Subtract 128, leaving 78; subtract 64, leaving 14; skip 32 and 16; subtract 8, 4, and 2, leaving 0; then set the final 1 bit. Therefore, 206 is 11001110 in binary. section 7.2.2
Figure 7.6 The process of converting a decimal number (206) to a binary number (11001110) by subtracting each bit’s decimal value
Use the conversion figure to follow the subtraction of each bit value. section 7.2.2
