Question

Given a single precision floating point number 8.0, what is the smallest precision floating point number...

Given a single precision floating point number 8.0, what is the smallest precision floating point number that is bigger than 8.0?

0 0
Add a comment Improve this question Transcribed image text
Answer #1
Answer:
----------
8.00000095367431640625

Explanation:
--------------
First, let's 8.0 to single-precision format binary
Converting 8.0 to binary
   Convert decimal part first, then the fractional part
   > First convert 8 to binary
   Divide 8 successively by 2 until the quotient 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 1000
   so, 8.0 in binary is 1000.0
8.0 in simple binary => 1000.0
so, 8.0 in normal binary is 1000.0 => 1. * 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 00000000000000000000000

so, 8.0 in single-precision format is 0 10000010 00000000000000000000000

now smallest number bigger than 8.0 in single-precision binary format is 0 10000010 00000000000000000000001

let's convert this back to decimal
0 10000010 00000000000000000000001
sign bit is 0(+ve)
exp bits are 10000010
   => 10000010
   => 1x2^7+0x2^6+0x2^5+0x2^4+0x2^3+0x2^2+1x2^1+0x2^0
   => 1x128+0x64+0x32+0x16+0x8+0x4+1x2+0x1
   => 128+0+0+0+0+0+2+0
   => 130
in decimal it is 130
so, exponent/bias is 130-127 = 3
frac bits are 00000000000000000000001

IEEE-754 Decimal value is 1.frac * 2^exponent
IEEE-754 Decimal value is 1.00000000000000000000001 * 2^3
1.00000000000000000000001 in decimal is 1.0000001192092896
   => 1.00000000000000000000001
   => 1x2^0+0x2^-1+0x2^-2+0x2^-3+0x2^-4+0x2^-5+0x2^-6+0x2^-7+0x2^-8+0x2^-9+0x2^-10+0x2^-11+0x2^-12+0x2^-13+0x2^-14+0x2^-15+0x2^-16+0x2^-17+0x2^-18+0x2^-19+0x2^-20+0x2^-21+0x2^-22+1x2^-23
   => 1x1+0x0.5+0x0.25+0x0.125+0x0.0625+0x0.03125+0x0.015625+0x0.0078125+0x0.00390625+0x0.001953125+0x0.0009765625+0x0.00048828125+0x0.000244140625+0x0.0001220703125+0x6.103515625e-05+0x3.0517578125e-05+0x1.52587890625e-05+0x7.62939453125e-06+0x3.814697265625e-06+0x1.9073486328125e-06+0x9.5367431640625e-07+0x4.76837158203125e-07+0x2.384185791015625e-07+1x0.00000011920928955078125
   => 1+0.0+0.0+0.0+0.0+0.0+0.0+0.0+0.0+0.0+0.0+0.0+0.0+0.0+0.0+0.0+0.0+0.0+0.0+0.0+0.0+0.0+0.0+0.00000011920928955078125
   => 1.00000011920928955078125
so, 1.00000011920928955078125 * 2^3 in decimal is 8.000000953674316
so, 01000001000000000000000000000001 in IEEE-754 single precision format is 8.00000095367431640625
Answer: 8.00000095367431640625
Add a comment
Know the answer?
Add Answer to:
Given a single precision floating point number 8.0, what is the smallest precision floating point number...
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