...
Question 9843 – Digital-Logic-Design
February 13, 2024
Question 9864 – Digital-Logic-Design
February 13, 2024
Question 9843 – Digital-Logic-Design
February 13, 2024
Question 9864 – Digital-Logic-Design
February 13, 2024

Question 9845 – Digital-Logic-Design

Consider the values A = 2.0 x 1030, B = -2.0 x 1030, C = 1.0, and the sequence

             X: = A + B    Y: = A + C
             X: = X + C    Y: = Y + B  

executed on a computer where floating-point numbers are represented with 32 bits. The values for X and Y will be

Correct Answer: B

Question 48 Explanation: 
Given: 32 bits representation. So, the maximum precision can be 32 bits (In 32-bit IEEE representation, maximum precision is 24 bits but we take best case here). This means approximately 10 digits.

A = 2.0 * 1030, C = 1.0
So, A + C should make the 31st digit to 1, which is surely outside the precision level of A (it is 31st digit and not 31st bit). So, this addition will just return the value of A which will be assigned to Y.
So, Y + B will return 0.0 while X + C will return 1.0.
A
X = 1.0, Y = 1.0
B
X = 1.0, Y = 0.0
C
X = 0.0, Y = 1.0
D
X = 0.0, Y = 0.0
0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x
error: Alert: Content selection is disabled!!