Skip to main content

Universal gates; Ex-OR using NAND

Short answer

NAND and NOR are universal because they can realize NOT, AND, OR. An XOR gate using only NANDs: G1 = (AB)', G2 = (A G1)', G3 = (B G1)', Y = (G2 G3)'. Four NAND gates are needed.

List out the name of universal gates and why they are called universal gate? Realise Ex-OR Gate using only NAND gates.

Universal gates

The universal gates are NAND and NOR. They are called universal because any Boolean function, and every other gate (NOT, AND, OR, XOR, XNOR), can be built using only NAND gates or only NOR gates. For example, with NAND only: NOT A = AA‾\overline{A A}, AND = NAND followed by NOT, OR = AˉBˉ‾\overline{\bar A \bar B}. This lets a whole circuit be made from one type of IC (e.g. 7400), which simplifies manufacture and reduces cost.

XOR using only NAND gates

Y=A⊕B=ABˉ+AˉBY = A \oplus B = A\bar B + \bar A B needs four 2-input NAND gates.

Y=ABˉ+AˉB=A(Aˉ+Bˉ)+B(Aˉ+Bˉ)(since AAˉ=BBˉ=0)=A AB‾+B AB‾=A AB‾‾⋅B AB‾‾‾(De Morgan)\begin{aligned} Y &= A\bar B + \bar A B \\ &= A(\bar A + \bar B) + B(\bar A + \bar B) \quad (\text{since } A\bar A = B\bar B = 0) \\ &= A\,\overline{AB} + B\,\overline{AB} \\ &= \overline{\overline{A\,\overline{AB}} \cdot \overline{B\,\overline{AB}}} \quad (\text{De Morgan}) \end{aligned}

Gates: G1=AB‾G_1 = \overline{AB}, G2=AG1‾G_2 = \overline{A G_1}, G3=BG1‾G_3 = \overline{B G_1}, Y=G2G3‾Y = \overline{G_2 G_3}.

 A --+---------------[NAND G2]--+
     |                 |        |
     +--[NAND G1]--G1--+        +--[NAND G4]-- Y
     |                 |        |
 B --+---------------[NAND G3]--+
ABG1G_1G2G_2G3G_3Y
001110
011101
101011
110110

✓ Answer checked by Claude Opus 5.5 (high effort)

All Digital Logic chapter 2 questions →