1.5 Math for a Digital Age
1.5.5 Decimal to binary conversion

There is usually more than one way to solve a math problem, and decimal to binary conversion is no exception. One method is explored here, but feel free to use another method if it is easier.

To convert a decimal number to binary, the idea is to first find the biggest power of 2 that will "fit" into the decimal number. Consider the decimal number 35. Looking at Figure , what is the greatest power of 2 that fits into 35? Starting with the largest number, 26, or 64, is too big, so place a "0" in that column.

The next largest number, 25, or 32, is smaller than 35. Place a "1" in that column. Now, calculate how much is left over by subtracting 32 from 35. The result is 3.

Next, ask if 16 (the next lower power of 2) fits into 3. Since it does not, a "0" is placed in that column.

The value of the next number is 8 which is larger than 3, so a "0" is placed in that column too.

The next value is 4 which is still larger than 3, so it too receives a "0".

The next value is 2 which is smaller than 3. Since 2 fits into 3, place a "1" in that column. Now subtract 2 from 3, which results in 1.

The value of the last number is 1, which fits in the remaining number left. Thus, place a "1" in the last column.

The binary equivalent of the decimal number 35 is 0100011. Ignoring first 0, the binary number can be written as 100011.

This method works for any decimal number. Consider the decimal number 1 million. What is the biggest power of 2 that fits in the decimal number 1,000,000? 219 = 524288 and 220 = 1048576, so 219 is the largest power of 2 that fits into 1,000,000. Continuing with the procedure described above, determine that the decimal number 1 million is equal to the binary number 11110100001001000000.

This technique can rapidly become clumsy, when dealing with very large numbers. A simpler technique is shown later in the section, "Converting to Any Base".

Figure includes some binary to decimal conversion exercises.

Interactive Lab Activity  (Flash, 364 KB) 
  Decimal to Binary Conversion
 
Interactive Lab Activity  (Flash, 187 KB)
  Binary to Decimal Conversion