Digital Logic
Boolean Algebra
Memorise De Morgan, absorption, and XOR forms so simplification MCQs finish in under a minute.
GATE CSE Boolean algebra — gate identities, De Morgan, duality, SOP/POS, NAND/NOR implementations, XOR/XNOR tricks, with samples and drills.
Learning outcomes
- Apply Boolean identities, De Morgan, absorption, and consensus without hesitation
- Convert freely among truth tables, minterms/maxterms, SOP, and POS
- Implement AND/OR/NOT/XOR using only NAND or only NOR
- Use GATE-speed XOR/XNOR and duality tricks to eliminate wrong options
Gates & truth tables
- AND, OR, NOT, NAND, NOR, XOR, XNOR — know symbols and 2-input truth tables cold.
- NAND and NOR are functionally complete (universal). XOR alone is not.
- Bubble pushing: move bubbles across a gate using De Morgan (AND with bubbles ↔ OR, and vice versa).
- Multi-input XOR is 1 for an odd number of 1s; XNOR is 1 for an even number of 1s (including all 0).
| Gate | Output 1 when | Universal? |
|---|---|---|
| AND | All inputs 1 | No |
| OR | Any input 1 | No |
| NAND | Not all 1 | Yes |
| NOR | All 0 | Yes |
| XOR | Odd number of 1s | No |
| XNOR | Even number of 1s | No |
Worked example
Problem. For inputs A,B = 1,0 what are NAND, NOR, XOR, XNOR?
Solution. NAND=1, NOR=0, XOR=1, XNOR=0.
Core identities (must-score sheet)
- Identity: A+0=A, A·1=A. Null: A+1=1, A·0=0. Idempotent: A+A=A, A·A=A.
- Complement: A+¬A=1, A·¬A=0. Involution: ¬(¬A)=A.
- Commutative / associative for + and ·. Distributive: A(B+C)=AB+AC and A+BC=(A+B)(A+C).
- Absorption: A+(A·B)=A and A·(A+B)=A. Also A+¬A·B = A+B (cover / elimination).
- Consensus: AB + ¬A C + B C = AB + ¬A C (BC is redundant and can be added or dropped).
Formulas to remember
-
A + ¬A·B = A + B -
A · (¬A + B) = A·B -
AB + ¬AC = AB + ¬AC + BC (consensus)
| Law | OR form | AND form |
|---|---|---|
| Identity | A + 0 = A | A · 1 = A |
| Null | A + 1 = 1 | A · 0 = 0 |
| Idempotent | A + A = A | A · A = A |
| Complement | A + ¬A = 1 | A · ¬A = 0 |
| Absorption | A + AB = A | A · (A+B) = A |
Worked example
Problem. Simplify (A+B)(A+¬B)(¬A+C).
Solution. (A+B)(A+¬B)=A+(B·¬B)=A; then A(¬A+C)=AC.
De Morgan & duality
- De Morgan: ¬(A·B)=¬A+¬B ; ¬(A+B)=¬A·¬B. Extends to any number of literals.
- Bubble form: a NAND is OR of inverted inputs; a NOR is AND of inverted inputs.
- Duality: from a valid identity, swap +↔· and 0↔1. Do not complement variables when taking the dual.
- Complement of an expression ≠ dual. Complement inverts the function; dual swaps operators/constants.
- GATE trap: dual of A+1=1 is A·0=0 — missing the 0↔1 swap is a common wrong option.
Formulas to remember
-
¬(A∧B)=¬A∨¬B ; ¬(A∨B)=¬A∧¬B -
Dual: swap ∧↔∨ and 0↔1
Worked example
Problem. Find the dual of (A+B)·(A+C)=A+BC.
Solution. Swap +↔· : (A·B)+(A·C)=A·(B+C), which is the other distributive law.
SOP, POS, minterms, maxterms
- Minterm m_i: AND of every variable (complemented where the bit is 0). F=1 rows → Σm(…).
- Maxterm M_i: OR of every variable (complemented where the bit is 1). F=0 rows → ΠM(…).
- Canonical SOP = sum of minterms; canonical POS = product of maxterms.
- For n variables there are 2^n minterms and 2^n maxterms. Number of Boolean functions = 2^(2^n).
- F = Σm(S) ⇒ F′ = Σm(all indices not in S) (ignore don’t-cares carefully). Also F = ΠM(indices where F=0).
- Shorthand: listing is in binary order of variables as stated in the stem (usually AB… or ABC…).
Formulas to remember
-
2 vars: m0=¬A¬B, m1=¬AB, m2=A¬B, m3=AB -
M_i has 0s where m_i has 1s in the bit pattern (complementary literals) -
#functions on n vars = 2^(2^n)
Worked example
Problem. For A,B write Σm(1,2) and ΠM(0,3).
Solution. Σm(1,2)=¬AB + A¬B = A⊕B. Zeros at 0,3 → ΠM(0,3)=(A+B)(¬A+¬B)=A⊕B. Same function.
NAND / NOR implementations
- NOT = NAND with tied inputs (or NOR tied). AND = NAND then NOT. OR = De Morgan via NAND of inverted inputs.
- NOR dual: NOT = NOR tied; OR = NOR then NOT; AND = NOR of inverted inputs.
- Any SOP becomes a two-level NAND–NAND network; any POS becomes two-level NOR–NOR.
- GATE often asks “minimum NAND gates” — count carefully: shared NOTs and double inversion cancellation save gates.
- AOI / OAI cells are just AND-OR-Invert patterns — rewrite with De Morgan to NAND/NOR trees.
Formulas to remember
-
A·B = ¬(¬(A·B)) = NAND(NAND(A,B), NAND(A,B)) -
A+B = ¬(¬A·¬B) = NAND(¬A, ¬B)
Worked example
Problem. Implement A·B + C with NAND gates only (sketch levels).
Solution. AB = NAND(NAND(A,B),NAND(A,B)); then OR with C via NAND(¬(AB), ¬C). Cancel double bubbles where possible.
XOR / XNOR identities
- A⊕B = A¬B + ¬AB = (A+B)(¬A+¬B) = (A+B)¬(AB). XNOR = ¬(A⊕B) = AB + ¬A¬B.
- A⊕0=A, A⊕1=¬A, A⊕A=0, A⊕¬A=1. XOR is associative and commutative.
- (A⊕B)⊕B = A — used heavily in parity and “recover bit” MCQs.
- Controlled invert: XORing with 1 flips a bit; with 0 leaves it. Parity of n bits = multi-input XOR.
- Before K-map, expand ⊕ into SOP (or treat as special) — never place ⊕ as a single K-map cell.
Formulas to remember
-
A ⊕ B = A¬B ∨ ¬A B -
A ↔ B = AB ∨ ¬A¬B = ¬(A⊕B) -
A ⊕ B ⊕ C = 1 iff odd parity of {A,B,C}
Worked example
Problem. Simplify (A⊕B)⊕(A⊕C).
Solution. A⊕B⊕A⊕C = (A⊕A)⊕(B⊕C)=0⊕(B⊕C)=B⊕C.
GATE exam tricks — Boolean algebra
- Try absorption / A+¬AB=A+B before expanding everything — many options collapse in one step.
- For “which is equivalent?”, convert all options to the same form (SOP or truth-table of one row set).
- Dual ≠ complement. If options mix dual and ¬F, evaluate on A=0,B=0 or a single vector to kill fakes.
- NAND-only count: each AND→NAND+NOT, each OR→NAND of NOTs; then merge consecutive inversions.
- Σm and ΠM index sets are complementary for a completely specified function (no don’t-cares).
- XOR vs XNOR: equal inputs → XNOR=1, XOR=0. One mismatched bit flips the answer between those options.
- Consensus: if you see AB + ¬AC, the BC term may appear as a distractor that is equal, not simpler.
- Function count 2^(2^n) is a frequent 1-mark recall; for n=3 it is 256, not 8 or 16.
Formulas to remember
-
Quick test vector: plug A,B ∈ {0,1} into options -
F=Σm(S) ⇒ zeros at {0…2^n−1}\S → POS maxterms
Worked example
Problem. Is AB + ¬A C + BC simpler than AB + ¬A C?
Solution. No — BC is the consensus term; both expressions are equal. Prefer AB + ¬A C unless BC helps a later factor.
Exam tips
- Apply absorption and A+¬A·B=A+B before long expansions.
- Rewrite XOR/XNOR into SOP before K-map or minterm listing.
- Duality: swap +↔· and also 0↔1 — missing constants is the usual trap.
- NAND-only / NOR-only: build NOT first, then AND/OR via De Morgan; cancel double bubbles.
- Match Σm indices to the variable order printed in the question (AB vs BA changes numbering).
- Use one truth-table row to eliminate three wrong MCQ options fast.
- Remember: XOR is not universal; NAND and NOR are.
- For “minimum gates”, shared inverters across fan-out count once.
10 GATE-style MCQs for Boolean Algebra with full explanations. Attempt each question before revealing the answer.
Which is NOT equivalent to A ⊕ B?
Show answer & explanation
Answer: D
D is XNOR.
Dual of A+1=1 is:
Show answer & explanation
Answer: A
Swap +↔· and 1↔0.
Simplify A·B + A·¬B:
Show answer & explanation
Answer: C
A(B+¬B)=A.
Which gate is universal by itself?
Show answer & explanation
Answer: D
NAND (and NOR) are functionally complete.
De Morgan of ¬(A∨B) is:
Show answer & explanation
Answer: B
¬(A∨B)=¬A∧¬B.
Absorption: A ∨ (A∧B) equals:
Show answer & explanation
Answer: C
Standard absorption identity.
Number of Boolean functions of 2 variables is:
Show answer & explanation
Answer: C
2^(2^2)=16 truth tables.
F=Σm(1,2) for A,B (minterms) equals:
Show answer & explanation
Answer: A
m1=¬AB, m2=A¬B → XOR.
A ↔ B is identical to:
Show answer & explanation
Answer: B
XNOR = NOT XOR.
Consensus term for A·B + ¬A·C can add:
Show answer & explanation
Answer: A
Consensus of AB and ¬AC is BC.
Extra page-specific practice beyond the GATE samples. Attempt all 10, then reveal answers to check your reasoning.
Simplify ¬(¬A ∨ B):
Show answer & explanation
Answer: B) A∧¬B
De Morgan: A ∧ ¬B.
A + A·B simplifies to:
Show answer & explanation
Answer: A) A
Absorption.
(A⊕B)⊕B equals:
Show answer & explanation
Answer: C) A
XOR cancelation: X⊕X=0, so (A⊕B)⊕B=A.
POS form uses:
Show answer & explanation
Answer: A) Only ANDs of ORs
Product of sums.
Truth table rows for 3 inputs:
Show answer & explanation
Answer: C) 8
2^3=8.
Implement NOT using NAND:
Show answer & explanation
Answer: A) NAND inputs tied together
NAND(A,A)=¬A.
A·1 equals:
Show answer & explanation
Answer: C) A
Identity law.
Complement of A⊕B is:
Show answer & explanation
Answer: B) A↔B
¬(A⊕B)=A↔B.
Canonical SOP for F(A,B)=A is:
Show answer & explanation
Answer: A) Σm(2,3)
A=1 for AB=10,11 → m2,m3.
Which is associative?
Show answer & explanation
Answer: A) XOR
XOR (and XNOR in groups of bits) is associative; → is not.
Topic FAQs
Are NAND and XOR both universal?
NAND (and NOR) are universal. XOR alone is not functionally complete — you cannot build AND/OR from XOR+constants in general without NOT carefully; GATE treats XOR as not universal.
What is the difference between dual and complement?
Dual swaps operators and constants (+↔·, 0↔1) without flipping variable literals. Complement negates the whole function (¬F). They coincide only for special cases.
How do I convert SOP to NAND–NAND quickly?
Each product term becomes a NAND (with inputs possibly inverted); the outer sum becomes a NAND of those term outputs (De Morgan). Cancel pairs of inversions on the same wire.
When should I use consensus?
To prove equivalence or to enable further absorption. Adding BC to AB+¬AC does not change F; dropping a non-consensus term would.
How are minterm numbers assigned?
Write the input combination as a binary integer in the given variable order. For ABC, A is MSB: ABC=110 → m6.
Is XNOR the same as equivalence?
Yes for Boolean bits: A↔B is 1 iff A=B, which is XNOR. It is ¬(A⊕B).
Hover a card to reveal the answer with a 3D flip. On touch devices, tap the card or use Show answer.