Machine-translated by Google. Questions are authored in English.
Top

Discussion

Consider the real valued variables X, Y and Z represented using the IEEE 754 single-precision floating-point format. The binary representations of X and Y in hexadecimal notation are as follows:

X: 35C00000   Y: 34A00000

Let Z = X + Y.

Which one of the following is the binary representation of Z, in hexadecimal notation?

  • A.35C80000
  • B.35CC0000
  • C.35E80000
  • D.35EC0000

Answer: C

Z is 35E80000.

Decode the two operands (sign, 8-bit biased exponent, 23-bit fraction):

\[ \begin{aligned} X &= 0\ 01101011\ 1000\ldots \\ &= 1.1_{2} \times 2^{107-127} = 1.5 \times 2^{-20} \\ Y &= 0\ 01101001\ 0100\ldots \\ &= 1.01_{2} \times 2^{105-127} = 1.25 \times 2^{-22} \end{aligned} \]

Align Y to X's exponent and add:

\[ \begin{aligned} Y &= 0.3125 \times 2^{-20} \\ Z &= 1.8125 \times 2^{-20} = 1.1101_{2} \times 2^{-20} \end{aligned} \]

The exponent field stays 107 = 01101011 and the fraction is 1101 followed by zeros, so Z = 0 01101011 1101 000... = 0011 0101 1110 1000 0000... = 35E80000.

With the same exponent field, the other options decode to different significands: 35C80000 is \(1.5625 \times 2^{-20}\), 35CC0000 is \(1.59375 \times 2^{-20}\) and 35EC0000 is \(1.84375 \times 2^{-20}\), none equal to the sum.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.