Fixed and Floating Point Numbers: Dr. Ashish GUPTA Sense, Vit-Ap Ashish - Gupta@vitap - Ac.in
Fixed and Floating Point Numbers: Dr. Ashish GUPTA Sense, Vit-Ap Ashish - Gupta@vitap - Ac.in
1 bit
sign 8 bits exponent 23 bits mantissa
1 2 910
32
IEEE Floating Point Representation
So what is the range of the exponent that can be represented in 8 bit biased exponent field ???
+128 to -127
Try It Yourself
2-10
28
(Answers on next slide)
Answers
2-10
exponent -10 8-bit
bias +127 value
117 🡪 01110101
28
exponent 8 8-bit
bias +127 value
135 🡪 10000111
IEEE Floating Point Representation
Step 1.
Compute the binary equivalent of the whole part and the fractional
part. (i.e. convert 40 and .15625 to their binary equivalents)
Decimal Floating Point to IEEE standard Conversion
40 .15625
- 32 Result: -.12500 Result:
8 101000 .03125 .00101
- 8 -.03125
0 .0
101000.00101 = 1.0100000101 x 25
Decimal Floating Point to IEEE standard Conversion
127 + 5 = 132
13210 = 100001002
Decimal Floating Point to IEEE standard Conversion
0 10000100 01000001010000000000000
Find the IEEE FP representation of 40.15625
40.1562510 = 101000.001012
101000.00101 = 1.0100000101 x 25
127 + 5 = 132
13210 = 100001002
1 bit
sign 8 bits exponent 23 bits mantissa
1 2 9 10
32
0 10000100 01000001010000000000000
Decimal Floating Point to IEEE standard Conversion
24 .75
- 16 Result: - .50 Result:
8 11000 .25 .11
- 8 - .25
0 .0
So: -24.7510 = -11000.112
Decimal Floating Point to IEEE standard Conversion
Step 2.
Normalize the number by moving the decimal
point to the right of the leftmost one.
-11000.11 = -1.100011 x 24
Decimal Floating Point to IEEE standard Conversion
1 01111101 010.00
IEEE standard to Decimal Floating Point Conversion
Exponent
s Mantissa x 2
(-1) 1 . ____________ ----
= -0.312510
IEEE standard to Decimal Floating Point Conversion.
1.10011 x 2 4
IEEE standard to Decimal Floating Point Conversion..
= 25.510
Examples
Express following number X= (-16.2)8 in 32 bit IEEE
hexadecimal notation
In IEEE floating point representation, the hexadecimal number
C0000000 corresponds to
(A) -3.0
(B) -1.0
(C) -4.0
(D) -2.0