GateAI
Number Representation and Arithmetic

GATE CSE 2022 · Q18

MCQ1 markEasy

Time

Let R1 and R2 be two 4-bit registers that store numbers in 2's complement form. For the operation R1+R2, which one of the following values of R1 and R2 gives an arithmetic overflow?

Select one answerSingle correct

Pick an option to check

Solution

Step-by-step verified solution

Official answer: B) R1 = 1100 and R2 = 1010

Number Representation and Arithmetic

In 4-bit 2's complement representation, the representable range of signed integers is:

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

An arithmetic overflow occurs when adding two numbers of the same sign produces a result outside this range (i.e., adding two negative numbers yields a positive result, or adding two positive numbers yields a negative result).

Let us evaluate each option:

  • Option (A):

    • R1=10112=−5\text{R1} = 1011_2 = -5

    • R2=11102=−2\text{R2} = 1110_2 = -2

    • Sum=−5+(−2)=−7\text{Sum} = -5 + (-2) = -7

    • Since −7∈[−8,+7]-7 \in [-8, +7], no overflow occurs.

  • Option (B):

    • R1=11002=−4\text{R1} = 1100_2 = -4

    • R2=10102=−6\text{R2} = 1010_2 = -6

    • Sum=−4+(−6)=−10\text{Sum} = -4 + (-6) = -10

    • Since −10<−8-10 < -8, the result is outside the representable range.

    • In 4-bit binary addition: 11002+10102=1011021100_2 + 1010_2 = 10110_2. Taking the lower 4 bits gives 01102=+60110_2 = +6, which has the wrong sign. The carry into MSB is Cin=0C_{\text{in}} = 0 and carry out is Cout=1C_{\text{out}} = 1, giving overflow V=Cin⊕Cout=1V = C_{\text{in}} \oplus C_{\text{out}} = 1. Thus, overflow occurs.

  • Option (C):

    • R1=00112=+3\text{R1} = 0011_2 = +3

    • R2=01002=+4\text{R2} = 0100_2 = +4

    • Sum=3+4=+7∈[−8,+7]\text{Sum} = 3 + 4 = +7 \in [-8, +7] (No overflow).

  • Option (D):

    • R1=10012=−7\text{R1} = 1001_2 = -7

    • R2=11112=−1\text{R2} = 1111_2 = -1

    • Sum=−7+(−1)=−8∈[−8,+7]\text{Sum} = -7 + (-1) = -8 \in [-8, +7] (No overflow).

Hence, (B) is the correct option.

Try the question first, then check your work.

Think the official key or this write-up is wrong?

Report error or challenge

Examiner trap

The misconception this question tests

This Number Representation and Arithmetic previous year question is Q18 of the GATE CSE 2022 paper. Find more GATE CSE PYQs on Number Representation and Arithmetic in Digital Logic, or browse all GATE CSE PYQs.

Free diagnostic

Where do you stand for GATE?

Take the 20-minute diagnostic: the 3 topics that cost you the most marks, and a rank range. Or sit 5 related Number Representation and Arithmetic PYQs now with no account.

One GATE CSE PYQ every morning

An official question by email at 7 AM IST, with a link to its verified solution. Unsubscribe in one click.

Number Representation and Arithmetic in GATE CSE

Number Representation and Arithmetic has 33 GATE CSE PYQs across 20 papers from 2012 to 2026. 13 of them are 1-mark MCQs like this one, and GATE CSE 2022 has 2.

How GATE tests Number Representation and Arithmetic

More from GATE CSE 2022

Share this solution

A plain-text card for WhatsApp or Telegram study groups.

GateAI solution cardGATE CSE 2022 · Q18 · MCQ

Let R1 and R2 be two 4-bit registers that store numbers in 2's complement form. For the operation R1+R2, which one of the following values of R1 and R2 gives an arithmetic overflow?

Topic-wise GATE CS PYQs with verified steps

Independent practice explanation verified by the GateAI team. GATE is conducted by the IITs; question text follows the official paper.