1-5 Floating point Representation
Floating Point Numbers
A real number or floating point number is a
number which has both an integer and fractional part. Examples for real real
decimal numbers are 123.45, 0.1234, -0.12345, etc. Examples for a real
binary numbers are 1100.1100, 0.1001, -1.001, etc. In general, floating
point numbers are expressed in exponential notation.
For example the decimal number 30000.0
can be written as 3 x 104 , 312.45 can be written as
3.1245 x 102.
Similarly, the binary number 1010.001
can be written as 1.010001 x 103.
The general form of a number N can b
N = ± m x b±e
Where m is mantissa, b is
the base of number system and e is the exponent. A floating point number is
represented by two parts. The first part, called mantissa, of the number is
a signed fixed point number and the second part, called exponent, specifies
the decimal or binary position.
Binary Representation of Floating Point
A floating point binary number is also
represented as in the case of decimal numbers. That's means the mantissa and
exponent are expressed using signed magnitude notation in which one bit is
reserved for sign bit.
Consider a 16-bit word is used to store
the floating point numbers, Assume that the 9 bits are reserved for mantissa
and 7-bits for exponent and also assume that the mantissa part is
represented in fraction system. That implies, the assumed binary point is
immediate right of sign bit of mantissa.
A binary number 1101.01 is represented as
Mantissa = 110101
= 0.110101 X 24
Exponent = (4)10
Expand mantissa to
8 bits we get , 11010100
representation of exponent (4)10