GATE Computer ScienceHardGATE CS (PYQ pattern)
A hypothetical 8-bit floating-point format follows IEEE 754 conventions: 1 sign bit, 4 exponent bits (bias 7), 3 fraction bits, with denormals, ±0, ±∞ and NaNs. How many distinct finite real values can it represent (treating +0 and −0 as one value)?
- A. 240
- B. 238
- C. 239
- D. 254
Correct answer: C. 239
Exponent field 1 to 14 gives normal numbers: 14 × 8 = 112 magnitudes; field 0 gives 7 non-zero denormals; so 119 non-zero magnitudes, i.e. 238 non-zero values with both signs, plus one zero: 239. Exponent field 15 is reserved for ∞ and NaN.
More Digital Logic questions
- An 8-bit floating-point format follows IEEE 754 conventions: 1 sign bit, 4 exponent bits (bias 7; field 15 reserved for ∞/NaN), 3 fraction…
- A floating-point format has a sign bit and 3 fraction bits (so 4 significant bits including the hidden 1), with round-to-nearest…
- A binary floating-point format keeps 4 significant bits (1 hidden + 3 stored fraction bits) with a wide exponent range and…
- For an 8-bit signed integer x (−128 to 127), x >> 2 is an arithmetic right shift (sign bit replicated) and x / 4 is division truncated…
- Over all 256 eight-bit patterns x (with −x and x − 1 computed modulo 2⁸), for how many is x & (−x) equal to x ^ (x − 1), where & is…
- An 8-bit two's complement adder computes 3x as (x + x) + x for every x from −128 to 127, setting the overflow flag V separately on each…