GATE 2026 CS (CS1) – Question 36
Consider the real valued variables $X, Y$ and $Z$ represented using the IEEE 754 single-precision floating-point format. The binary representations of $X$ and $Y$ in hexadecimal notation are as follows:
$$X: \text{35C00000} \quad Y: \text{34A00000}$$
Let $Z = X + Y$. Which one of the following is the binary representation of $Z$, in hexadecimal notation?
Practise this question in The GATE Grind →
Show answer and explanation
Correct answer: (C) 35E80000
Explanation
IEEE 754 single-precision format has 1 sign bit ($s$), 8 exponent bits ($e$, bias 127), and 23 fraction bits ($f$).
1. Decoding $X = \text{35C00000}_{16}$:
- Hex to binary: `0011 0101 1100 0000 0000 0000 0000 0000`
- Sign $s = 0$ (+)
- Exponent $e = 01101011_2 = 64 + 32 + 8 + 2 + 1 = 107$
- True exponent = $107 - 127 = -20$
- Mantissa = $1.f = 1.1000000\dots_2 = 1.5$
- Value: $X = 1.5 \times 2^{-20}$
2. Decoding $Y = \text{34A00000}_{16}$:
- Hex to binary: `0011 0100 1010 0000 0000 0000 0000 0000`
- Sign $s = 0$ (+)
- Exponent $e = 01101001_2 = 64 + 32 + 8 + 1 = 105$
- True exponent = $105 - 127 = -22$
- Mantissa = $1.f = 1.0100000\dots_2 = 1.25$
- Value: $Y = 1.25 \times 2^{-22}$
3. Floating point addition $Z = X + Y$:
Align the smaller exponent to exponent $-20$:
$$Y = 1.25 \times 2^{-22} = (1.25 \times 2^{-2}) \times 2^{-20} = 0.3125 \times 2^{-20} = 0.0101_2 \times 2^{-20}$$
Add mantissas:
$$\text{Mantissa of } Z = 1.1000_2 + 0.0101_2 = 1.1101_2$$
Exponent of $Z$ remains $-20$ (biased exponent = 107 = `01101011`).
Fraction bits $f = 1101000\dots_2$.
4. Encoding $Z$ into hex:
`0 01101011 1101 0000 0000 0000 0000 000`
Group by 4 bits: `0011 0101 1110 1000 0000 0000 0000 0000` = `35E80000`.
Therefore, option (C) is correct.