For Part A, you must do the calculations by hand, but you may want to verify if
ID: 3781586 • Letter: F
Question
For Part A, you must do the calculations by hand, but you may want to verify if your solution is correct using MATLAB's format hex command. Convert 0.625 into a single-precision IEEE 754 floating-point number and express the results in hex form. Convert 0.625 into a double-precision IEEE 754 floating-point number and express the results in hex form. Convert -1.0 into a single-precision IEEE 754 floating-point number and express the results in hex form. Obtain the hex digits for the 32-bit, 2s complement integer for -1. You do not have to work out this conversion by hand, you can use MATLAB's int32 function and format hex command. Why are the hex digits of (a) and (b) different? Convert the IEEE 754 floating point number BD800000 into a decimal number.Explanation / Answer
1. To convert a number to single-precision IEEE 754 floating point number, sign, exponent and mantissa while repesenting the number in scientific notation should be determined.
This can be determined by taking the 1's position digit by using repeated multiplication of decimal position by 2.
0.625 * 2 = 1.25 -> 1
0.25 * 2 = 0.5 -> 0
0.5 * 2 = 1.0 -> 1
0 01111110 01000000000000000000000
for converting this to hexadecimal, we have to make groups of 4 starting from right end.
0011 1111 0010 0000 0000 0000 0000 0000
2. Convertion of 0.625 to double precision floating point is similar to single-precision floating point. But here the bias used is 1023, number of bits for exponent is 11 and number of bits for representing mantissa is 52.
0 011,1111,1110, 0100,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000
converting this to hexadecimal will give final result 0x3fe4000000000000
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.