next up previous contents
Next: Multiplication Up: Binary Numbers Previous: Converting from Decimal to   Contents


Addition

Addition in binary is about the same as addition in decimal. Let us review. In decimal, $4+9=11$, this can also be read as ``3 with a carry of 1''. In binary, we only have two possible numbers per digit, 0 and 1.

It is obvious that $0_2+0_2=0_2$, afterall, zero is zero. We also know that $0_2+1_2=1_2$ and $1_2+0_2=1_2$, any value added to zero gets the original value. However, $1_2+1_2=10_2$. This is because $10_2$ 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


next up previous contents
Next: Multiplication Up: Binary Numbers Previous: Converting from Decimal to   Contents
Tak Auyeung 2003-12-03