Binary Addition


The principal number system of the computer is the binary number system. Therefore the information that is stored in the computer's memory is represented by 0s and 1s. When our programs evaluate an equation such as, 3 + 5, it will return the answer 8 as we expect. But we know the computer itself is not adding the decimal number 3 to the decimal number 5. The decimal numbers are converted to binary numbers and the computer will perform binary addition to obtain an answer which is then converted back to decimal. At this point knowledge of binary/decimal conversion is assumed.

Here we compute the sum for the four basic equations in binary addition:

0011
+0+1+0+1
0 1 1 10

Similar to decimal addition, in binary addition you must tolerate 'carries'. You can see from above that a carry will be produced from 1 + 1.

After performing binary addition we are left with two values; a sum and a carry. By studying the four basic equations we know that when the operands are different the sum bit is 1 and when the operands are the same the sum bit is 0. We can better express this using a logical statement where a and b represent the operands in an equation:

The truth table for this logical expression is below. What gate corresponds with this truth table? .

ab
000
011
101
110

We can produce a truth table for the carry bit as well. What gate corresponds to this truth table?

abCarry Bit
000
010
100
111