Question

Consider three floating point numbers A, B and C stored in registers RA, RB and RC, respectively as per IEEE-754 single precision floating point format. The 32-bit content stored in these registers (in hexadecimal form) are as follows.

RA=0xC1400000,RB=0x42100000,RC=0x41400000\text{RA} = \text{0xC1400000}, \quad \text{RB} = \text{0x42100000}, \quad \text{RC} = \text{0x41400000}

Which one of the following is FALSE?

Choose one option
Official answer and solution
Official answer
B
From
Official GATE 2022 answer key

Solution

Decode the IEEE-754 single precision floating point hexadecimal representations to their real values and evaluate each relationship.

In IEEE-754 single precision: bit 31 is sign ss, bits 30..23 are biased exponent ee, and bits 22..0 are fraction ff.

  1. RA=0xC1400000=1100 0001 0100 …2\text{RA} = \text{0xC1400000} = 1100\ 0001\ 0100\ \dots_2:

    • s=1s = 1 (negative)
    • e=1000 00102=130e = 1000\ 0010_2 = 130. Unbiased exponent: 130−127=3130 - 127 = 3.
    • f=.100…2=0.5f = .100\dots_2 = 0.5. Value: A=−1×(1+0.5)×23=−1.5×8=−12.0A = -1 \times (1 + 0.5) \times 2^3 = -1.5 \times 8 = -12.0.
  2. RC=0x41400000=0100 0001 0100 …2\text{RC} = \text{0x41400000} = 0100\ 0001\ 0100\ \dots_2:

    • s=0s = 0 (positive), same magnitude as AA. Value: C=+12.0C = +12.0.
  3. RB=0x42100000=0100 0010 0001 …2\text{RB} = \text{0x42100000} = 0100\ 0010\ 0001\ \dots_2:

    • s=0s = 0 (positive)
    • e=1000 01002=132e = 1000\ 0100_2 = 132. Unbiased exponent: 132−127=5132 - 127 = 5.
    • f=.0010…2=18=0.125f = .0010\dots_2 = \frac{1}{8} = 0.125. Value: B=(1+0.125)×25=1.125×32=36.0B = (1 + 0.125) \times 2^5 = 1.125 \times 32 = 36.0.

Testing the options:

  • (A) A+C=−12.0+12.0=0A + C = -12.0 + 12.0 = 0. (TRUE)
  • (B) C=A+B  ⟹  12.0=−12.0+36.0=24.0C = A + B \implies 12.0 = -12.0 + 36.0 = 24.0, which is FALSE.
  • (C) B=3C  ⟹  36.0=3×12.0=36.0B = 3C \implies 36.0 = 3 \times 12.0 = 36.0. (TRUE)
  • (D) (B−C)=36.0−12.0=24.0>0(B - C) = 36.0 - 12.0 = 24.0 > 0. (TRUE)

Thus, Option (B) is the FALSE statement.

Final answer

Option (B)

Common trap

Incorrectly calculating the fraction value for RB (1.125×32=361.125 \times 32 = 36).

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

Source

Paper
GATE 2022 Computer Science and Information Technology (CS)
Question
41 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.