Binary Addition

Adding one

Adding one is a common operation in binary. It is pretty simple but you must be aware of how to carry bits. It is also a good way to introduce full addition in binary.

Let look at an example:

  • 1010 + 0001
  • = 1011

That was pretty simple and this is how it will work any time the binary number ends in 0.

What if it ends with 1?

  • 1011 + 0001
  • = 1100

In binary 1+1 = 0 and a carry, so what we did was this:

Integer Overflow

What if they are all 1?

  • 1111 + 0001
  • = 0000

This is called an integer overflow. We carried the 1 all the way across and it was thrown out at the end changing everything back to 0. This is why integer overflows cause numbers to wrap back around.

Full binary addition

...