Wednesday, I discussed the very basics of binary and how to count, or increment, in binary. Today I’ll be discussing converting decimal numbers to and from binary numbers.

Before I cover conversion, let’s talk for a second about bases. That’s what this series boils down to. I’m not talking about military bases, but number bases. Binary is base 2, meaning that there are 2 digits. Because decimal uses 10 digits, it is base 10.

When a number is of a certain base, you denote that by putting a subscripted 2, or 10, immediately after the number. So 100_{2} means 100 in binary, while 100_{10} means 100 in decimal. If you don’t fully grasp this, I’m sure you will once you finish the exercises for today.

So, we all know that 1_{2} is 1_{10}, but what does 10_{2} equal in base 10? It’s 2_{10}. Check out this chart:

Binary | Decimal |

1_{2} | 1_{10} |

10_{2} | 2_{10} |

100_{2} | 4_{10} |

1000_{2} | 8_{10} |

10000_{2} | 16_{10} |

100000_{2} | 32_{10} |

1000000_{2} | 64_{10} |

10000000_{2} | 128_{10} |

100000000_{2} | 256_{10} |

For every extra zero on the binary side, the decimal side doubles. This is because binary is base 2. You can say that, counting from the right in binary, each digit placement is worth double the previous.

You can use this chart to convert a binary number to a decimal number. For every 1, add the decimal equivilent. For instance, the number 111_{2} is 1_{10} + 2_{10} + 4_{10} which is 7_{10}. Another example is 1001_{2}, which is 8_{10} + 1_{10}, or 9.

OK, converting binary to decimal is the easier part for today. On to converting decimal to binary. You do pretty much the same thing as converting binary to decimal, but in reverse. The first step is to grab a scrap piece of paper, or open notepad.

To walk through the process, I’ll convert 105_{10} to binary. The first step is to find the decimal number in the chart that is closest to 105_{10} without going over, which is 64_{10}. 64_{10} is 1000000_{2}, so write that binary number on the first line. The second step is to subtract 64_{10} from 105_{10}, which is 41_{10}.

Then we repeat. So, 32_{10}, or 100000_{2}, is the next number. Write 100000_{2} on the second line, making sure to line up the numbers on the right side, same as you would for decimal. Then subtract 32_{10} from 41_{10}, which is 9_{10}.

Then we repeat. So, 8_{10}, or 1000_{2}, is the next number. Write 1000_{2} on the second line, making sure to line up the numbers on the right side, same as you would for decimal. Then subtract 8_{10} from 9_{10}, which is 1_{10}.

Then we repeat. So, 1_{10}, or 1_{2}, is the next number. Write 1_{2} on the second line, making sure to line up the numbers on the right side, same as you would for decimal. Then subtract 1_{10} from 1_{10}, which is 0_{10}.

Because, we have reached zero, we can move on the last step. On your paper/notepad should be:

1000000

100000

1000

1

All you have to do is combine these. Starting on the left, any column that has a 1 in it, write a 1, or if the column only has zeros, write a 0. This yeilds: 1101001_{2}. Converting this back to decimal will let you know you did it right.

Homework:

Convert the following binary numbers to decimal:

1001

1101

10

10000011

10101010

10110010

100011

Convert the following decimal numbers to binary:

37

123

251

6

192

168

68

Remember to convert it back to check your work. Check back Monday when I’ll discuss adding binary numbers.