Redirected
edited by
10,340 views
10 votes
10 votes

Consider the $\textsf{IEEE-754}$ single precision floating point numbers $\text{P} = \textsf{0xC1800000}$ and $\text{Q} = \textsf{0x3F5C2EF4}.$

Which one of the following corresponds to the product of these numbers $(\text{i.e., P} \times \mathrm{Q} ),$ represented in the $\textsf{IEEE-754}$ single precision format?

  1. $\textsf{0x404C2EF4}$
  2. $\textsf{0x405C2EF4}$
  3. $\textsf{0xC15C2EF4}$
  4. $\textsf{0xC14C2EF4}$
edited by

2 Answers

15 votes
15 votes

P = 0xC1800000 = 1100 0001 1000 0000 0000 0000 0000 0000 

IEEE 754 Single Precision Format (32-bit) – 

 Sign (1 bit) Biased Exponent (8 bits) Mantissa (23 bits)
1 10000011 0000 0000 0000 0000 0000 000

Biased Exponent = 131 

Actual Exponent = Biased Exponent  – Bias ($2^{8-1} - 1$)  = 131 -127 = 4

Mantissa = 0000 0000 0000 0000 0000 000

Actual Number = 1.00000000000000000000000 * $2^{4}$ = 16 (It is negative 16 because sign bit is 1)

 

Q = 0x3F5C2EF4 = 0011 1111 0101 1100 0010 1110 1111 0100 

Sign = 0 (Positive),

Biased Exponent = 01111110 = 126 

Actual Exponent = 126-127 =  $2^{-1}$ 

Mantissa = 1011100 0010 1110 1111 0100

 

P * Q = 1.0000 * 1.1011100 0010 1110 1111 0100 * $2^{4}$ *  $2^{-1}$  = 1.10111000010111011110100 * $2^{3}$  

Representing back to IEEE 754

Sign Bit = 1

Biased Exponent = 127+3 = 130 = 10000010 

Mantissa: 1011 1000 0101 1101 1110 100

1 1000 0010 1011 1000 0101 1101 1110 100

= 1100 0001 0101 1100 0010 1110 1111 0100 = C15C2EF4

Answer:

Related questions

12 votes
12 votes
4 answers
3