Show the IEEE 754 binary representation for the following floating-point numbers
ID: 3878807 • Letter: S
Question
Show the IEEE 754 binary representation for the following floating-point numbers in single and double precision. Give your results in hexadecimal format. State so if there is overflow or underflow.
I don't undertand the process and would like it explained as well as the answer if possible.
Problem 4 (20 points) Show the IEEE 754 binary representation for the following floating-point numbers in single and double precision. Give your results in hexadecimal format. State so if there is overflow or underflow. 1) 19 ten 2) -7/6 ten. 3) 0.3 ten- 4) 63.50 ten.Explanation / Answer
The first step is to convert the number to binary. Then we represent the binary number in the form a.b*10e . Here e is the exponent b is the mantissa and a's value is always 1. For example, 19 in binary is 10011. We can write it as 1.0011*104 . Thus mantissa is 0011 and exponent is 4
(Single floating point representation : It is 32 bit - b0 to b31. b31 is the sign bit (1 negative). b23-b30 (8 bits) is the exponent and b0-b22 (23 bits) is the mantissa. Now 127 is added to the exponent so that all exponent values are always positive as exponent varies from(-127 to 128). Thus for 19, exponent would be 4+127 = 131=10000011(in binary) . mantissa is 0011 and sign bit is 0.
The the single precision representation is : 0 10000011 00110000000000000000000 = 0x41980000
Double precision: Here the proces is the same. The only difference is that it is 64 bit. b63 is the sign bit. b62-b52 is the exponent and b51-b0 is the mantissa. Also in this case we add 1023 to the exponent before representing it.
19 =
0x4033000000000000(in hexadecimal)
2) -7/6 = -1.66666666.. = -1.1010101010...(in binary)
single precision representation: 0xbfd55555
double precision: 0xBFFAAAAAAAAAAAAC
There is an overflow here as -7/6 = -1.6666666.. is a non termination decimal
3) 0.3 = 0.01001100110011001101...(in binary)
Single preciison: 0x3c24052f
Double precision: 0x7FFFFFFFFFFFFFFF
Here also there is an overflow as it is a non terminating decimal
4)63.5 = 111111.1
Single precision: 0x47d9038d
Double precision: 0x40FB20719999999A
0 10000000011 0011000000000000000000000000000000000000000000000000 =Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.