How do computers add?

To understand how binary addition works, it is useful to first think about how addition works in general and it is probably easiest to consider how we do this in our own, familiar, decimal base-ten.

Lets start with something very easy 0 + 1

A single column addition, shown in the classical way with a digit above another digit and a horizontal line for the sum to go below.
In this case the topmost digit is zero, the lower digit is one and the sum of 1+0=1.
0+1=1

Now, still very easy. 1+1

Another column sum with single digits being added. In this case the two digits being added are one and one and the sum is two.
1+1=2

And still easy is 1 + 1 +1

A column of three ones being added together and the sum below the horizontal line is three.
1+1+1=3

These are all very easy because they are single digit sums. We’ll come back to this simple idea again soon but in binary form.

Now lets think about what happens when we add two numbers together and the answer is more than one digit.

Lets add together 9 and 1.

A column sum showing two digits being added, 9 and 1. There is no answer being shown yet below the horizontal line.
9+1

9 + 1 is 10. This answer contains more than one digit!

How do we write this? We put a 0 in the ones column and then we carry the one to the next column.

A continuation of the above sum of 9 + 1.
A zero has been added in the sum position directly below the column of nine and one and a (carry) one has been shown to the left of the first column (in the tens position).
9+1 = 0 carry 1

So now we have to add up all the values in the next column, well there is only a 1 in that column so now we write down the 1 as well.

The last part of the addition of nine plus one, showing the carry 1 has been 'dropped down' next to the zero, creating the value "ten".
9+1=10

9 + 1 is 10.

It is important to remember that when we have more than one digit when we add up the numbers in one column then we carry the most significant (biggest bit) of the number to the next column and include it in the next addition.

Binary is just like decimal addition except there are only two digits.

The highest single digit value you can get to in binary is one!

There are four very important rules you need to remember when adding in binary. These rules are not particularly special rules. Really they are just some ordinary addition facts but we are expressing their answers in binary form:

  • 0 + 0 = 0
  • 0 + 1 = 1
  • 1 + 1 = 2 (but, remember two in binary is 10)
  • 1 + 1 + 1 = 3 ( three in binary is 11)

Let’s do a binary addition, lets add five (101)and three (011) in binary. As we do this, remember that when the sum of the digits in a column added together is more than one digit, we carry the most significant digit over to the next column.

A column addition showing binary values 101 and 11.
The rightmost column shows a one over a one.
The middle column shows a zero over a one.
The leftmost column shows a one and an empty space below.

We will start with the rightmost (smallest) column, just like decimal addition.

1+1 = two.

Two in binary is 10

So we write down the smallest value (0) and carry the 1 to the next column.

The above sum but a zero has been put in the sum position below the leftmost column and a carry 1 has been placed above the zero in the middle column.

Now we add up the values in the next column. We have the 1 we carried over from the previous column and the 1 that was already in the bottom row. So we have another 1 (+0) + 1.

Just like before we know that 1 + 1 is 0 carry 1

Continuation of the above sum, a second zero has now been added below the middle (carry 1 + 0 + 1) column and a further carry 1 has now been added above the leftmost column.

Now we add up the values in the third column. There is the 1 we carried over and there is the 1 that was already there.

1 + 1 is 0 carry 1

The continuation of the above sum, a third zero has now been placed under what was previously the leftmost column (carry 1 + 1) and a final carry 1 has been placed in the empty spacer next to what was the leftmost column.

There is now a fourth column. This column only contains 1, so we write that down below.

The finalisation of the above sum. The carry 1 that was on it's own in the new leftmost position has "dropped down" into the sum position so the answer reads 1000

So, 101 + 11 = 1000

If we convert these three numbers to decimal then we get:

5 + 3 = 8!

So we can see that this method works. You can add together two binary number with any number of bits as long as you follow these basic rules.

The Rules of Binary Addition

  • 0 + 0 = 0
  • 0 + 1 = 1
  • 1 + 1 = 0 carry 1
  • 1 + 1 + 1 = 1 carry 1

By admin