Digital Logic · Adders and Subtractors
Half Adder from XOR and AND Gates
Overview
A half adder is a combinational circuit that adds exactly two bits and produces a sum and a carry. It is built from a single XOR gate for the sum and a single AND gate for the carry, making it the simplest building block of binary addition.
Key concepts
- Half adder: a combinational circuit that adds only two bits (A and B) and produces two outputs, Sum and Carry.
- Sum: the modulo-2 sum of the two bits, equal to the XOR of the inputs.
- Carry: the AND of the two bits; it is 1 only when both inputs are 1.
- Full adder: a circuit that adds three bits (A, B, C). Use a half adder to add two bits A, B; use a full adder to add three bits A, B, C.
- Why XOR gives the sum: the sum is 1 when there is an odd number of 1's (or an odd number of 0's), i.e. the remainder after modulo-2 addition is 1.
- Why AND gives the carry: a carry is produced only for 1 + 1, which is exactly the AND behaviour.

How it works
- Feed the two input bits P and Q into an XOR gate and an AND gate.
- The XOR gate output F1 = P XOR Q is the Sum.
- The AND gate output F2 = P AND Q is the Carry.
- Interpret P and Q as two binary numbers being added (P + Q):
- 0 + 0 = 0 → sum 0, carry 0
- 0 + 1 = 1 → sum 1, carry 0
- 1 + 0 = 1 → sum 1, carry 0
- 1 + 1 = 2 = binary 10 → sum bit 0, carry bit 1
- The outputs match binary addition in every row, so the circuit is a half adder.
Formulas
- — and are the two input bits; the sum is their XOR.
- — the carry is the AND of the two input bits.
Worked examples
Truth-table verification of the half adder built from one XOR gate and one AND gate:
| P | Q | P + Q (decimal) | Binary result (Carry Sum) | Sum (XOR) | Carry (AND) |
|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 0 | 0 | 0 |
| 0 | 1 | 1 | 0 1 | 1 | 0 |
| 1 | 0 | 1 | 0 1 | 1 | 0 |
| 1 | 1 | 2 | 1 0 | 0 | 1 |
For P = 1, Q = 1: 1 + 1 = 2 = binary 10, so sum = 0, carry = 1. This is the only row where the carry is 1, confirming Carry = AND.
Addition view of the same table: 01 adds to 1, 10 adds to 1, 11 adds to 2 (written 10), 00 adds to 0.
Comparison
| Feature | Half Adder | Full Adder |
|---|---|---|
| Number of input bits added | 2 (A, B) | 3 (A, B, C) |
| Outputs | Sum, Carry | Sum, Carry |
| Use | Add two bits | Add three bits |
Revision summary
- A half adder adds two bits only; a full adder adds three bits.
- Sum output = XOR of the two inputs (1 for an odd number of 1's).
- Carry output = AND of the two inputs (1 only when both inputs are 1).
- Half adder = one XOR gate (sum) + one AND gate (carry).
- 1 + 1 gives sum 0 and carry 1 (result 10 in binary); this is the only row with carry 1.
Previous-year exam insights
- A half adder cannot accept a carry-in, so it cannot be cascaded directly to add multi-bit numbers;
a full adder (two half adders plus an OR gate, or Sum = A⊕B⊕Cin, Carry = AB + Cin(A⊕B)) is needed for all but the least significant bit position.
Asked inGATE 1996 - The sum output of a half adder is the XOR of the inputs and the carry is the AND of the inputs; a half adder is therefore built from one XOR and one AND gate.
Asked inUGC NET 2005 - The majority function of three variables equals xy + yz + zx, which is the full-adder carry expression; it can be built as the OR of the three pairwise AND terms (or with XOR/AND/OR combinations), and it is 1 whenever at least two inputs are 1.
Asked inGATE 2006 - Sum-of-products form of the half adder: Sum = P'Q + PQ', Carry = PQ;
the half adder's truth table has Sum = 1 in rows 01 and 10 and Carry = 1 only in row 11. - Gate-count facts: a half adder needs one 2-input XOR and one 2-input AND gate (5 NAND gates if only NAND is available); a full adder needs two XOR, two AND and one OR gate.
- XOR is not functionally complete on its own ({XOR} cannot realise AND), whereas {NAND} and {NOR} are functionally complete; the half adder therefore needs the AND gate in addition to XOR.