GATE Computer ScienceVery hardGATE CSE

Two 8-bit two's-complement numbers a and b are added with an 8-bit adder. For how many ordered pairs (a, b), where a and b each range over all 256 values, does signed overflow occur?

  1. A. 8128
  2. B. 16129
  3. C. 16512
  4. D. 16384

Correct answer: D. 16384

Positive overflow needs a+b ≥ 128 and negative overflow needs a+b ≤ −129; the counts are 8128 and 8256 respectively (the negative range is one value larger), so 16384 pairs in total.

More Computer Organization and Architecture questions

Exams that ask this topic