Binary and addition
Why Addition Uses Both AND and XOR
Adding one bit to another answers two questions: is one unit left in this column, and does anything carry to the next column? XOR answers the first and AND answers the second, so addition needs both.
Two questions, two gates
XOR outputs 1 when exactly one input is 1, meaning one unit is left in this column. AND outputs 1 when both inputs are 1, meaning a pair formed and goes to the next column.
| A | B | XOR → S · Sum | AND → C · Carry |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 1 | 1 | 0 |
| 1 | 0 | 1 | 0 |
| 1 | 1 | 0 | 1 |
| A | B | XOR | AND | OR |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 |
| 0 | 1 | 1 | 0 | 1 |
| 1 | 0 | 1 | 0 | 1 |
| 1 | 1 | 0 | 1 | 1 |
Why OR doesn't work
OR outputs 1 whenever at least one input is 1. It matches XOR for the first three rows, but for A=1, B=1 it outputs 1 when the column should keep 0, so OR can't give the sum bit.
You also can't simply add the AND and XOR outputs together. A 1 from AND stands for two units in the next column, while a 1 from XOR stands for one unit in this column.
How a full adder reuses them
In a full adder, the first half adder uses XOR and AND on A and B, and the second uses XOR and AND on that sum and Cin. The OR there only combines the two half adders' carries, which are never both 1.
Check yourself
For A=1, B=1, what do XOR, AND and OR output?
Answer
XOR gives 0, AND gives 1 and OR gives 1. The correct result keeps 0 in the column and carries 1, so XOR and AND are the right pair.
For A=0, B=1, what do XOR and AND output?
Answer
XOR gives 1 and AND gives 0: one unit stays in the column and nothing carries.
Why do the outputs C=1, S=0 mean 2?
Answer
C is in the next column up and counts two units; S is in this column and counts one. 2×1+0=2, written 10₂.