GATE Computer ScienceModerateGATE CS (PYQ pattern)

A 17-input XOR (parity) function is built only from 3-input XOR gates (no 2-input gates). What are the minimum number of gates and the minimum depth (levels of gates)?

  1. A. 8 gates, depth 4
  2. B. 8 gates, depth 3
  3. C. 9 gates, depth 3
  4. D. 6 gates, depth 3

Correct answer: B. 8 gates, depth 3

Each 3-input gate turns 3 signals into 1, reducing the count by 2: 17 → 1 needs (17 − 1)/2 = 8 gates. Depth d can combine at most 3^d inputs: 3² = 9 < 17 ≤ 27 = 3³, so depth ≥ 3, and it is reached with 8 gates: 5 gates on 15 inputs (7 signals left), then 2 gates (3 left), then 1.

More Digital Logic questions

Exams that ask this topic