GATE Computer ScienceHardGATE CS (PYQ pattern)

Over all 256 eight-bit patterns, for how many does the value read as sign-magnitude equal the value read as two's complement?

  1. A. 128
  2. B. 129
  3. C. 130
  4. D. 127

Correct answer: B. 129

All 128 patterns with MSB 0 agree. Of the negative patterns only 11000000 agrees (−64 in both); 10000000 is −0 in sign-magnitude but −128 in two's complement. So 128 + 1 = 129.

More Digital Logic questions

Exams that ask this topic