IAE Academy

GATE 2020 EC Q.38: solution and answer

GATE 2020 · ECQ.38 · 2 marks · MCQ

P, Q, and R are the decimal integers corresponding to the 4-bit binary number 1100 considered in signed magnitude, 1's complement, and 2's complement representations, respectively. The 6-bit 2's complement representation of (P + Q + R) is

  1. (A)

    110101

  2. (B)

    110010

  3. (C)

    111101

  4. (D)

    111001

See the question in the paper

Answer and solution

ANSWER

, and , so . In 6-bit 2's complement that is , which is option (A).

Official answer: ASource: Official answer key, GATE 2020 EC (IIT Delhi)

  1. Signed magnitude (P): the MSB is the sign bit and the other three bits give the magnitude. In the sign bit is (negative) and the magnitude is , so .

  2. 1's complement (Q): the MSB is , so the number is negative. Its magnitude is the bitwise complement of the whole word: (here means complement every bit), so .

  3. 2's complement (R): the MSB has weight , so . As a check, complement and add 1: , so the magnitude is and .

  4. Sum: . A 6-bit 2's complement word holds to , so fits.

  5. 6-bit 2's complement of : . Complementing every bit gives , and adding gives . (Equivalently, .)

  6. Check with the weighted value: . The answer is option (A), .

KEY IDEA

The same bit pattern means a different number in each representation. With MSB : in signed magnitude the magnitude is the remaining bits, in 1's complement it is the complement of all the bits, and in 2's complement the MSB counts as . To write a negative number in 6-bit 2's complement, take , or complement and add 1.

WATCH OUT FOR

A common slip is reading as in 1's complement too. Its 1's complement value is , because the magnitude is , not . Another slip is forming the 6-bit answer from the 4-bit pattern (for example by sign-extending ) instead of converting the sum . Some students also give , which is , or forget the final and pick the 1's complement pattern .

From the GATE 2020 EC paper. Every question of this paper · Download the full paper · All 5 Number systems questions, with notes

More Number systems questions