Floating point number representation
Floating point number representation
D D D D
Memory with 8 locations (words)
D D D D
with each location made of 4
D D D D
flip flops (bits).
D D D D
D D D D
8 X 4 Memory (8 locations with 4
D D D D words/location)
D D D D
D D D D
Floating point number representation
A flip flop can store only a bit which is 0 or 1.
So, to store the sign of the number we use the
Sign bit.
How to store real numbers (floating point
numbers) with integer and fractional parts
separated by a period?
12.34
Floating point number representation
There is a standard of representing floating point
numbers.
12.34 is represented as +1.234 X 101.
1.234 is written as +1.234 X 100.
How would you write the following numbers using
the above standard?
1) 0.01234
2) 123.4
3) 0.001234
Floating point number representation
1) 0.01234 = +1.234 X 10-2.
2) 123.4 = +1.234 X 102.
3) 0.001234 = +1.234 X 10-3.
How can 1234 represented using the above
standard?
1234 =
Floating point number representation
+1.234 X 10-2 has 2 parts: 1) Mantissa & 2)
Exponent
Which part in the above number is mantissa &
which is exponent.
Mantissa =
Exponent =
Floating point number representation
+1.234 X 10-2 has 2 parts: 1) Mantissa & 2)
Exponent
Which part in the above number is mantissa &
which is exponent.
Mantissa = 234
Exponent = -2
Floating point number representation
How to write +18.765 in Scientific notation.
+18.765 = +1.8765 X 101.
Note: When the decimal point moves to the left,
the exponent is +ve.
+1.8765 X 101 2 parts: 1) Mantissa & 2) Exponent
Which part in the above number is mantissa &
which is exponent.
Mantissa = 0.8765
Exponent = +1
Floating point number representation
How to write +0.18765 in Scientific notation.
+18.765 = +1.8765 X 10-1.
Note: When the decimal point moves to the right,
the exponent is -ve.
+1.8765 X 10-1 2 parts: 1) Mantissa & 2) Exponent
Which part in the above number is mantissa &
which is exponent.
Mantissa = 0.8765
Exponent = -1
Floating point number representation
How are floating point binary numbers
represented?
The method is slightly different with 32 bits for
single precision floating number.
S eeeeeeee mmmmmmmm mmmmmmmm
mmmmmmm
= First S is the sign of the exponent
Next 8 e are the exponent bits
Next 23 m are the mantissa bits
Floating point number representation
How is 4.5(10) represented in floating point
representation?
Floating point number representation
4.5(10) = 100.1(2)
1) This binary number is to be normalized first.
After normalization,
100.1(2) = 1.001(2) X 22.
Floating point number representation
Similarly when the number
0.000000001101(2) x 23 is normalized, it appears as
1.101(2) x 2-6
How would the number 0.00100101(2) be written
in normalized form?
Floating point number representation
How would the number 0.00100101(2) be written
in normalized form?
0.00100101(2) would be written as
1.00101 (2) X 2-3.
Floating point number representation
How would the number 110.11101(2) be written in
normalized form?
110.11101(2) would be written as
Floating point number representation
How would the number 110.11101(2) be written in
normalized form?
110.11101(2) would be written as
1.1011101 (2) X 22.
Floating point number representation
Step 1: is to normalize.
1.1011101 (2) X 22 is positive.
Hence, it can be written as (-1)0 as exponent 0 represents +ve number.
For a –ve number, (-1)1 would represent the –ve number. (exponent 1 represents -ve number. )
Step 2: Find the mantissa. To find the mantissa, we omit the integer 1.
Example:
In 1.1011101 (2) X 22 ,the mantissa is 1011101(2).
Make this mantissa as 23 bit number.
10111010000000000000000 by adding necessary 0s at the end.
For a –ve number, (-1)1 would represent the –ve number. (exponent 1 represents -ve number. )
Step 2: Find the mantissa. To find the mantissa, we omit the integer 1.
Example:
In 1.00101(2) X 23, the mantissa is 00101(2).
Make this mantissa as 23 bit number.
00101000000000000000000 by adding necessary 0s at the end.