GATE Computer ScienceVery hardGATE CS (PYQ pattern)

F(A,B,C,D) = 1 when exactly two or exactly three of the four inputs are 1. How many literals does its minimal sum-of-products contain (fewest product terms first, then fewest literals)?

  1. A. 24
  2. B. 12
  3. C. 18
  4. D. 22

Correct answer: C. 18

The 1s are the 6 weight-2 and 4 weight-3 minterms. Each weight-3 minterm merges with weight-2 neighbours into a 3-literal term such as AB C' (the 0000 and 1111 cells are 0, so nothing larger exists). Every prime implicant has 3 literals and pairs one weight-2 minterm with one weight-3 minterm. Covering the 6 weight-2 minterms therefore needs at least 6 terms (each term holds only one of them), and 6 suffice: 6 × 3 = 18 literals. Exactly two alone needs 6 four-literal terms (24 literals).

More Digital Logic questions

Exams that ask this topic