Decimal to Binary Conversion

Converting a decimal number to a binary number is one of the most common procedures performed in computer operations. In the example below, the decimal number, 253, is converted into a binary number with a remainder, r, by successive division by 2. The binary number for 253 is 11111101

1 253/2 = 126 r 1

2 126/2 = 63 r 0

3 63/2 = 31 r 1

4 31/2 = 15 r 1

5 15/2 = 7 r 1

6 7/2 = 3 r 1

7 3/2 = 1 r 1

8 1/2 = 0 r 1

Base 2 Numbering System

Computers recognize and process data using the binary, or base 2, numbering system. The binary numbering system uses only two symbols (0 and 1) instead of the ten symbols in the decimal numbering system. The position, or place, of each digit represents the number 2 (the base number) raised to the power (exponent), based on its position.

Examples

2º

2¹

2²

2³

2^{4}

2^{5}

2^{6}

^{ }

The following table illustrates how a decimal number is converted to a binary number

Base 2 Numbering System | ||||||||

Value |
| |||||||

Symbols | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 2 |

Symbols | 0.1 | 0.1 | 0.1 | 0.1 | 0.1 | 0.1 | 0.1 | 0.1 |

Base Exponent | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 2 |

Place Value | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |

Convert decimal 35 to binary | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 |

**Procedure to Converting a Decimal Number to a Binary Number**

There are about five steps involved in converting the number 35 to a binary number.

1. First you need to determine the greater power of 2 that is less than or equal to 35. So, starting with the largest number, 2 to the 5 (32) is smaller than 35. Place a "1" in that column and, then, calculate how much is left over by subtracting 32 from 35. The result is 9.

2. Next, you'll want to check to see if 16 (the next lower power of 2) that fits into 3. Because it does not, an "0" is placed in that column. The value of the next number is 8, which is larger than 3, so an "0" is placed in that column too.

3. The next value that we'll work with is 4, which is still larger than 3. So, again, we'll make this a "0."

4. Okay, our next value will be 2, which is smaller than 3. And, because it is, we'll place a "1" into the column. Now, you'll need to subtract 2 from 3, and the result will be 1.

5. The value of the last number is 1, which still works with the remaining number. Therefore, we'll place a "1" in the last column. Now we see that the binary number for the decimal number 35 is 100011.