- Asked 2/22
- 2073 Shrawan · 5 marks
- 2072 Chaitra · 4 marks
XOR gate using minimum NAND gates
Short answer
XOR is built with four 2-input NAND gates: G1 = NAND(A,B), G2 = NAND(A,G1), G3 = NAND(B,G1), and output Y = NAND(G2,G3). This yields A ⊕ B.
Construct two input XOR gate using minimum number of 2-input NAND gates only.
An XOR gate gives . With NAND gates only, the minimum is four 2-input NAND gates.
Derivation
So the gates are:
Circuit
A --+-----------------|‾‾\
| |G2 |o--+
| |‾‾\ +----|__/ | |‾‾\
+--|G1 |o----+ +---|G4 |o-- Y
+--|__/ +----|‾‾\ +---|__/
| |G3 |o--+
B --+-----------------|__/
Verification
| A | B | Y | |||
|---|---|---|---|---|---|
| 0 | 0 | 1 | 1 | 1 | 0 |
| 0 | 1 | 1 | 1 | 0 | 1 |
| 1 | 0 | 1 | 0 | 1 | 1 |
| 1 | 1 | 0 | 1 | 1 | 0 |
Output Y is 1 only when the inputs differ, which is the XOR function. Total: 4 NAND gates.
✓ Answer checked by Claude Opus 5.5 (high effort)
Related questions
- 3-input XOR using NAND gates only · Digital Logic, chapter 2 · asked 2×
- 2-input XOR using NOR gates only · Digital Logic, chapter 2 · asked 2×
- De Morgan's laws; XOR using 3-input NAND · Digital Logic, chapter 2
- De Morgan's laws; XOR from NAND gates · Digital Logic, chapter 2
- Prove De Morgan's theorems; XOR using NAND · Digital Logic, chapter 2 · asked 3×
- De Morgan; NOR gate from NAND gates · Digital Logic, chapter 2
- X-OR gate using NAND gates only · Basic Electronics Engineering, chapter 6
- Encoder; NAND and XOR truth tables · Basic Electronics Engineering, chapter 6
- Perceptron; neural network as XOR gate · Artificial Intelligence, chapter 6 · asked 2×
- Why NOR and NAND are universal gates · Basic Electronics Engineering, chapter 6