Skip to content

GATE CS 2022 Q8 — Number Representations (Fixed and Floating Point)

Explain with AI

Let R1\text{R1} and R2\text{R2} be two 4–bit4 – \text{bit} registers that store numbers in 2’s2\text{’s} complement form. For the operation R1 + R2,\text{R1 + R2}, which one of the following values of R1\text{R1} and R2\text{R2} gives an arithmetic overflow?

Choose one option
View worked solution

Answer: B

For a 44-bit register storing numbers in 22’s complement form, the range of representable integers is:

[−24−1,24−1−1]=[−8,7][-2^{4-1}, 2^{4-1} - 1] = [-8, 7]

An arithmetic overflow occurs during addition if the mathematical sum of the two numbers falls outside this representable range [−8,7][-8, 7]. Alternatively, overflow occurs when adding two numbers of the same sign yields a result with the opposite sign.

Let us evaluate each option by converting the 22’s complement binary numbers to their decimal equivalents:

  • Option A:
    • R1=10112=−5R1 = 1011_2 = -5
    • R2=11102=−2R2 = 1110_2 = -2
    • Sum=−5+(−2)=−7\text{Sum} = -5 + (-2) = -7 (within range [−8,7][-8, 7], no overflow)
  • Option B:
    • R1=11002=−4R1 = 1100_2 = -4
    • R2=10102=−6R2 = 1010_2 = -6
    • Sum=−4+(−6)=−10\text{Sum} = -4 + (-6) = -10 (outside range [−8,7][-8, 7], overflow occurs)
  • Option C:
    • R1=00112=+3R1 = 0011_2 = +3
    • R2=01002=+4R2 = 0100_2 = +4
    • Sum=3+4=7\text{Sum} = 3 + 4 = 7 (within range [−8,7][-8, 7], no overflow)
  • Option D:
    • R1=10012=−7R1 = 1001_2 = -7
    • R2=11112=−1R2 = 1111_2 = -1
    • Sum=−7+(−1)=−8\text{Sum} = -7 + (-1) = -8 (within range [−8,7][-8, 7], no overflow)

Thus, only the values in Option B result in an arithmetic overflow.

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore Number Representations (Fixed and Floating Point) questions