1.2 Network Math  
  1.2.5 Converting decimal numbers to 8-bit binary numbers  
There are several ways to convert decimal numbers to binary numbers. The flowchart in Figure describes one method. The process is trying to figure out which values of the power of 2 that add together to get the decimal number being converted to a binary number. This method is one of several methods that can be used. It is best to select one method and practice with it until it always produces the correct answer.

Conversion exercise
Use the example below to convert the decimal number 168 to a binary number:

  • 128 fits into 168. So the left most bit in the binary number is a 1. 168 - 128 leaves 40.
  • 64 does not fit into 40. So the second bit in from the left is a 0.
  • 32 fits into 40. So the third bit in from the left is a 1. 40 - 32 leaves 8.
  • 16 does not fit into 8 so the fourth bit in from the left is a 0.
  • 8 fits into 8. So the fifth bit in from the left is a 1. 8 - 8 leaves 0. So, the remaining bits to the right are all 0.

Result: Decimal 168 = 10101000

For more practice, try converting decimal 255 to binary. The answer should be 11111111.

The number converter activity in Figure will provide more practice.

 

Lab Activity

Lab Exercise: Decimal to Binary Conversion

In this lab, the student will learn and practice to convert decimal values to binary values.

     
 

Web Links

Binary Numbers

http://www.netlingo.com/more/binary.html