Skip to content
Question Bank (3 marks) · Q2

Q.Construct an X-OR gate using only NAND gates and write the Boolean expression at the output of each gate.

Karnataka PUCTextbookLong· 3mImportance★★★★★est
6% · 9/160 Questions
✓ Free question

[!TLDR]

Four 2-input NAND gates realise the X-OR function Y=A⊕BY=A\oplus B.

Construction: NAND is a universal gate, so the X-OR gate is built from four NAND gates connected as follows.

  • Gate G1 — both inputs A,BA, B: G1=AB‾G1 = \overline{AB}.
  • Gate G2 — inputs AA and G1G1: G2=A⋅AB‾‾=A(A‾+B‾)‾=AB‾‾=A‾+BG2 = \overline{A\cdot \overline{AB}} = \overline{A(\overline{A}+\overline{B})} = \overline{A\overline{B}} = \overline{A}+B.
  • Gate G3 — inputs BB and G1G1: G3=B⋅AB‾‾=B(A‾+B‾)‾=A‾B‾=A+B‾G3 = \overline{B\cdot \overline{AB}} = \overline{B(\overline{A}+\overline{B})} = \overline{\overline{A}B} = A+\overline{B}.
  • Gate G4 — inputs G2G2 and G3G3: G4=G2⋅G3‾=(A‾+B)(A+B‾)‾G4 = \overline{G2\cdot G3} = \overline{(\overline{A}+B)(A+\overline{B})}.

Simplifying the final output: (A‾+B)(A+B‾)=A‾ B‾+AB(\overline{A}+B)(A+\overline{B}) = \overline{A}\,\overline{B}+AB, so G4=A‾ B‾+AB‾=A‾B+AB‾=A⊕BG4 = \overline{\overline{A}\,\overline{B}+AB} = \overline{A}B+A\overline{B} = A\oplus B.

Thus the network output equals the X-OR function.

[!ANSWER]

With four NANDs: G1=AB‾G1=\overline{AB}, G2=A⋅G1‾=A‾+BG2=\overline{A\cdot G1}=\overline{A}+B, G3=B⋅G1‾=A+B‾G3=\overline{B\cdot G1}=A+\overline{B}, and G4=G2⋅G3‾=AB‾+A‾B=A⊕BG4=\overline{G2\cdot G3}=A\overline{B}+\overline{A}B=A\oplus B.

Unlock everything free for 14 days

  • Full step-by-step solutions
  • Concept-first explanations
  • Methods, shortcuts & mistakes
  • PYQ mapping + timed mock tests

Full access for 14 days. No credit card required.