GATE Computer ScienceModerateGATE CSE · UGC NET

An 8-bit processor adds 0x7F and 0x01 as two's-complement numbers. Which flag setting results?

  1. A. Result 0x80 with N = 1, Z = 0, C = 1, V = 0
  2. B. Result 0x80 with N = 1, Z = 0, C = 0, V = 1
  3. C. Result 0x80 with N = 0, Z = 0, C = 0, V = 1
  4. D. Result 0x00 with N = 0, Z = 1, C = 1, V = 0

Correct answer: B. Result 0x80 with N = 1, Z = 0, C = 0, V = 1

127 + 1 = 128 does not fit in signed 8 bits, so the result 0x80 reads as −128 (N = 1) and signed overflow V = 1; there is no carry out of bit 7, so C = 0.

More Computer Organization and Architecture questions

Exams that ask this topic