Skip to content
Official PYQ · 2022

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

Explain with AI

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

RA=0xC1400000RB=0x42100000RC=0x41400000\begin{array} {|c|c|c|} \hline \text{R}_{\text{A}} = \text{0xC1400000} & \text{R}_{\text{B}} = \text{0x42100000} & \text{R}_{\text{C}} = \text{0x41400000} \\ \hline \end{array}

Which one of the following is FALSE?\text{FALSE}?

Choose one option
View worked solution

Answer: B

To find the values of AA, BB, and CC, we decode their 32-bit IEEE-754 single-precision representation: Value=(−1)S×(1+M)×2E−127\text{Value} = (-1)^S \times (1 + M) \times 2^{E - 127}.

  1. For RA=0xC1400000R_A = \text{0xC1400000}:
    • Binary: 1⏟S 1000 0010⏟E 100 0000 0000 0000 0000 0000⏟M\underbrace{1}_{S} \ \underbrace{1000\,0010}_{E} \ \underbrace{100\,0000\,0000\,0000\,0000\,0000}_{M}
    • S=1S = 1 (negative), E=13010E = 130_{10}, and M=0.510M = 0.5_{10}
    • A=−1×(1+0.5)×2130−127=−1.5×8=−12A = -1 \times (1 + 0.5) \times 2^{130 - 127} = -1.5 \times 8 = -12
  2. For RB=0x42100000R_B = \text{0x42100000}:
    • Binary: 0⏟S 1000 0100⏟E 001 0000 0000 0000 0000 0000⏟M\underbrace{0}_{S} \ \underbrace{1000\,0100}_{E} \ \underbrace{001\,0000\,0000\,0000\,0000\,0000}_{M}
    • S=0S = 0 (positive), E=13210E = 132_{10}, and M=2−3=0.12510M = 2^{-3} = 0.125_{10}
    • B=+1×(1+0.125)×2132−127=1.125×32=36B = +1 \times (1 + 0.125) \times 2^{132 - 127} = 1.125 \times 32 = 36
  3. For RC=0x41400000R_C = \text{0x41400000}:
    • Binary: 0⏟S 1000 0010⏟E 100 0000 0000 0000 0000 0000⏟M\underbrace{0}_{S} \ \underbrace{1000\,0010}_{E} \ \underbrace{100\,0000\,0000\,0000\,0000\,0000}_{M}
    • S=0S = 0 (positive), E=13010E = 130_{10}, and M=0.510M = 0.5_{10}
    • C=+1×(1+0.5)×2130−127=1.5×8=12C = +1 \times (1 + 0.5) \times 2^{130 - 127} = 1.5 \times 8 = 12

Now, let's evaluate the options:

  • (A) A+C=−12+12=0A + C = -12 + 12 = 0 (True)
  • (B) C=A+B  ⟹  12=−12+36=24C = A + B \implies 12 = -12 + 36 = 24 (False)
  • (C) B=3C  ⟹  36=3×12B = 3C \implies 36 = 3 \times 12 (True)
  • (D) (B−C)>0  ⟹  36−12=24>0(B - C) > 0 \implies 36 - 12 = 24 > 0 (True)

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

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