Question

convert the following decimal values to IEEE 754 single precision. when converting the fractional part to...

convert the following decimal values to IEEE 754 single precision. when converting the fractional part to binary, stop when the total number of bits in the mantissa is 12. Give your answer in hex.

1. 48.0
2. 11.11
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Answer:

a)
Converting 48.0 to binary
   Convert decimal part first, then the fractional part
   > First convert 48 to binary
   Divide 48 successively by 2 until the quotient is 0
      > 48/2 = 24, remainder is 0
      > 24/2 = 12, remainder is 0
      > 12/2 = 6, remainder is 0
      > 6/2 = 3, remainder is 0
      > 3/2 = 1, remainder is 1
      > 1/2 = 0, remainder is 1
   Read remainders from the bottom to top as 110000
   so, 48.0 in binary is 110000.0
48.0 in simple binary => 110000.0
so, 48.0 in normal binary is 110000.0 => 1.1 * 2^5

single precision:
--------------------
sign bit is 0(+ve)
exp bits are (127+5=132) => 10000100
   Divide 132 successively by 2 until the quotient is 0
      > 132/2 = 66, remainder is 0
      > 66/2 = 33, remainder is 0
      > 33/2 = 16, remainder is 1
      > 16/2 = 8, remainder is 0
      > 8/2 = 4, remainder is 0
      > 4/2 = 2, remainder is 0
      > 2/2 = 1, remainder is 0
      > 1/2 = 0, remainder is 1
   Read remainders from the bottom to top as 10000100
   So, 132 of decimal is 10000100 in binary
frac bits are 10000000000000000000000

so, 48.0 in single-precision format is 0 10000100 10000000000000000000000
Converting 01000010010000000000000000000000 to hexadecimal
0100 => 4
0010 => 2
0100 => 4
0000 => 0
0000 => 0
0000 => 0
0000 => 0
0000 => 0
So, in hexadecimal 01000010010000000000000000000000 is 0x42400000
in hexadecimal it is 0x42400000
Answer: 0x42400000

b)
Converting 11.11 to binary
   Convert decimal part first, then the fractional part
   > First convert 11 to binary
   Divide 11 successively by 2 until the quotient is 0
      > 11/2 = 5, remainder is 1
      > 5/2 = 2, remainder is 1
      > 2/2 = 1, remainder is 0
      > 1/2 = 0, remainder is 1
   Read remainders from the bottom to top as 1011
   So, 11 of decimal is 1011 in binary
   > Now, Convert 0.11000000 to binary
      > Multiply 0.11000000 with 2.  Since 0.22000000 is < 1. then add 0 to result
      > Multiply 0.22000000 with 2.  Since 0.44000000 is < 1. then add 0 to result
      > Multiply 0.44000000 with 2.  Since 0.88000000 is < 1. then add 0 to result
      > Multiply 0.88000000 with 2.  Since 1.76000000 is >= 1. then add 1 to result
      > Multiply 0.76000000 with 2.  Since 1.52000000 is >= 1. then add 1 to result
      > Multiply 0.52000000 with 2.  Since 1.04000000 is >= 1. then add 1 to result
      > Multiply 0.04000000 with 2.  Since 0.08000000 is < 1. then add 0 to result
      > Multiply 0.08000000 with 2.  Since 0.16000000 is < 1. then add 0 to result
      > Multiply 0.16000000 with 2.  Since 0.32000000 is < 1. then add 0 to result
      > Multiply 0.32000000 with 2.  Since 0.64000000 is < 1. then add 0 to result
      > Multiply 0.64000000 with 2.  Since 1.28000000 is >= 1. then add 1 to result
      > Multiply 0.28000000 with 2.  Since 0.56000000 is < 1. then add 0 to result
   0.10999999999999943 of decimal is .000111000010 in binary
   so, 11.11 in binary is 1011.000111000010
11.11 in simple binary => 1011.000111000010
so, 11.11 in normal binary is 1011.000111000010 => 1.011000111000010 * 2^3

single precision:
--------------------
sign bit is 0(+ve)
exp bits are (127+3=130) => 10000010
   Divide 130 successively by 2 until the quotient is 0
      > 130/2 = 65, remainder is 0
      > 65/2 = 32, remainder is 1
      > 32/2 = 16, remainder is 0
      > 16/2 = 8, remainder is 0
      > 8/2 = 4, remainder is 0
      > 4/2 = 2, remainder is 0
      > 2/2 = 1, remainder is 0
      > 1/2 = 0, remainder is 1
   Read remainders from the bottom to top as 10000010
   So, 130 of decimal is 10000010 in binary
frac bits are 01100011100001000000000

so, 11.11 in single-precision format is 0 10000010 01100011100001000000000
Converting 01000001001100011100001000000000 to hexadecimal
0100 => 4
0001 => 1
0011 => 3
0001 => 1
1100 => C
0010 => 2
0000 => 0
0000 => 0
So, in hexadecimal 01000001001100011100001000000000 is 0x4131C200
Answer: 0x4131C200


Please let me know if you have any doubts Please upvote this answer. Thanks!!

Add a comment
Know the answer?
Add Answer to:
convert the following decimal values to IEEE 754 single precision. when converting the fractional part to...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
Active Questions
ADVERTISEMENT