GATE Computer ScienceHardGATE CS (PYQ pattern)

A 32-bit logical right shifter (shift distance 0-31) has 5 levels, level j shifting by 2^j or not. A position whose shifted-in input would be the constant 0 needs only an AND gate, not a multiplexer. How many genuine 2:1 multiplexers are needed?

  1. A. 160
  2. B. 128
  3. C. 129
  4. D. 96

Correct answer: C. 129

Level j passes 32 positions; the top 2^j positions would receive 0 when shifting, so they are AND gates and the other 32 − 2^j are multiplexers. Σ (32 − 2^j) for j = 0..4 = 160 − 31 = 129. A rotator would need all 160.

More Digital Logic questions

Exams that ask this topic