Skip to content
Official PYQ · 2020

GATE CS 2020 Q29 — Number Representations (Fixed and Floating Point)

Explain with AI

Consider three registers R1R1, R2R2, and R3R3 that store numbers in IEEE-754\textsf{IEEE-754} single precision floating point format. Assume that R1R1 and R2R2 contain the values (in hexadecimal notation) 0x42200000\textsf{0x42200000} and 0xC1200000,\textsf{0xC1200000}, respectively.

If R3=R1R2R3=\frac{R1}{R2}, what is the value stored in R3R3?

Choose one option
View worked solution

Answer: B

To find the value stored in R3R3, we first decode the IEEE-754 single-precision floating-point values in R1R1 and R2R2.

1. Decoding R1=0x42200000R1 = \text{0x42200000}:

  • Binary representation: 0100 0010 0010 0000 0000 0000 0000 000020100\ 0010\ 0010\ 0000\ 0000\ 0000\ 0000\ 0000_2
  • Sign bit (SS) = 00 (positive)
  • Biased Exponent (EE) = 1000 01002=132101000\ 0100_2 = 132_{10}
  • Actual Exponent (ee) = 132−127=5132 - 127 = 5
  • Mantissa (MM) = 1.012=1.25101.01_2 = 1.25_{10}
  • Value of R1=+1.25×25=40R1 = +1.25 \times 2^5 = 40

2. Decoding R2=0xC1200000R2 = \text{0xC1200000}:

  • Binary representation: 1100 0001 0010 0000 0000 0000 0000 000021100\ 0001\ 0010\ 0000\ 0000\ 0000\ 0000\ 0000_2
  • Sign bit (SS) = 11 (negative)
  • Biased Exponent (EE) = 1000 00102=130101000\ 0010_2 = 130_{10}
  • Actual Exponent (ee) = 130−127=3130 - 127 = 3
  • Mantissa (MM) = 1.012=1.25101.01_2 = 1.25_{10}
  • Value of R2=−1.25×23=−10R2 = -1.25 \times 2^3 = -10

3. Calculating R3=R1R2R3 = \frac{R1}{R2}:

R3=40−10=−4R3 = \frac{40}{-10} = -4

4. Encoding −4-4 into IEEE-754 format:

  • −4=−1.0×22-4 = -1.0 \times 2^2
  • Sign bit (SS) = 11
  • Actual Exponent (ee) = 2  ⟹  2 \implies Biased Exponent (EE) = 2+127=12910=1000 000122 + 127 = 129_{10} = 1000\ 0001_2
  • Fraction (FF) = 000…02000\dots0_2
  • Combined Binary: 1100 0000 1000 0000 0000 0000 0000 000021100\ 0000\ 1000\ 0000\ 0000\ 0000\ 0000\ 0000_2
  • Hexadecimal representation: 0xC0800000\text{0xC0800000}

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

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