1. Write the single-precision Representation for the following decimal number. (-0.625) or -5/8. Final Results must be in HEX. SHOW WORK PLEASE.
2. Given Hexadecimal 0x3F300000, convert it to decimal number if it is a single precision floating point number. SHOW WORK PLEASE.
Single precision format consists of 32 bits.
1 bit allocates for sign
8 bits for exponent.
23 bits for mantissa.
Sign (1 bits) | Exponent (8 bits) | Mantissa (23 bits) |
The decimal number = (-1)s*(1.M)*2E-127.
Where s is sign, M is mantissa, E is exponent.
1.
Givendecimal number = 0.625.
Convert decimal to binary = 0.101
Write it in single precision format = (1.01)*2-1
E-127 = -1 =====> E= -1+127 = 126.
Sign s= 0.
Exponent E = 126 = 01111110
Mantissa M = 01000000000000000000000.
0 | 01111110 | 01000000000000000000000 |
HEX format = 0x3F200000.
2.
Given Hexadecimal= 0x3F300000.
Convert into single precision format.
0 | 01111110 | 01100000000000000000000 |
Sign =0.
Exponent E=126.
Mantissa M = 01100000000000000000000.
Decimal number of the single precision format
(-1)0*(1.01100000000000000000000)*2126-127
(1.01100000000000000000000)*2-1
0.101100000000000000000000
0.6875
Get Answers For Free
Most questions answered within 1 hours.