Floating Point Number representation
* The location of the fractional point is not fixed to a certain location
* The range of the representable numbers is wide
F = EM
mn ekek-1 ... e0 mn-1mn-2 … m0 . m-1 … m-m
sign exponent mantissa
- Mantissa
Signed fixed point number, either an integer or a fractional number
- Exponent
Designates the position of the radix point
Decimal Value
V(F) = V(M) * RV(E) M: Mantissa
E: Exponent
R: Radix
Floating Point Number Representation
Example sign sign
0 .1234567 0 04
mantissa exponent
==> +.1234567 x 10+04
Note:
In Floating Point Number representation, only Mantissa(M) and
Exponent(E) are explicitly represented. The Radix(R) and the position
of the Radix Point are implied.
Example
A binary number +1001.11 in 16-bit floating point number representation
(6-bit exponent and 10-bit fractional mantissa)
0 0 00100 100111000
Sign Exponent Mantissa
or
0 0 00101 010011100
Normal Form
- There are many different floating point number representations of
the same number
→ Need for a unified representation in a given computer
- the most significant position of the mantissa contains a non-zero digit
IEEE-754 Floating Point Formats
Biased Exponent
All negative exponent are represented with a +ve Quantity by
adding a bias value
Single Precision
Bias Value = +127
Double Precision
Bias Value = +1023
Advantage: Exponents contain only +ve value.
Simple to compare the magnitudes.
Mantissa
Sign bit exponent or Significiand
IEEE-754 Conversion Example
Represent -12.62510 in single precision IEEE-754 format.
• Step #1: Convert to target base. -12.62510 -1100.1012
• Step #2: Normalize. -1100.1012 = -1.1001012 × 23
• Step #3: Fill in bit fields. Sign is negative, so sign bit is 1.
Exponent is in excess 127 (not excess 128!), so exponent is
represented as them unsigned integer
3 + 127 = 130. Leading 1 of significant is hidden, so
final bit pattern is: -1.1001012 × 23+127
1 1000 0010 . 1001 0100 0000 0000 0000 000
Problems
• Represent 178.1875 and 0.0625 in single precision and
double precision.
• Represent the decimal number 2345.12510 in IEEE 754
32 bit single precision format.
• Represent - 67 in sign magnitude, 1’s complement and 2’s
complement form.
References
• Morris Mano “ Computer Architecture”
• William Stallings “Computer Organization and
architecture”, Prentice Hall, 7th edition, 2006.
Prepared by Dr.I. Mala Serene, SITE,VIT University