GATE Computer ScienceVery hardGATE CS (PYQ pattern)
A binary floating-point format keeps 4 significant bits (1 hidden + 3 stored fraction bits) with a wide exponent range and round-to-nearest, ties-to-even after every operation. What are the computed values of (7 × 3) × 3 and 7 × (3 × 3)?
- A. 64 and 64
- B. 60 and 60
- C. 60 and 64
- D. 63 and 63
Correct answer: C. 60 and 64
Representable values in [16, 32) step 2, in [32, 64) step 4, in [64, 128) step 8. 7 × 3 = 21 is a tie between 20 (1.010) and 22 (1.011): ties-to-even gives 20; then 20 × 3 = 60 (1.111 × 2⁵) is exact. 3 × 3 = 9 is exact; 7 × 9 = 63 lies between 60 and 64 and is nearer 64. Exact arithmetic would give 63, which is not representable.
More Digital Logic questions
- 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?
- Over all 256 eight-bit patterns, for how many does the value read as sign-magnitude, as one's complement and as two's complement all…
- The quadratic x² − (13)b·x + (46)b = 0, with coefficients written in base b, has roots 6 and 9. What is b?