Question

Convert the decimal 0.2 to hexadecimal representation using IEEE 754 single precision format

Convert the decimal 0.2 to hexadecimal representation using IEEE 754 single precision format

0 0
Add a comment Improve this question Transcribed image text
Answer #1
Converting 0.20000000 to binary
      > Multiply 0.20000000 with 2.  Since 0.40000000 is < 1. then add 0 to result
      > Multiply 0.40000000 with 2.  Since 0.80000000 is < 1. then add 0 to result
      > Multiply 0.80000000 with 2.  Since 1.60000000 is >= 1. then add 1 to result
      > Multiply 0.60000000 with 2.  Since 1.20000000 is >= 1. then add 1 to result
      > Multiply 0.20000000 with 2.  Since 0.40000000 is < 1. then add 0 to result
      > Multiply 0.40000000 with 2.  Since 0.80000000 is < 1. then add 0 to result
      > Multiply 0.80000000 with 2.  Since 1.60000000 is >= 1. then add 1 to result
      > Multiply 0.60000000 with 2.  Since 1.20000000 is >= 1. then add 1 to result
      > Multiply 0.20000000 with 2.  Since 0.40000000 is < 1. then add 0 to result
      > Multiply 0.40000000 with 2.  Since 0.80000000 is < 1. then add 0 to result
      > Multiply 0.80000000 with 2.  Since 1.60000000 is >= 1. then add 1 to result
      > Multiply 0.60000000 with 2.  Since 1.20000000 is >= 1. then add 1 to result
      > Multiply 0.20000000 with 2.  Since 0.40000000 is < 1. then add 0 to result
      > Multiply 0.40000000 with 2.  Since 0.80000000 is < 1. then add 0 to result
      > Multiply 0.80000000 with 2.  Since 1.60000000 is >= 1. then add 1 to result
      > Multiply 0.60000000 with 2.  Since 1.20000000 is >= 1. then add 1 to result
      > Multiply 0.20000000 with 2.  Since 0.40000000 is < 1. then add 0 to result
      > Multiply 0.40000000 with 2.  Since 0.80000000 is < 1. then add 0 to result
      > Multiply 0.80000000 with 2.  Since 1.60000000 is >= 1. then add 1 to result
      > Multiply 0.60000000 with 2.  Since 1.20000000 is >= 1. then add 1 to result
      > Multiply 0.20000000 with 2.  Since 0.40000000 is < 1. then add 0 to result
      > Multiply 0.40000000 with 2.  Since 0.80000000 is < 1. then add 0 to result
      > Multiply 0.80000000 with 2.  Since 1.60000000 is >= 1. then add 1 to result
   so, 0.2 in binary is 0.001100110011001100110011
0.2 in simple binary => 0.001100110011001100110011
so, 0.2 in normal binary is 0.001100110011001100110011 => 1.100110011001100110011 * 2^-3

single precision:
--------------------
sign bit is 0(+ve)
exp bits are (127-3=124) => 01111100
   Divide 124 successively by 2 until the quotient is 0
      > 124/2 = 62, remainder is 0
      > 62/2 = 31, remainder is 0
      > 31/2 = 15, remainder is 1
      > 15/2 = 7, remainder is 1
      > 7/2 = 3, remainder is 1
      > 3/2 = 1, remainder is 1
      > 1/2 = 0, remainder is 1
   Read remainders from the bottom to top as 1111100
   So, 124 of decimal is 1111100 in binary
frac bits are 10011001100110011001100

so, 0.2 in single-precision format is 0 01111100 10011001100110011001100
in hexadecimal it is 0x3E4CCCCC
Add a comment
Know the answer?
Add Answer to:
Convert the decimal 0.2 to hexadecimal representation using IEEE 754 single precision format
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
ADVERTISEMENT