GATE Computer ScienceVery hardGATE CS (PYQ pattern)

For how many of the 256 ordered pairs of 4-bit two's complement numbers (a, b) does the exact product a·b fit in a 4-bit two's complement number (range −8 to 7)?

  1. A. 100
  2. B. 128
  3. C. 64
  4. D. 101

Correct answer: D. 101

Enumerating all 256 pairs and testing −8 ≤ a·b ≤ 7 gives 101 pairs. Pairs with 0 always fit, while pairs such as 3 × 3 = 9 or (−8) × (−1) = 8 do not.

More Digital Logic questions

Exams that ask this topic