Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Adding in Binary


balliztik1
 Share

Recommended Posts

Well, I recently dug around and found Admiral's post about binary numbers, so I decided to show this method I've been using for binary addition.

Let's take two numbers in binary:

110110
101101

Using the standard conversion, find what the numbers are in decimal, just to check our answer later.

110110 = 2+4+16+32 = 54
101101 = 1+4+8+32 = 45

We know that in decimal, 54+45 is 99\. So that's the answer we'll be trying to achieve to test our method. To add in binary, simply do like you would in decimal. Line up the digits and combine.

  110110
+101101
  ______
  211211

In binary, there can be no 2s. What happens here? Let's examine a decimal addition problem to figure this out.

  67
+94
  __
  (15)(11)

Your answer is not 1511, but rather 15 tens and 11 ones. The maximum digit you can have in decimal is 9, so you subtract 1 more, then add 1 to the next column. This is commonly referred to as "carrying the 1".  So, for instance, the 11 ones becomes 1 one, then 1 is added to the tens, giving 16 tens, and 1 one. The same step is done with the tens to hundreds, giving 1 hundred, 6 tens, and 1 one, or 161\. 67+94=161.

In binary, the same applies. We've got 211211\. Since binary only has 1 and 0, the 2s have to go. Instead of subtracting 10, though, we're subtracting 2, because one more than the highest digit possible (1) is 2\. So, we subtract 2 from the fours place, giving 0, and add 1 to the eights place, giving 2\. That 2 then gets subtracted and 1 is added to the sixteens, giving 2 sixteens. The same process repeats for sixteens, giving 3 thirty-twos. Subtract 2 from this and add 1 to the sixty-fours place. Your final number is 1 sixty-four, 1 thirty-two, 0 sixteens, 0 eights, 0 fours, 1 two, and 1 one. In binary, this means 1100011\. Check our answer by converting.

1100011 = 1+2+32+64 = 99

99 was the original answer in decimal, so this method works.

Here's a little sequence of change:

  110110
+101101
  ______
  211211
  212011
  220011
  300011
1100011
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...