liveBook · Manning

Decimal-to-binary conversion

As explained in Acing the CCNA Exam: Volume 1 Fundamentals and Protocols

Decimal-to-binary conversion is the process of representing a decimal value as a sequence of binary digits using positional subtraction or addition.

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

How Acing the CCNA Exam: Volume 1 Fundamentals and Protocols covers it

How deep it goes
Explains an 8-bit subtraction procedure with a worked example and notes addition as an alternative.
Examples
Uses 206, 11001110, and 8-bit values ranging from 0 to 255.
What it assumes
Assumes familiarity with decimal numbers and teaches binary bit positions from their values.
What you can do after
Apply positional subtraction to convert decimal values into 8-bit binary numbers.
How it connects
Connects binary representation with IPv4 addressing and decimal numbers.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Acing the CCNA Exam: Volume 1 Fundamentals and Protocols. The section links point to the parts of the book it draws on.