Reputation: 1122
if we have 10 bits floating point . 4 bits=exponent and 5 bits are the fraction. how to calculate the bias?
is it 2^4=16-1= 15 ?
is that correct?
Upvotes: 2
Views: 13530
Reputation: 5389
The 10 bits are being used for mantissa so basically the range of binary number that can appear in mantissa position lies between 000000000000 (10 zeros) and 1111111111 (10 ones) but since the floating point number is signed the maximum mod value of the number can be 111111111 (9 ones) So the range of mantissa will be -511 to +511
As for the bias, it will be maximum mod value of the mantissa. Thus, here the bias is 511. By adding 511 to the range of mantissa it is shifted to the range between 0 and 1022.
Upvotes: 0
Reputation: 62048
I'd expect it to be 2number of bits in exponent - 1 - 1 (or 7 here), as is the case with more common IEEE-754 formats. Check Wikipedia.
Upvotes: 7