GATE Computer ScienceHardGATE CS (PYQ pattern)
Which of the following are true in IEEE 754 arithmetic (using the language operators ==, != and the usual semantics)? Let nan be a NaN and let +0 and −0 be the two zeros. I. nan == nan II. nan != nan III. +0 == −0 IV. 1/(+0) == 1/(−0) V. nan < 1 or nan >= 1
- A. II and III only
- B. I, III and V only
- C. II, III and IV only
- D. II and V only
Correct answer: A. II and III only
Every comparison with NaN except != is false, so I and V are false and II is true. +0 and −0 compare equal (III), but 1/(+0) = +∞ and 1/(−0) = −∞, so IV is false.
More Digital Logic questions
- An 8-bit floating-point format has 1 sign bit, 5 exponent bits (bias 15) and 2 fraction bits, with IEEE-style denormals and exponent field…
- An 8-bit floating-point format has 1 sign bit, 5 exponent bits (bias 15) and 2 fraction bits, with IEEE 754-style normalised numbers. How…
- A signed Q4.4 fixed-point format stores x as the integer round(16x) in 8 bits. Two values A = −1.4375 (integer −23) and B = 0.4375…
- The double-dabble algorithm converts the 8-bit binary number 10110111 (183) to BCD. Before each of the 8 shifts, every BCD digit that is 5…
- A CRC-8 uses the generator polynomial x⁸ + x² + x + 1 (0x107), initial register value 0 and no final XOR. What is the CRC of the single…
- The Internet checksum (one's complement of the 16-bit one's complement sum) of the words 0xF0F0, 0x0F0F, 0x8001, 0xFFFF is 0x7FFE. Which…