1. Gyanastra
  2. Digital Logic
  3. Adders and Subtractors
  4. Half Adder from XOR and AND Gates
Free lesson, no account needed 5 min read 10 practice questions after it
Asked in past papers3 times
  • GATE CSE20061996
  • UGC NET2005

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.
Logic circuit: Half Adder from XOR and AND Gates
Figure. Half Adder from XOR and AND Gates

How it works

  1. Feed the two input bits P and Q into an XOR gate and an AND gate.
  2. The XOR gate output F1 = P XOR Q is the Sum.
  3. The AND gate output F2 = P AND Q is the Carry.
  4. 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
  5. The outputs match binary addition in every row, so the circuit is a half adder.

Formulas

  • Sum=P⊕Q=P‾Q+PQ‾\text{Sum} = P \oplus Q = \overline{P}Q + P\overline{Q} — PP and QQ are the two input bits; the sum is their XOR.
  • Carry=P⋅Q\text{Carry} = P \cdot Q — 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:

PQP + Q (decimal)Binary result (Carry Sum)Sum (XOR)Carry (AND)
0000 000
0110 110
1010 110
1121 001

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

FeatureHalf AdderFull Adder
Number of input bits added2 (A, B)3 (A, B, C)
OutputsSum, CarrySum, Carry
UseAdd two bitsAdd 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.
Pages 1–2 of 2