Physics (JEE/NEET)HardJEE Advanced · JEE Main

What is the minimum number of 2-input NAND gates needed to build a half adder (producing both the SUM = A ⊕ B and the CARRY = A·B outputs from the inputs A and B, with no other gate types)?

  1. A. 4
  2. B. 5
  3. C. 6
  4. D. 7

Correct answer: B. 5

XOR needs four NAND gates: N₁ = NAND(A,B), N₂ = NAND(A,N₁), N₃ = NAND(B,N₁), SUM = NAND(N₂,N₃). The carry A·B is the complement of N₁, obtained with one more NAND used as an inverter (NAND(N₁,N₁)). Total 5; the shared N₁ saves two gates compared with building XOR and AND separately.

More Semiconductor Electronics questions

Exams that ask this topic