GATE Computer ScienceHardGATE CS (PYQ pattern)
Which of the following are true? (Python-style double precision for I, III, IV; single precision rounding for II.) I. adding 0.1 to a total initialised at 0.0 ten times (a loop) gives exactly 1.0 II. when the double sum 0.1 + 0.2 is rounded to single precision it equals the single-precision rounding of 0.3 III. 0.1 × 10 == 1.0 IV. 0.1 + 0.2 == 0.3
- A. I, II and III only
- B. III only
- C. II and III only
- D. II, III and IV only
Correct answer: C. II and III only
Repeated addition accumulates rounding errors and ends at 0.9999999999999999 (I false). 0.1 × 10 rounds to exactly 1.0 (III true). In double, 0.1 + 0.2 = 0.30000000000000004 ≠ 0.3 (IV false), but after rounding to single precision both sides are 0x3E99999A (II true).
More Digital Logic questions
- A 5-bit asynchronous up-counter Q4..Q0 (Q4 the MSB) has its active-low asynchronous clear driven by a 3-input NAND of Q4, Q1 and Q0. The…
- A 3-bit register Q2Q1Q0 shifts right every clock, and the new Q2 is the XNOR of the old Q2 and old Q0. What is the behaviour of this…
- A 6-bit Johnson counter Q5…Q0 shifts right on each clock (Q4 ← Q5, …, Q0 ← Q1) and loads Q5 ← Q0' (old Q0). Because of noise it starts in…
- A combinational datapath with stage delays of 3 ns, 5 ns and 4 ns is split into three pipeline stages by registers, each register adding…
- A 16-bit carry-select adder is built from ripple-carry blocks. Every full adder produces its carry 2 gate delays after its inputs/carry-in…
- A rising-edge D flip-flop has D = 1 permanently and an active-low asynchronous clear. The flip-flop starts at Q = 0. Rising clock edges…