Skip to content
Official PYQ · 2024

GATE CS 2024 Set 1 Q3 — Number Representations (Fixed and Floating Point)

Explain with AI

Consider a system that uses 55 bits for representing signed integers in 22 's complement format. In this system, two integers AA and BB are represented as AA=0101001010 and BB=1101011010. Which one of the following operations will result in either an arithmetic overflow or an arithmetic underflow?

Choose one option
View worked solution

Answer: B

In a 55-bit 22's complement representation, the range of representable signed integers is:

[−25−1,25−1−1]=[−16,15][-2^{5-1}, 2^{5-1} - 1] = [-16, 15]

First, let's determine the decimal values of the given binary representations AA and BB:

  • A=010102A = 01010_2: Since the MSB (sign bit) is 00, it is a positive number. A=(0×−16)+(1×8)+(0×4)+(1×2)+(0×1)=10A = (0 \times -16) + (1 \times 8) + (0 \times 4) + (1 \times 2) + (0 \times 1) = 10
  • B=110102B = 11010_2: Since the MSB is 11, it is a negative number. B=−16+(1×8)+(0×4)+(1×2)+(0×1)=−6B = -16 + (1 \times 8) + (0 \times 4) + (1 \times 2) + (0 \times 1) = -6

Now, let's evaluate each option to see if the result falls outside the representable range [−16,15][-16, 15]:

  1. A+BA + B: 10+(−6)=410 + (-6) = 4 Since 4∈[−16,15]4 \in [-16, 15], no overflow or underflow occurs.
  2. A−BA - B: 10−(−6)=1610 - (-6) = 16 Since 16∉[−16,15]16 \notin [-16, 15], this operation results in an arithmetic overflow (positive overflow).
  3. B−AB - A: −6−10=−16-6 - 10 = -16 Since −16∈[−16,15]-16 \in [-16, 15], no overflow or underflow occurs.
  4. 2∗B2 * B: 2×(−6)=−122 \times (-6) = -12 Since −12∈[−16,15]-12 \in [-16, 15], no overflow or underflow occurs.

Thus, only the operation A−BA - B results 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