GATE Computer ScienceHardGATE CS (PYQ pattern)

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

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

Correct answer: A. 128

Only patterns with MSB 0 (0 to 127) coincide: for any negative pattern, one's complement value is p − 255 and two's complement p − 256 so they never agree. That is 128.

More Digital Logic questions

Exams that ask this topic