Question

In: Computer Science

convert -47.199 to IEEE-754 single precision and double precision both. Need a lot of explanation. (Atleast...

convert -47.199 to IEEE-754 single precision and double precision both.
Need a lot of explanation. (Atleast 1000 words)

Solutions

Expert Solution

1)
-47.199
Converting 47.199 to binary
   Convert decimal part first, then the fractional part
   > First convert 47 to binary
   Divide 47 successively by 2 until the quotient is 0
       > 47/2 = 23, remainder is 1
       > 23/2 = 11, remainder is 1
       > 11/2 = 5, remainder is 1
       > 5/2 = 2, remainder is 1
       > 2/2 = 1, remainder is 0
       > 1/2 = 0, remainder is 1
   Read remainders from the bottom to top as 101111
   So, 47 of decimal is 101111 in binary
   > Now, Convert 0.19900000 to binary
       > Multiply 0.19900000 with 2.    Since 0.39800000 is < 1. then add 0 to result
       > Multiply 0.39800000 with 2.    Since 0.79600000 is < 1. then add 0 to result
       > Multiply 0.79600000 with 2.    Since 1.59200000 is >= 1. then add 1 to result
       > Multiply 0.59200000 with 2.    Since 1.18400000 is >= 1. then add 1 to result
       > Multiply 0.18400000 with 2.    Since 0.36800000 is < 1. then add 0 to result
       > Multiply 0.36800000 with 2.    Since 0.73600000 is < 1. then add 0 to result
       > Multiply 0.73600000 with 2.    Since 1.47200000 is >= 1. then add 1 to result
       > Multiply 0.47200000 with 2.    Since 0.94400000 is < 1. then add 0 to result
       > Multiply 0.94400000 with 2.    Since 1.88800000 is >= 1. then add 1 to result
       > Multiply 0.88800000 with 2.    Since 1.77600000 is >= 1. then add 1 to result
       > Multiply 0.77600000 with 2.    Since 1.55200000 is >= 1. then add 1 to result
       > Multiply 0.55200000 with 2.    Since 1.10400000 is >= 1. then add 1 to result
       > Multiply 0.10400000 with 2.    Since 0.20800000 is < 1. then add 0 to result
       > Multiply 0.20800000 with 2.    Since 0.41600000 is < 1. then add 0 to result
       > Multiply 0.41600000 with 2.    Since 0.83200000 is < 1. then add 0 to result
       > Multiply 0.83200000 with 2.    Since 1.66400000 is >= 1. then add 1 to result
       > Multiply 0.66400000 with 2.    Since 1.32800000 is >= 1. then add 1 to result
       > Multiply 0.32800000 with 2.    Since 0.65600000 is < 1. then add 0 to result
       > Multiply 0.65600000 with 2.    Since 1.31200000 is >= 1. then add 1 to result
       > Multiply 0.31200000 with 2.    Since 0.62400000 is < 1. then add 0 to result
       > Multiply 0.62400000 with 2.    Since 1.24800000 is >= 1. then add 1 to result
       > Multiply 0.24800000 with 2.    Since 0.49599999 is < 1. then add 0 to result
       > Multiply 0.49599999 with 2.    Since 0.99199998 is < 1. then add 0 to result
       > Multiply 0.99199998 with 2.    Since 1.98399997 is >= 1. then add 1 to result
       > Multiply 0.98399997 with 2.    Since 1.96799994 is >= 1. then add 1 to result
       > Multiply 0.96799994 with 2.    Since 1.93599987 is >= 1. then add 1 to result
       > Multiply 0.93599987 with 2.    Since 1.87199974 is >= 1. then add 1 to result
       > Multiply 0.87199974 with 2.    Since 1.74399948 is >= 1. then add 1 to result
       > Multiply 0.74399948 with 2.    Since 1.48799896 is >= 1. then add 1 to result
       > Multiply 0.48799896 with 2.    Since 0.97599792 is < 1. then add 0 to result
       > Multiply 0.97599792 with 2.    Since 1.95199585 is >= 1. then add 1 to result
       > Multiply 0.95199585 with 2.    Since 1.90399170 is >= 1. then add 1 to result
       > Multiply 0.90399170 with 2.    Since 1.80798340 is >= 1. then add 1 to result
       > Multiply 0.80798340 with 2.    Since 1.61596680 is >= 1. then add 1 to result
       > Multiply 0.61596680 with 2.    Since 1.23193359 is >= 1. then add 1 to result
       > Multiply 0.23193359 with 2.    Since 0.46386719 is < 1. then add 0 to result
       > Multiply 0.46386719 with 2.    Since 0.92773438 is < 1. then add 0 to result
       > Multiply 0.92773438 with 2.    Since 1.85546875 is >= 1. then add 1 to result
       > Multiply 0.85546875 with 2.    Since 1.71093750 is >= 1. then add 1 to result
       > Multiply 0.71093750 with 2.    Since 1.42187500 is >= 1. then add 1 to result
       > Multiply 0.42187500 with 2.    Since 0.84375000 is < 1. then add 0 to result
       > Multiply 0.84375000 with 2.    Since 1.68750000 is >= 1. then add 1 to result
       > Multiply 0.68750000 with 2.    Since 1.37500000 is >= 1. then add 1 to result
       > Multiply 0.37500000 with 2.    Since 0.75000000 is < 1. then add 0 to result
       > Multiply 0.75000000 with 2.    Since 1.50000000 is >= 1. then add 1 to result
       > Multiply 0.50000000 with 2.    Since 1.00000000 is >= 1. then add 1 to result
       > This is equal to 1, so, stop calculating
   0.19899999999999807 of decimal is .0011001011110001101010011111101111100111011011 in binary
   so, 47.199 in binary is 101111.0011001011110001101010011111101111100111011011
-47.199 in simple binary => 101111.0011001011110001101010011111101111100111011011
so, -47.199 in normal binary is 101111.0011001011110001101010011111101111100111011011 => 1.0111100110010111100011 * 2^5

single precision:
--------------------
sign bit is 1(-ve)
exponent bits are (127+5=132) => 10000100
   Divide 132 successively by 2 until the quotient is 0
       > 132/2 = 66, remainder is 0
       > 66/2 = 33, remainder is 0
       > 33/2 = 16, remainder is 1
       > 16/2 = 8, remainder is 0
       > 8/2 = 4, remainder is 0
       > 4/2 = 2, remainder is 0
       > 2/2 = 1, remainder is 0
       > 1/2 = 0, remainder is 1
   Read remainders from the bottom to top as 10000100
   So, 132 of decimal is 10000100 in binary
frac/significant bits are 01111001100101111000110

so, -47.199 in single-precision format is 1 10000100 01111001100101111000110
Hexadecimal Binary
0 0000
1 0001
2 0010
3 0011
4 0100
5 0101
6 0110
7 0111
8 1000
9 1001
A 1010
B 1011
C 1100
D 1101
E 1110
F 1111
Use this table to convert from binary to hexadecimal
Converting 11000010001111001100101111000110 to hexadecimal
1100 => C
0010 => 2
0011 => 3
1100 => C
1100 => C
1011 => B
1100 => C
0110 => 6
So, in hexadecimal 11000010001111001100101111000110 is 0xC23CCBC6

in hexadecimal it is 0xC23CCBC6

2)
-47.199
Converting 47.199 to binary
   Convert decimal part first, then the fractional part
   > First convert 47 to binary
   Divide 47 successively by 2 until the quotient is 0
       > 47/2 = 23, remainder is 1
       > 23/2 = 11, remainder is 1
       > 11/2 = 5, remainder is 1
       > 5/2 = 2, remainder is 1
       > 2/2 = 1, remainder is 0
       > 1/2 = 0, remainder is 1
   Read remainders from the bottom to top as 101111
   So, 47 of decimal is 101111 in binary
   > Now, Convert 0.19900000 to binary
       > Multiply 0.19900000 with 2.    Since 0.39800000 is < 1. then add 0 to result
       > Multiply 0.39800000 with 2.    Since 0.79600000 is < 1. then add 0 to result
       > Multiply 0.79600000 with 2.    Since 1.59200000 is >= 1. then add 1 to result
       > Multiply 0.59200000 with 2.    Since 1.18400000 is >= 1. then add 1 to result
       > Multiply 0.18400000 with 2.    Since 0.36800000 is < 1. then add 0 to result
       > Multiply 0.36800000 with 2.    Since 0.73600000 is < 1. then add 0 to result
       > Multiply 0.73600000 with 2.    Since 1.47200000 is >= 1. then add 1 to result
       > Multiply 0.47200000 with 2.    Since 0.94400000 is < 1. then add 0 to result
       > Multiply 0.94400000 with 2.    Since 1.88800000 is >= 1. then add 1 to result
       > Multiply 0.88800000 with 2.    Since 1.77600000 is >= 1. then add 1 to result
       > Multiply 0.77600000 with 2.    Since 1.55200000 is >= 1. then add 1 to result
       > Multiply 0.55200000 with 2.    Since 1.10400000 is >= 1. then add 1 to result
       > Multiply 0.10400000 with 2.    Since 0.20800000 is < 1. then add 0 to result
       > Multiply 0.20800000 with 2.    Since 0.41600000 is < 1. then add 0 to result
       > Multiply 0.41600000 with 2.    Since 0.83200000 is < 1. then add 0 to result
       > Multiply 0.83200000 with 2.    Since 1.66400000 is >= 1. then add 1 to result
       > Multiply 0.66400000 with 2.    Since 1.32800000 is >= 1. then add 1 to result
       > Multiply 0.32800000 with 2.    Since 0.65600000 is < 1. then add 0 to result
       > Multiply 0.65600000 with 2.    Since 1.31200000 is >= 1. then add 1 to result
       > Multiply 0.31200000 with 2.    Since 0.62400000 is < 1. then add 0 to result
       > Multiply 0.62400000 with 2.    Since 1.24800000 is >= 1. then add 1 to result
       > Multiply 0.24800000 with 2.    Since 0.49599999 is < 1. then add 0 to result
       > Multiply 0.49599999 with 2.    Since 0.99199998 is < 1. then add 0 to result
       > Multiply 0.99199998 with 2.    Since 1.98399997 is >= 1. then add 1 to result
       > Multiply 0.98399997 with 2.    Since 1.96799994 is >= 1. then add 1 to result
       > Multiply 0.96799994 with 2.    Since 1.93599987 is >= 1. then add 1 to result
       > Multiply 0.93599987 with 2.    Since 1.87199974 is >= 1. then add 1 to result
       > Multiply 0.87199974 with 2.    Since 1.74399948 is >= 1. then add 1 to result
       > Multiply 0.74399948 with 2.    Since 1.48799896 is >= 1. then add 1 to result
       > Multiply 0.48799896 with 2.    Since 0.97599792 is < 1. then add 0 to result
       > Multiply 0.97599792 with 2.    Since 1.95199585 is >= 1. then add 1 to result
       > Multiply 0.95199585 with 2.    Since 1.90399170 is >= 1. then add 1 to result
       > Multiply 0.90399170 with 2.    Since 1.80798340 is >= 1. then add 1 to result
       > Multiply 0.80798340 with 2.    Since 1.61596680 is >= 1. then add 1 to result
       > Multiply 0.61596680 with 2.    Since 1.23193359 is >= 1. then add 1 to result
       > Multiply 0.23193359 with 2.    Since 0.46386719 is < 1. then add 0 to result
       > Multiply 0.46386719 with 2.    Since 0.92773438 is < 1. then add 0 to result
       > Multiply 0.92773438 with 2.    Since 1.85546875 is >= 1. then add 1 to result
       > Multiply 0.85546875 with 2.    Since 1.71093750 is >= 1. then add 1 to result
       > Multiply 0.71093750 with 2.    Since 1.42187500 is >= 1. then add 1 to result
       > Multiply 0.42187500 with 2.    Since 0.84375000 is < 1. then add 0 to result
       > Multiply 0.84375000 with 2.    Since 1.68750000 is >= 1. then add 1 to result
       > Multiply 0.68750000 with 2.    Since 1.37500000 is >= 1. then add 1 to result
       > Multiply 0.37500000 with 2.    Since 0.75000000 is < 1. then add 0 to result
       > Multiply 0.75000000 with 2.    Since 1.50000000 is >= 1. then add 1 to result
       > Multiply 0.50000000 with 2.    Since 1.00000000 is >= 1. then add 1 to result
       > This is equal to 1, so, stop calculating
   0.19899999999999807 of decimal is .0011001011110001101010011111101111100111011011 in binary
   so, 47.199 in binary is 101111.0011001011110001101010011111101111100111011011
-47.199 in simple binary => 101111.0011001011110001101010011111101111100111011011
so, -47.199 in normal binary is 101111.0011001011110001101010011111101111100111011011 => 1.011110011001011110001101010011111101111100111011011 * 2^5

64-bit format:
--------------------
sign bit is 1(-ve)
exponent bits are (1023+5=1028) => 10000000100
   Divide 1028 successively by 2 until the quotient is 0
       > 1028/2 = 514, remainder is 0
       > 514/2 = 257, remainder is 0
       > 257/2 = 128, remainder is 1
       > 128/2 = 64, remainder is 0
       > 64/2 = 32, remainder is 0
       > 32/2 = 16, remainder is 0
       > 16/2 = 8, remainder is 0
       > 8/2 = 4, remainder is 0
       > 4/2 = 2, remainder is 0
       > 2/2 = 1, remainder is 0
       > 1/2 = 0, remainder is 1
   Read remainders from the bottom to top as 10000000100
   So, 1028 of decimal is 10000000100 in binary
frac/significant bits are 0111100110010111100011010100111111011111001110110110

so, -47.199 in 64-bit format is 1 10000000100 0111100110010111100011010100111111011111001110110110
Hexadecimal Binary
0 0000
1 0001
2 0010
3 0011
4 0100
5 0101
6 0110
7 0111
8 1000
9 1001
A 1010
B 1011
C 1100
D 1101
E 1110
F 1111
Use this table to convert from binary to hexadecimal
Converting 1100000001000111100110010111100011010100111111011111001110110110 to hexadecimal
1100 => C
0000 => 0
0100 => 4
0111 => 7
1001 => 9
1001 => 9
0111 => 7
1000 => 8
1101 => D
0100 => 4
1111 => F
1101 => D
1111 => F
0011 => 3
1011 => B
0110 => 6
So, in hexadecimal 1100000001000111100110010111100011010100111111011111001110110110 is 0xC0479978D4FDF3B6

in hexadecimal it is 0xC0479978D4FDF3B6


Related Solutions

convert -549.675 to IEEE-754 single precision and double precision both. Need a lot of explanation. (Atleast...
convert -549.675 to IEEE-754 single precision and double precision both. Need a lot of explanation. (Atleast 1000 words)
Convert 1101.11011101 x 223 to IEEE Standard 754 for single-precision floating-point binary format. Convert the IEEE...
Convert 1101.11011101 x 223 to IEEE Standard 754 for single-precision floating-point binary format. Convert the IEEE Standard 754 number 11001010100011010101000000000000 to its decimal equivalent.
Show the IEEE 754 binary representation of the number -0.25(subscript)ten in single and double precision. List...
Show the IEEE 754 binary representation of the number -0.25(subscript)ten in single and double precision. List all the steps required to get the single and double precision.
1. Convert 5.5 to hexadecimal notation using IEEE 754 single precision. Please show your work and...
1. Convert 5.5 to hexadecimal notation using IEEE 754 single precision. Please show your work and answer must be in hexadecimal notation. 2. (4 points) Convert -7.875 to hexadecimal notation using IEEE 754 single precision. Please show your work and answer must be in hexadecimal notation.
A) Convert 1101.11011101 x 223 to IEEE Standard 754 for single precision floating-point binary format. B)...
A) Convert 1101.11011101 x 223 to IEEE Standard 754 for single precision floating-point binary format. B) Convert the IEEE Standard 754 number 11001010100011010101000000000000 to its decimal equivalent.  
Convert 0xCD001234 from IEEE-754 hexadecimal to single-precision floating point format. Please show every single detail for...
Convert 0xCD001234 from IEEE-754 hexadecimal to single-precision floating point format. Please show every single detail for upvote. Please do not answer otherwise.
4. Explain how the following computations are performed using both IEEE single precision and double precision...
4. Explain how the following computations are performed using both IEEE single precision and double precision floating point representation. a. 11716 +2A916 b. 1011.112-11.1510 c. 1.0010102 x 0.011012 d. Comment on any differences you see in accuracy and precision.
For IEEE 754 single-precision floating point, what is the hexadecimal representation of 27.101562? A. 35CCD001 B....
For IEEE 754 single-precision floating point, what is the hexadecimal representation of 27.101562? A. 35CCD001 B. 2F5C10D0 C. 41D8D000 D. 7DCA1111 E. None of the above
Using IEEE 754 single precision floating point, write the hexadecimal representation for each of the following:...
Using IEEE 754 single precision floating point, write the hexadecimal representation for each of the following: a. Zero b. -2.0 (base 10) c. 256. 0078125 (base 10) d. Negative infinity
6 – Assuming single precision IEEE 754 format, what decimal number is represent by the following...
6 – Assuming single precision IEEE 754 format, what decimal number is represent by the following 32-bit binary word? 1 10001000 10010000000000000000000
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT