GATE Computer ScienceHardGATE CS (PYQ pattern)
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 bits, with denormals. How many distinct non-negative integers (0 included) are exactly representable?
- A. 48
- B. 47
- C. 16
- D. 56
Correct answer: A. 48
Zero (1). Unbiased exponent 0 (1.000 to 1.875): only 1. Exponent 1 (step 0.25): 2, 3. Exponent 2 (step 0.5): 4..7 (4). Exponent 3 (step 1): 8..15 (8). Exponents 4..7 (fields 11-14) give 8 values each, all integers (16..30 step 2, 32..60 step 4, 64..120 step 8, 128..240 step 16): 32. Total 1 + 1 + 2 + 4 + 8 + 32 = 48.
More Digital Logic questions
- 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…
- Over all 256 eight-bit patterns, for how many does the value read as sign-magnitude equal the value read as two's complement?