Skip to content
Official PYQ · 2014

GATE CS 2014 Set 2 Q45 — Number Representations (Fixed and Floating Point)

Explain with AI

The value of a float\text{float} type variable is represented using the single-precision 32-bit\text{32-bit} floating point format of IEEE-754\text{IEEE-754} standard that uses 11 bit\text{bit} for sign, 8 bits\text{8 bits} for biased exponent and 23 bits\text{23 bits} for the mantissa. A float\text{float} type variable XX is assigned the decimal value of −14.25−14.25. The representation of XX in hexadecimal notation is

Choose one option
View worked solution

Answer: A

To represent the decimal value −14.25-14.25 in IEEE-754 single-precision floating-point format, we follow these steps:

  1. Sign Bit (SS): Since the number is negative, the sign bit is S=1S = 1.
  2. Binary Conversion: Convert the magnitude 14.2514.25 to binary: 1410=1110214_{10} = 1110_2 0.2510=0.0120.25_{10} = 0.01_2 Thus, 14.2510=1110.01214.25_{10} = 1110.01_2.
  3. Normalization: Normalize the binary representation to the form 1.M×2E1.M \times 2^E: 1110.012=1.110012×231110.01_2 = 1.11001_2 \times 2^3 Here, the actual exponent is 33, and the mantissa bits (MM) are 1100111001 (padded with zeros to 23 bits).
  4. Biased Exponent (EE): The bias for single-precision is 127127. Biased Exponent=3+127=13010=100000102\text{Biased Exponent} = 3 + 127 = 130_{10} = 10000010_2

Combining the fields (SS, EE, and MM):

SEM11000001011001000000000000000000\begin{array}{c|c|c} \mathbf{S} & \mathbf{E} & \mathbf{M} \\ \hline 1 & 10000010 & 11001000000000000000000 \\ \end{array}

Grouping the 32 bits into groups of 4 to convert to hexadecimal:

1100⏟C0001⏟10110⏟60100⏟40000⏟00000⏟00000⏟00000⏟0\underbrace{1100}_{\text{C}} \quad \underbrace{0001}_{1} \quad \underbrace{0110}_{6} \quad \underbrace{0100}_{4} \quad \underbrace{0000}_{0} \quad \underbrace{0000}_{0} \quad \underbrace{0000}_{0} \quad \underbrace{0000}_{0}

Thus, the hexadecimal representation is C1640000H\text{C1640000H}.

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

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