Forums: » Register « |  Free Tools |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support |

New Free Tools on Dev Shed!

#1
September 28th, 2013, 04:22 AM
 kathy025
Registered User

Join Date: Jul 2013
Location: Manila, Philippines
Posts: 24
Time spent in forums: 7 h 43 m 34 sec
Reputation Power: 0
Decimal to IEEE 754

I have found this video:
Code:
`http://www.youtube.com/watch?v=MIrQtuoT5Ak`

Around mark 2:01-2:04, the mantissa was converted to 1.1010011 x 2^3, but for the mantissa,﻿ only the fraction part was taken, which is 1010011.

What happened to the integer 1? Why was it dropped?

#2
September 28th, 2013, 10:30 AM
 Jacques1
You have been warned

Join Date: Jul 2012
Posts: 3,106
Time spent in forums: 2 Months 3 Weeks 4 Days 13 h 46 m 13 sec
Reputation Power: 1063
Because the mantissa of normal numbers always starts with a 1. Storing it would waste one bit and reduce the range of possible numbers.

#3
September 28th, 2013, 08:58 PM
 kathy025
Registered User

Join Date: Jul 2013
Location: Manila, Philippines
Posts: 24
Time spent in forums: 7 h 43 m 34 sec
Reputation Power: 0
Quote:
 Originally Posted by Jacques1 Because the mantissa of normal numbers always starts with a 1. Storing it would waste one bit and reduce the range of possible numbers.
Thank you for that.

So, we have this homework:
(-128.4875) base 10 to Single-Precision IEEE 754

Following the video tutorial, I did the following:

Converting (128.4875) base 10 to BINARY is:
1000 0000 . 0111 1100 1100 1100 1100...

The SCIENTIFIC NOTATION of the binary is:
1 . 0000 0000 1111 1001 1001 1001... x 2^7

The SIGN BIT is:
1 (1 bit)

The MANTISSA is:
0000 0000 1111 1001 1001 100 (23 bits)

The EXPONENT is:
7 + 127 = (134) base 10 = 1000 0110 (8 bits)

Checking my answer against an online converter:
Code:
`http://s17.postimg.org/3pkw9glm7/mantissa.png`
I got everything, BUT the last digit of the mantissa. What I did was I took the first 23 digits after the point in the scientific notation.

I got a 0 where the converter got a 1. Why is this so?

 Viewing: Dev Shed Forums > Other > Beginner Programming > Decimal to IEEE 754