GATE Computer ScienceHardGATE CS (PYQ pattern)

An 8-bit adder adds two operands a and b (no carry-in), each treated as an 8-bit two's complement number. Over all 2¹⁶ operand pairs, for how many pairs is the signed overflow flag V set?

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

Correct answer: A. 16384

Positive overflow needs both operands in 0..127 with sum ≥ 128: 8128 pairs. Negative overflow needs both in −128..−1 with sum < −128: 8256 pairs. Total 16384, which is 2¹⁴. Counting only positive overflow gives 8128 and counting carry-outs gives 32640.

More Digital Logic questions

Exams that ask this topic