Question

Consider the 8-bit signed integers XX, YY and ZZ represented using the sign-magnitude form. The binary representations of XX and YY are as follows:

X:10110100Y:01001100X: 10110100 \qquad Y: 01001100

Which of the following operations to compute ZZ result(s) in an arithmetic overflow?

Choose every correct option
Official answer and solution
Official answer
B and C
From
Official GATE 2026 answer key

Solution

Convert XX and YY from 8-bit sign-magnitude form to decimal and check which results lie outside the 8-bit sign-magnitude range [−127,+127][-127, +127].

In 8-bit sign-magnitude representation, the MSB is the sign bit (00 for ++, 11 for −-) and the remaining 77 bits give the magnitude in [0,127][0, 127], so the representable range is [−127,+127][-127, +127]:

  • X=101101002X = 10110100_2: sign =1= 1 (−-), magnitude =01101002=32+16+4=52  ⟹  X=−52= 0110100_2 = 32 + 16 + 4 = 52 \implies X = -52.
  • Y=010011002Y = 01001100_2: sign =0= 0 (++), magnitude =10011002=64+8+4=76  ⟹  Y=+76= 1001100_2 = 64 + 8 + 4 = 76 \implies Y = +76.

Checking each operation:

  • (A) Z=X+Y=−52+76=+24∈[−127,+127]Z = X + Y = -52 + 76 = +24 \in [-127, +127] (no overflow).
  • (B) Z=X−Y=−52−76=−128∉[−127,+127]Z = X - Y = -52 - 76 = -128 \notin [-127, +127] (overflow).
  • (C) Z=−X+Y=+52+76=+128∉[−127,+127]Z = -X + Y = +52 + 76 = +128 \notin [-127, +127] (overflow).
  • (D) Z=−X−Y=+52−76=−24∈[−127,+127]Z = -X - Y = +52 - 76 = -24 \in [-127, +127] (no overflow).
Final answer

Options (B), (C)

Common trap

Using the 2's complement range [−128,+127][-128, +127] instead of the sign-magnitude range [−127,+127][-127, +127], which would miss −128-128.

The answer is the one in the official GATE answer key. The solution is this site's own explanation.

Source

Paper
GATE 2026 Computer Science and Information Technology - Session 1 (CS1)
Question
22 of 65
Section
Computer Science and Information Technology

Report an error in this question

GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.