It is obvious that
, afterall, zero is zero.
We also know that
and
, any value added to
zero gets the original value. However,
. This is because
is the binary representation of two. Of course, you can also
read this as ``zero with a carry of one''.
Just like you use carries in decimal addition, you use carries in binary addition as well. It helps to make the carry from the previous (less significant) digit explicit and represent the partial sum explicitly. The following is an example of the addition of two binary numbers:
| num1 | 1 | 0 | 0 | 1 | |
| num2 | + | 0 | 0 | 1 | 1 |
| partial sum | 1 | 0 | 1 | 0 | |
| carry from previous digit | + | 0 | 1 | 1 | 0 |
| answer | 1 | 1 | 0 | 0 |