In addition to the default IEEE doubleprecision formal 8 byt
In addition to the default IEEE double-precision formal (8 bytes, 64 bits) to store floating-point numbers, MATLAB can also store the numbers in single-precision forma! (4 bytes, 32 bits). Each value is stored in 4 bytes with 1 bit for the sign, 23 bits for the mantissa, and 8 bits for the signed exponent: Determine the value (expressed in base 10 number) of the following single precision floating point number which is represented in IEEE format, (show your work)
Solution
The value of a IEEE number is computed as:
sign * 2exponent * mantissa
Sign bit = 1 so sign is negetive.
The exponent can be computed from bits 24-31 by subtracting 127.
So exponent bits = 011111102 = 12610
exponent = 126-127 = -1
The mantissa is stored in bits 1-23. Bit 23 has a value of 1/2, bit 22 has value 1/4 etc.
so mantissa bit = 110110000000000000000002 = 1/2+1/4+1/16+1/32 = 0.8437510
An invisible leading bit (i.e. it is not actually stored) with value 1.0 is placed in front
so 0.84375 +1 = 1.84375
so decimal value = sign * 2exponent * mantissa = -1 * 2-1 *1.84375 = -0.92187510
