Positive floating point numbers using one byte
Positive binary floating-point number representation using one byte
We will now look at some examples of binary floating-point numbers. Remember three things:
- Both the mantissa and exponent are ALWAYS 2s complement numbers.
- The decimal point is there in the mantissa, but not actually represented using a bit.
- The decimal point ALWAYS goes between the first two left hand digits!
In our one byte, we will use 5 bits for the mantissa and 3 for the exponent.
Example 7. Convert this binary floating-point number into decimal: 01101010
- Write down the mantissa. It’s 01101
- Insert the decimal point between the first 2 digits. That gives us 0.1101
- This is a positive normalised number because the left-most 2 bits are 01.
- The exponent is 010
- This is positive because the left-most bit is a zero.
- The exponent equals the denary value +2.
- We must move the decimal point in the mantissa 2 places to the right. We go from 0.1101 to 011.01
- This is a fixed-point binary number. The digits on the left of the decimal point give us the whole number part whilst the digits on the right give us the fraction part. Removing redundant zeros, we get 11.01
- Converting this fixed-point binary number into a denary number gives us 3.25
Example 8. Convert this binary floating-point number into decimal: 01010101
Please register to read more ......