Boolean Algebra and Logic Gates: GATE ECE practice questions with solutions

This topic covers Boolean identities, De Morgan, duals and self-dual functions, XOR algebra, NAND and NOR networks and functional completeness. The 15 original questions follow the GATE EC format: 9 MCQ, 2 MSQ and 4 NAT, from 5 easy, 7 medium and 3 hard.

Three ideas to know:

  • X + X′Y = X + Y: a complemented literal next to its own variable can simply be dropped.
  • To complement, swap AND with OR and complement every literal.
  • The same four-gate structure gives XOR when built from NAND and XNOR when built from NOR, because the two are duals.

It helps GATE EC and ECE students revising Digital Circuits for the exam or a semester test. Helpful background: De Morgan's theorems and Universal gates. Start with the 5 easy questions, then work up to the 3 hard ones.

Q.1

EasyMCQ1 mark

The Boolean expression F = A + A′B simplifies to

  1. Option A: A + B
  2. Option B: A
  3. Option C: B
  4. Option D: A′B
Show answer and solutionHide answer and solution

Answer: (A)

Key idea: X + X′Y = X + Y: a complemented literal next to its own variable can simply be dropped.

1. Write A = A(1 + B) = A + AB.

2. Then F = A + AB + A′B = A + B(A + A′) = A + B.

3. Check A = 0, B = 1: the original gives 0 + 1 = 1 and A + B = 1.

Common mistake: Applying absorption (X + XY = X) to A + A′B as if the second term contained A gives F = A, option (B), which is wrong at A = 0, B = 1.

You need: Boolean postulates, absorption

Q.2

EasyMCQ1 mark

A 2-input AND gate has an inverter (a bubble) on each of its two inputs and none on its output. The combination behaves exactly like a single

  1. Option A: 2-input NAND gate
  2. Option B: 2-input NOR gate
  3. Option C: 2-input OR gate
  4. Option D: 2-input XNOR gate
Show answer and solutionHide answer and solution

Answer: (B)

Key idea: De Morgan: an AND with inverted inputs is a NOR; an OR with inverted inputs is a NAND.

1. The output is A′·B′.

2. By De Morgan, A′·B′ = (A + B)′.

3. (A + B)′ is the NOR function.

Common mistake: Assuming that inverting the inputs simply inverts the gate gives NAND, option (A); but NAND is (AB)′ = A′ + B′, not A′B′.

You need: De Morgan's theorems, basic gates

Q.3

EasyMCQ1 mark

What is the minimum number of 2-input NAND gates needed to build a 2-input XOR gate, if only A and B (not their complements) are available?

  1. Option A: 3
  2. Option B: 5
  3. Option C: 4
  4. Option D: 6
Show answer and solutionHide answer and solution

Answer: (C)

Key idea: Sharing the gate (AB)′ between both branches saves the two input inverters.

1. G1 = (AB)′.

2. G2 = (A·G1)′ and G3 = (B·G1)′.

3. F = (G2·G3)′ = A·G1 + B·G1 = (A + B)(AB)′ = A ⊕ B.

4. Four gates; three cannot work because a 3-NAND network with these inputs cannot produce the XOR truth table.

Common mistake: Converting A′B + AB′ gate by gate (two NAND inverters, two NANDs for the products and one NAND for the sum) gives 5, option (B).

You need: Universal gates, XOR

Q.4

EasyNAT1 mark

For F(A, B, C) = AB + BC′ + A′C, the number of the 8 input combinations for which F = 1 is ______.

Numerical answer: type a number.

Show answer and solutionHide answer and solution

Answer: 5

Key idea: Count the union of the product terms' minterms, not the sum of their sizes.

1. AB is 1 for ABC = 110 and 111.

2. BC′ is 1 for 010 and 110.

3. A′C is 1 for 001 and 011.

4. The union is {001, 010, 011, 110, 111}: 110 appears twice, so the count is 6 − 1 = 5.

Common mistake: Adding the term sizes 2 + 2 + 2 = 6 counts minterm 110 (covered by both AB and BC′) twice.

You need: Minterms, sum of products

Q.5

EasyMSQ1 mark

Which of the following gate sets are functionally complete (can build any Boolean function, with the constants 0 and 1 not available)?

One or more options are correct.

  1. Option A: {NAND}
  2. Option B: {AND, OR}
  3. Option C: {NOR}
  4. Option D: {OR, NOT}
Show answer and solutionHide answer and solution

Answer: (A), (C) and (D)

Key idea: A set is complete if it can produce NOT plus either AND or OR.

1. NAND alone makes NOT (tie both inputs) and then AND and OR, so (A) is complete.

2. NOR alone works the same way, so (C) is complete.

3. OR with NOT gives AND by De Morgan, AB = (A′ + B′)′, so (D) is complete.

4. AND and OR only ever produce functions that never fall when an input rises, so NOT A cannot be built and (B) is not complete.

Common mistake: Choosing (B) because AND and OR appear in every sum of products, forgetting that the sum of products also needs complemented literals.

You need: Universal gates, De Morgan's theorems

Q.6

MediumMCQ2 marks

The complement of F = AB + C′D is

  1. Option A: (A′ + B′)(C + D′)
  2. Option B: A′B′ + CD′
  3. Option C: (A′ + B′) + (C + D′)
  4. Option D: A′B′(C + D′)
Show answer and solutionHide answer and solution

Answer: (A)

Key idea: To complement, swap AND with OR and complement every literal.

1. F′ = (AB + C′D)′ = (AB)′ · (C′D)′ by De Morgan.

2. (AB)′ = A′ + B′ and (C′D)′ = C + D′.

3. F′ = (A′ + B′)(C + D′).

Common mistake: Complementing every literal but keeping the operators gives A′B′ + CD′, option (B); at A = 1, B = 0, C = 1, D = 1 that gives 0 while F′ = 1.

You need: De Morgan's theorems

Q.7

MediumMCQ2 marks

For the three-gate NAND-NAND circuit described in the figure, the output F equals

NAND-NAND circuitThree 2-input NAND gates. Gate G1 has inputs A and B. Gate G2 has inputs C and D. Gate G3 has inputs from the outputs of G1 and G2, and its output is F. No other gates or inverters.ABCDG1G2G3F
  1. Option A: (A + B)(C + D)
  2. Option B: AB + CD
  3. Option C: (AB)′(CD)′
  4. Option D: A′B′ + C′D′
Show answer and solutionHide answer and solution

Answer: (B)

Key idea: A two-level NAND-NAND network is the same as AND-OR: the output NAND acts as an OR of the inverted inputs.

1. G1 = (AB)′ and G2 = (CD)′.

2. F = (G1·G2)′ = G1′ + G2′ by De Morgan.

3. G1′ = AB and G2′ = CD, so F = AB + CD.

Common mistake: Reading the output gate as an AND of the two NAND outputs gives (AB)′(CD)′, option (C), which forgets the output inversion.

You need: NAND-NAND realization, De Morgan's theorems

Q.8

MediumMCQ1 mark

The dual of the Boolean expression F = A + B′C is

  1. Option A: A′(B + C′)
  2. Option B: A + B′C
  3. Option C: A(B′ + C)
  4. Option D: A′B + C′
Show answer and solutionHide answer and solution

Answer: (C)

Key idea: The dual swaps operators only; the complement swaps operators and complements the literals.

1. To form the dual, swap + with · (and 0 with 1), leaving every literal as it is.

2. A + B′C becomes A · (B′ + C).

Common mistake: Also complementing the literals gives A′(B + C′), option (A), which is the complement F′, not the dual.

You need: Duality principle

Q.9

MediumNAT2 marks

A Boolean function is self-dual if its dual equals the function itself. The number of distinct self-dual Boolean functions of 3 variables is ______.

Numerical answer: type a number.

Show answer and solutionHide answer and solution

Answer: 16

Key idea: Self-duality pairs each input with its complement, so only half the truth table is free: 2^(2^(n−1)).

1. F is self-dual exactly when F(A′, B′, C′) = F′(A, B, C), so each input row and its bitwise complement must get opposite outputs.

2. The 8 rows of a 3-variable truth table form 4 such pairs (000 with 111, 001 with 110, 010 with 101, 011 with 100).

3. Choosing the output of one row in each pair fixes the other, so there are 2⁴ = 16 functions.

Common mistake: Halving the total number of functions, 2⁸ ÷ 2 = 128, instead of halving the number of free rows.

You need: Duality principle, truth tables

Q.10

MediumMCQ2 marks

The function F(A, B, C) = Σm(1, 2, 4, 7) is equal to

  1. Option A: (A ⊕ B)′ ⊕ C
  2. Option B: (A ⊕ B) + C
  3. Option C: AB + BC + CA
  4. Option D: A ⊕ B ⊕ C
Show answer and solutionHide answer and solution

Answer: (D)

Key idea: A three-input XOR is the odd-parity function.

1. Write the minterms in binary: 001, 010, 100, 111.

2. Each has an odd number of 1s (one, one, one, three).

3. The function that is 1 for an odd number of 1s is A ⊕ B ⊕ C.

Common mistake: Using the zeros of F, Σm(0, 3, 5, 6), instead of its ones gives the even-parity function (A ⊕ B)′ ⊕ C, option (A).

You need: Minterms, XOR

Q.11

MediumMSQ2 marks

Which of the following identities are true for all Boolean values of A and B?

One or more options are correct.

  1. Option A: A ⊕ B = A′B + AB′
  2. Option B: A ⊕ 1 = A′
  3. Option C: A ⊕ A = 1
  4. Option D: (A ⊕ B) ⊕ B = A
Show answer and solutionHide answer and solution

Answer: (A), (B) and (D)

Key idea: XOR with 1 inverts, XOR with 0 passes, and XOR with the same value twice cancels.

1. (A) is the definition of XOR.

2. With B = 1, A′·1 + A·0 = A′, so (B) holds.

3. A ⊕ A = A′A + AA′ = 0, so (C) is false.

4. XOR is associative and B ⊕ B = 0, so (A ⊕ B) ⊕ B = A ⊕ 0 = A and (D) holds.

Common mistake: Treating XOR like XNOR and writing A ⊕ A = 1, which selects (C).

You need: XOR properties

Q.12

MediumNAT1 mark

For F(A, B, C) = (A + B + C′)(A′ + B)(B + C), the number of input combinations for which F = 1 is ______.

Numerical answer: type a number.

Show answer and solutionHide answer and solution

Answer: 4

Key idea: A product of sums is 0 on the union of its sum terms' zeros.

1. Each sum term is 0 on its maxterms: (A + B + C′) at 001; (A′ + B) at 100 and 101; (B + C) at 000 and 100.

2. The zeros of F are the union {000, 001, 100, 101}, four rows (100 appears twice).

3. So F = 1 on the other 4 rows, 010, 011, 110 and 111; in fact F = B.

Common mistake: Adding the zeros 1 + 2 + 2 = 5 counts row 100 twice and leads to 8 − 5 = 3.

You need: Maxterms, product of sums

Q.13

HardMCQ2 marks

For the four-gate NOR circuit described in the figure, the output F equals

Four-NOR circuitFour 2-input NOR gates. G1 has inputs A and B. G2 has inputs A and the output of G1. G3 has inputs B and the output of G1. G4 has inputs from the outputs of G2 and G3, and its output is F.ABG1G2G3G4F
  1. Option A: A ⊕ B
  2. Option B: A + B
  3. Option C: A′B′
  4. Option D: A ⊙ B (XNOR)
Show answer and solutionHide answer and solution

Answer: (D)

Key idea: The same four-gate structure gives XOR when built from NAND and XNOR when built from NOR, because the two are duals.

1. G1 = (A + B)′.

2. G2 = (A + G1)′ = A′·G1′ = A′(A + B) = A′B.

3. G3 = (B + G1)′ = B′(A + B) = AB′.

4. F = (G2 + G3)′ = (A′B + AB′)′ = A ⊙ B.

5. Check A = B = 0: G1 = 1, G2 = 0, G3 = 0, F = 1.

Common mistake: Assuming the well-known four-NAND XOR structure gives XOR with NOR gates too picks A ⊕ B, option (A); at A = B = 0 that predicts 0 but F = 1.

You need: Universal gates, duality

Q.14

HardNAT2 marks

F(A, B, C, D) = (A ⊕ B)(C ⊕ D) + (A ⊙ B)(C ⊙ D), where ⊙ is XNOR. The number of the 16 input combinations for which F = 1 is ______.

Numerical answer: type a number.

Show answer and solutionHide answer and solution

Answer: 8

Key idea: Comparing two XORs for equality is an XNOR, which turns the whole function into a parity check.

1. F = 1 when A ⊕ B and C ⊕ D are equal (both 1 or both 0).

2. That is (A ⊕ B) ⊙ (C ⊕ D) = (A ⊕ B ⊕ C ⊕ D)′, the even-parity function of four bits.

3. Exactly half of the 16 rows have even parity, so the count is

8. Check: both XORs 1 gives 2 × 2 = 4 rows, both 0 gives 2 × 2 = 4 rows.

Common mistake: Counting only the first term (both XORs equal to 1) gives 4.

You need: XOR and XNOR, parity

Q.15

HardMCQ2 marks

For a full adder with inputs x, y and z, let S = x ⊕ y ⊕ z and C = xy + yz + zx. The function S ⊕ C equals

  1. Option A: (xyz + x′y′z′)′
  2. Option B: x + y + z
  3. Option C: xyz + x′y′z′
  4. Option D: (x ⊕ y)z
Show answer and solutionHide answer and solution

Answer: (A)

Key idea: S and C depend only on how many inputs are 1, so a weight table settles any function of them.

1. Group the rows by the number of 1s, w. 2. w = 0: S = 0, C = 0, S ⊕ C = 0. 3. w = 1: S = 1, C = 0, so 1. 4. w = 2: S = 0, C = 1, so 1. 5. w = 3: S = 1, C = 1, so 0.

6. S ⊕ C is 1 unless all inputs are equal, which is (xyz + x′y′z′)′.

Common mistake: Forgetting that S and C are both 1 when all three inputs are 1 makes S ⊕ C equal to 1 for every nonzero input, which is x + y + z, option (B).

You need: Full adder, XOR