Skip to main content

Digital Logic

Boolean Algebra

Memorise De Morgan, absorption, and XOR forms so simplification MCQs finish in under a minute.

~2 hrs ~0.5–1 mark · High 10 samples · 10 practice · 10 cards

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).
GateOutput 1 whenUniversal?
ANDAll inputs 1No
ORAny input 1No
NANDNot all 1Yes
NORAll 0Yes
XOROdd number of 1sNo
XNOREven number of 1sNo

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)
LawOR formAND form
IdentityA + 0 = AA · 1 = A
NullA + 1 = 1A · 0 = 0
IdempotentA + A = AA · A = A
ComplementA + ¬A = 1A · ¬A = 0
AbsorptionA + AB = AA · (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.
Exam pattern · 10 questions

GATE sample questions & answers

10 GATE-style MCQs for Boolean Algebra with full explanations. Attempt each question before revealing the answer.

Q1 XOR vs XNOR

Which is NOT equivalent to A ⊕ B?

  • A) A¬B∨¬AB
  • B) (A∨B)∧¬(A∧B)
  • C) (A∨B)(¬A∨¬B)
  • D) AB∨¬A¬B
Show answer & explanation

Answer: D

D is XNOR.

Q2 Duality

Dual of A+1=1 is:

  • A) A·0=0
  • B) A+0=A
  • C) A·1=A
  • D) A+A=A
Show answer & explanation

Answer: A

Swap +↔· and 1↔0.

Q3 Factoring

Simplify A·B + A·¬B:

  • A) 0
  • B) 1
  • C) A
  • D) B
Show answer & explanation

Answer: C

A(B+¬B)=A.

Q4 Universal gates

Which gate is universal by itself?

  • A) AND
  • B) OR
  • C) XOR
  • D) NAND
Show answer & explanation

Answer: D

NAND (and NOR) are functionally complete.

Q5 De Morgan

De Morgan of ¬(A∨B) is:

  • A) ¬A∨¬B
  • B) ¬A∧¬B
  • C) A∧B
  • D) A∨B
Show answer & explanation

Answer: B

¬(A∨B)=¬A∧¬B.

Q6 Absorption

Absorption: A ∨ (A∧B) equals:

  • A) B
  • B) A∧B
  • C) A
  • D) A∨B
Show answer & explanation

Answer: C

Standard absorption identity.

Q7 Function count

Number of Boolean functions of 2 variables is:

  • A) 4
  • B) 8
  • C) 16
  • D) 2
Show answer & explanation

Answer: C

2^(2^2)=16 truth tables.

Q8 Minterms

F=Σm(1,2) for A,B (minterms) equals:

  • A) A⊕B
  • B) A↔B
  • C) A∨B
  • D) A∧B
Show answer & explanation

Answer: A

m1=¬AB, m2=A¬B → XOR.

Q9 XNOR

A ↔ B is identical to:

  • A) A⊕B
  • B) ¬(A⊕B)
  • C) A∨B
  • D) ¬A
Show answer & explanation

Answer: B

XNOR = NOT XOR.

Q10 Consensus

Consensus term for A·B + ¬A·C can add:

  • A) B·C
  • B) A·C
  • C) A·¬C
  • D) ¬B
Show answer & explanation

Answer: A

Consensus of AB and ¬AC is BC.

Topic drill · 10 questions

10 practice questions — Boolean Algebra

Extra page-specific practice beyond the GATE samples. Attempt all 10, then reveal answers to check your reasoning.

P1

Simplify ¬(¬A ∨ B):

  • A) A∨¬B
  • B) A∧¬B
  • C) ¬A∧B
  • D) A⊕B
Show answer & explanation

Answer: B) A∧¬B

De Morgan: A ∧ ¬B.

P2

A + A·B simplifies to:

  • A) A
  • B) B
  • C) A·B
  • D) A+B
Show answer & explanation

Answer: A) A

Absorption.

P3

(A⊕B)⊕B equals:

  • A) 0
  • B) 1
  • C) A
  • D) ¬A
Show answer & explanation

Answer: C) A

XOR cancelation: X⊕X=0, so (A⊕B)⊕B=A.

P4

POS form uses:

  • A) Only ANDs of ORs
  • B) Only ORs of ANDs
  • C) Only XORs
  • D) Muxes
Show answer & explanation

Answer: A) Only ANDs of ORs

Product of sums.

P5

Truth table rows for 3 inputs:

  • A) 3
  • B) 6
  • C) 8
  • D) 9
Show answer & explanation

Answer: C) 8

2^3=8.

P6

Implement NOT using NAND:

  • A) NAND inputs tied together
  • B) Impossible
  • C) Need OR
  • D) Need XOR
Show answer & explanation

Answer: A) NAND inputs tied together

NAND(A,A)=¬A.

P7

A·1 equals:

  • A) 0
  • B) 1
  • C) A
  • D) ¬A
Show answer & explanation

Answer: C) A

Identity law.

P8

Complement of A⊕B is:

  • A) A∨B
  • B) A↔B
  • C) A∧B
  • D) A
Show answer & explanation

Answer: B) A↔B

¬(A⊕B)=A↔B.

P9

Canonical SOP for F(A,B)=A is:

  • A) Σm(2,3)
  • B) Σm(1,3)
  • C) Σm(0,1)
  • D) ΠM(0,1)
Show answer & explanation

Answer: A) Σm(2,3)

A=1 for AB=10,11 → m2,m3.

P10

Which is associative?

  • A) XOR
  • B) Implies → only
  • C) Subtraction
  • D) None
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).

Quick revision · 10 cards

10 flashcards — Boolean Algebra

Hover a card to reveal the answer with a 3D flip. On touch devices, tap the card or use Show answer.

Q1 State De Morgan’s laws.
Q2 Write A ⊕ B in SOP.
Q3 What does absorption say?
Q4 Which gates are universal?
Q5 How many Boolean functions on n vars?
Q6 What is a minterm?
Q7 Duality swaps what?
Q8 XNOR in words?
Q9 Idempotent laws?
Q10 Null laws?