GATE 2021 CS (CS1) – Question 34
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 ______.
Practise this question in The GATE Grind →
Show answer and explanation
Correct answer: -7.75
Explanation
Fields: S $=1$, E $=\texttt{10000001}$, F $=\texttt{11110000000000000000000}$.
- Sign bit 1 means the number is negative.
- Exponent field $\texttt{10000001}_2=129$, so the true exponent is $129-127=2$.
- Mantissa $=1.F=1.1111_2=1+\tfrac12+\tfrac14+\tfrac18+\tfrac1{16}=1.9375$.
$$\text{Value}=-1.9375\times2^2=-1.9375\times4=\mathbf{-7.75}.$$