GATE CS 2022 Q31 — Number Representations (Fixed and Floating Point)
Explain with AI
Consider three floating point numbers A, B and C stored in registers RA,RB and RC, respectively as per IEEE-754 single precision floating point format. The 32-bit content stored in these registers (in hexadecimal form) are as follows.
RA=0xC1400000RB=0x42100000RC=0x41400000
Which one of the following is FALSE?
View worked solutionShowHide
Answer: B
To find the values of A, B, and C, we decode their 32-bit IEEE-754 single-precision representation: Value=(−1)S×(1+M)×2E−127.
For RA=0xC1400000:
Binary: S1E10000010M10000000000000000000000
S=1 (negative), E=13010, and M=0.510
A=−1×(1+0.5)×2130−127=−1.5×8=−12
For RB=0x42100000:
Binary: S0E10000100M00100000000000000000000
S=0 (positive), E=13210, and M=2−3=0.12510
B=+1×(1+0.125)×2132−127=1.125×32=36
For RC=0x41400000:
Binary: S0E10000010M10000000000000000000000
S=0 (positive), E=13010, and M=0.510
C=+1×(1+0.5)×2130−127=1.5×8=12
Now, let's evaluate the options:
(A)A+C=−12+12=0 (True)
(B)C=A+B⟹12=−12+36=24 (False)
(C)B=3C⟹36=3×12 (True)
(D)(B−C)>0⟹36−12=24>0 (True)
Free practice · Your answers on this page are not saved.