the mantissa and the exponent is what makes up a floating point number.
the rules:
between the decimal point it has to be 0 then 1 or 1 then 0
it is always in two's compliment
the higher the mantissa the better average the value has
the higher the exponent the higher the range will be.
how to work one out
Example of a 7 bit mantissa and 5 bit mantissa
50 as a 7 bit would be 0110010
then find how many places you would have to go to find a place with 0 then 1 which is one decimal place so it will look like this
0.110010
this is the mantissa, to get the exponent you get the number of decimal places into 4 bit exponent
1 decimal place in 4 bit = 0001
the floating point number of 50 is 0.110010 0001
if it was a negative denary number you would have to make sure that instead of a 0 then a 1 its a 1 then a 0.
how to work from a floating point number to denary
example 0.100101 0100
the exponent will tell us how many decimal places we move, if it is positive then the place moves to the right, if it is negative then the place moves to the left.
0100 is 4 decimal places to the right
the mantissa will now look like this 01001.01
you now solve this is a normal binary to denary
this will be 8 + 1 + 0.25 which will = 9.25
the floating point number of 0.100101 0100 is 9.25 s a denary value
No comments:
Post a Comment