GATE Computer ScienceHardGATE CS (PYQ pattern)

For 8-bit patterns a and b, how many ordered pairs satisfy a > b when both are read as signed two's complement numbers, but a < b when both are read as unsigned numbers?

  1. A. 32640
  2. B. 8128
  3. C. 32768
  4. D. 16384

Correct answer: D. 16384

The two orderings disagree only when the sign bits differ. With a non-negative and b negative, signed a > b but unsigned a < b: 128 × 128 = 16384 pairs. The opposite case (a negative, b non-negative) gives signed a < b.

More Digital Logic questions

Exams that ask this topic