Question

Consider the following representation of a number in IEEE 754 single-precision floating point format with a bias of 127.

S: 1 E: 10000001 F: 11110000000000000000000

Here S, E and F denote the sign, exponent and fraction components of the floating point representation.

The decimal value corresponding to the above representation (rounded to 2 decimal places) is __________

Official answer and solution
Official answer
-7.75
From
Official GATE 2021 answer key

Solution

Decode the IEEE 754 single-precision floating point fields using bias 127.

Given single-precision IEEE 754 fields:

  • Sign bit: S=1S = 1 (indicates a negative number).
  • Exponent: E=100000012=128+1=12910E = 10000001_2 = 128 + 1 = 129_{10}.
    With a bias of 127, the true exponent is e=E−127=129−127=2e = E - 127 = 129 - 127 = 2.
  • Fraction: F=111100000000000000000002F = 11110000000000000000000_2.
    The fractional value is:
    f=121+122+123+124=0.5+0.25+0.125+0.0625=0.9375f = \frac{1}{2^1} + \frac{1}{2^2} + \frac{1}{2^3} + \frac{1}{2^4} = 0.5 + 0.25 + 0.125 + 0.0625 = 0.9375
    The normalized significand is M=1+f=1+0.9375=1.9375M = 1 + f = 1 + 0.9375 = 1.9375.

Computing the value:

Value=(−1)S×M×2e=(−1)1×1.9375×22=−1.9375×4=−7.75\text{Value} = (-1)^S \times M \times 2^e = (-1)^1 \times 1.9375 \times 2^2 = -1.9375 \times 4 = -7.75
Final answer

-7.75

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

Source

Paper
GATE 2021 Computer Science and Information Technology (CS, Set-1)
Question
34 of 65, printed as CS Q.24
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.