GATE / CS ARCHIVE

GATE CSE 2002 / QUESTION 9(b)

Find the custom hexadecimal float maximum

Computer Organization & Architecture · Data Representation & Arithmetic · Full GATE CSE 2002 paper

GATE 2002, Q9(b) Descriptive
Report issue

Data Representation & Arithmetic

Question 9(b), GATE 2002: A 32-bit floating-point format has fields, from most to least significant: sign (1 bit), fraction (24 bits), exponent (7 bits). Sign 0 means positive and 1 negative. The binary point precedes the fraction bits. The exponent is stored in excess-64 representation, and the exponentiation base is 16. Find the largest representable value and express it as the nearest power of 10.
Question 9(b), GATE 2002: A 32-bit floating-point format has fields, from most to least significant: sign (1 bit), fraction (24 bits), exponent (7 bits). Sign 0 means positive and 1 negative. The binary point precedes the fraction bits. The exponent is stored in excess-64 representation, and the exponentiation base is 16. Find the largest representable value and express it as the nearest power of 10.
Tap to enlarge
Shared context

The custom 32-bit format stores sign, 24-bit fraction, then 7-bit excess-64 exponent, in that order. Its numeric value is (−1)^s(F/2^24)16^(E−64); no reserved exponent encodings are specified.

Answer & solution

Answer: (1 − 2^−24)16^63 ≈ 7.23700515 × 10^75; nearest power 10^76 (no official key was published)

1. Choose the sign for the largest value. The largest representable number is positive, so the sign bit must be 0. A negative sign would reduce the value rather than maximize it.

2. Maximize the fraction. A 24-bit fraction with its binary point to the left has value F/224. All fraction bits equal to 1 give F=224−1 and fraction (224−1)/224 = 1−2−24. This is normalized and is strictly less than 1; replacing it by 1 would invent an unrepresentable fraction.

3. Maximize the exponent. The seven-bit stored field ranges from 0 to 127. Because the bias is 64, its largest actual exponent is 127−64=63. The problem specifies no reserved encodings, so none are excluded as infinity or NaN.

4. Combine the fields using radix 16, not radix 2: V_max = (1−2−24)1663 = (1−2−24)2252 ≈ 7.23700515 × 1075.

5. Convert to the requested nearest power of ten. log10(V_max) = log10(1−2−24) + 63log10(16) ≈ 75.85956. Rounding the exponent to the nearest integer gives 76, hence the nearest power is 1076. The exact maximum above distinguishes the representable value from this order-of-magnitude answer.

Original paper, page 7