Consider the following 8-bit (yes, 8-bit, not 8-byte) floating point representation based on the IEEE floating point format.
Format A:
There is one sign bit.
There are k=3 exponent bits.
There are n=4 fraction bits.Format B:
There is one sign bit.
There are k=4 exponent bits.
There are n=3 fraction bits.Below, you are given some bit patterns of pattern A. Your task is to find out the values of numbers given by format A and also convert them to the closest value in format B.
Format A Format B Bits Value Bits 1 010 1000 1 110 0000 0 101 1010 0 000 1001
This is homework... I don't want the assignment done for me. I just want to learn on how to convert. Floating point gets me extremely confused.
Can someone just please make up a "Format A" and show me how to get the value/convert step-by-step?
2**(k-p-1)-1
, where k is the number of bits, and p is the number of precision bits, one more than the number of stored fraction bits. That is,k-p-1
is N-1, where N is the number of exponent bits. For three exponent bits, that suggests bias and emax both 3.