GATE Computer ScienceVery hardGATE CS (PYQ pattern)

An 8-bit ALU computes 0x50 − 0xB0 by adding 0x50 to the two's complement of 0xB0. What are the result and the signed-overflow flag V?

  1. A. 0x60 with V = 1
  2. B. 0x1A0 with V = 1
  3. C. 0xA0 with V = 0
  4. D. 0xA0 with V = 1

Correct answer: D. 0xA0 with V = 1

0x50 = +80 and 0xB0 = −80, so the true result +160 is outside −128..127: the byte 0xA0 (−96) is wrong and V = 1. A − B with A positive and B negative giving a negative result is the overflow case.

More Computer Organization and Architecture questions

Exams that ask this topic