GATE Computer ScienceVery hardGATE CS (PYQ pattern)
In IEEE 754 single precision with round-to-nearest-even (every operation rounded to single), which of these are true? I. 0.1f + 0.2f == 0.3f. II. (1.0e8f + 1.0f) − 1.0e8f == 0. III. 16777216.0f + 1.0f == 16777216.0f. IV. The double 0.1 equals the single 0.1f converted to double.
- A. II and III only
- B. III only
- C. I, II, III and IV
- D. I, II and III only
Correct answer: D. I, II and III only
III: 2²⁴ + 1 is a tie at spacing 2 and rounds to even, 2²⁴. II: near 10⁸ the spacing is 8, so 10⁸ + 1 rounds back to 10⁸ and the difference is 0. I: in single, 0.1f + 0.2f rounds to exactly the same float as 0.3f (unlike in double, where 0.1 + 0.2 ≠ 0.3). IV is false: 0.1f has only 24 significant bits, the double 0.1 has 53.
Practise more Computer Organization and Architecture questionsComputer Organization and Architecture: notes and key points
More Computer Organization and Architecture questions
- An 8-bit data word d1…d8 = 1 0 1 1 0 0 1 0 is stored with a 12-bit single-error-correcting Hamming code: positions 1, 2, 4, 8 hold check…
- A byte-addressed machine has auto-increment (R1)+ (use R1 as the address, then add 4) and auto-decrement −(R1) (subtract 4 from R1, then…
- A fully associative cache holds 4 blocks. A loop cycles through 5 distinct blocks 0,1,2,3,4,0,1,2,3,4,… for 30 references. How many hits…
- In C99, int x = −37 (32-bit two's complement), and this implementation's >> on negative values is an arithmetic shift. What are x / 4, x…
- A non-pipelined processor takes the sum of its stage delays (90, 150, 110, 170, 80, 130 ps) per instruction. Its pipelined version has the…
- Which hexadecimal pattern is the IEEE 754 single-precision representation of 0.1 (round to nearest)?