Question

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

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

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Answer:

1)
-67.76923076923077
Converting 67.76923076923077 to binary
   Convert decimal part first, then the fractional part
   > First convert 67 to binary
   Divide 67 successively by 2 until the quotient is 0
       > 67/2 = 33, remainder is 1
       > 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 1000011
   So, 67 of decimal is 1000011 in binary
   > Now, Convert 0.76923077 to binary
       > Multiply 0.76923077 with 2.    Since 1.53846154 is >= 1. then add 1 to result
       > Multiply 0.53846154 with 2.    Since 1.07692308 is >= 1. then add 1 to result
       > Multiply 0.07692308 with 2.    Since 0.15384615 is < 1. then add 0 to result
       > Multiply 0.15384615 with 2.    Since 0.30769231 is < 1. then add 0 to result
       > Multiply 0.30769231 with 2.    Since 0.61538462 is < 1. then add 0 to result
       > Multiply 0.61538462 with 2.    Since 1.23076923 is >= 1. then add 1 to result
       > Multiply 0.23076923 with 2.    Since 0.46153846 is < 1. then add 0 to result
       > Multiply 0.46153846 with 2.    Since 0.92307692 is < 1. then add 0 to result
       > Multiply 0.92307692 with 2.    Since 1.84615385 is >= 1. then add 1 to result
       > Multiply 0.84615385 with 2.    Since 1.69230769 is >= 1. then add 1 to result
       > Multiply 0.69230769 with 2.    Since 1.38461538 is >= 1. then add 1 to result
       > Multiply 0.38461538 with 2.    Since 0.76923077 is < 1. then add 0 to result
       > Multiply 0.76923077 with 2.    Since 1.53846154 is >= 1. then add 1 to result
       > Multiply 0.53846154 with 2.    Since 1.07692308 is >= 1. then add 1 to result
       > Multiply 0.07692308 with 2.    Since 0.15384615 is < 1. then add 0 to result
       > Multiply 0.15384615 with 2.    Since 0.30769231 is < 1. then add 0 to result
       > Multiply 0.30769231 with 2.    Since 0.61538462 is < 1. then add 0 to result
       > Multiply 0.61538462 with 2.    Since 1.23076923 is >= 1. then add 1 to result
       > Multiply 0.23076923 with 2.    Since 0.46153846 is < 1. then add 0 to result
       > Multiply 0.46153846 with 2.    Since 0.92307693 is < 1. then add 0 to result
       > Multiply 0.92307693 with 2.    Since 1.84615386 is >= 1. then add 1 to result
       > Multiply 0.84615386 with 2.    Since 1.69230771 is >= 1. then add 1 to result
       > Multiply 0.69230771 with 2.    Since 1.38461542 is >= 1. then add 1 to result
       > Multiply 0.38461542 with 2.    Since 0.76923084 is < 1. then add 0 to result
       > Multiply 0.76923084 with 2.    Since 1.53846169 is >= 1. then add 1 to result
       > Multiply 0.53846169 with 2.    Since 1.07692337 is >= 1. then add 1 to result
       > Multiply 0.07692337 with 2.    Since 0.15384674 is < 1. then add 0 to result
       > Multiply 0.15384674 with 2.    Since 0.30769348 is < 1. then add 0 to result
       > Multiply 0.30769348 with 2.    Since 0.61538696 is < 1. then add 0 to result
       > Multiply 0.61538696 with 2.    Since 1.23077393 is >= 1. then add 1 to result
       > Multiply 0.23077393 with 2.    Since 0.46154785 is < 1. then add 0 to result
       > Multiply 0.46154785 with 2.    Since 0.92309570 is < 1. then add 0 to result
       > Multiply 0.92309570 with 2.    Since 1.84619141 is >= 1. then add 1 to result
       > Multiply 0.84619141 with 2.    Since 1.69238281 is >= 1. then add 1 to result
       > Multiply 0.69238281 with 2.    Since 1.38476562 is >= 1. then add 1 to result
       > Multiply 0.38476562 with 2.    Since 0.76953125 is < 1. then add 0 to result
       > Multiply 0.76953125 with 2.    Since 1.53906250 is >= 1. then add 1 to result
       > Multiply 0.53906250 with 2.    Since 1.07812500 is >= 1. then add 1 to result
       > Multiply 0.07812500 with 2.    Since 0.15625000 is < 1. then add 0 to result
       > Multiply 0.15625000 with 2.    Since 0.31250000 is < 1. then add 0 to result
       > Multiply 0.31250000 with 2.    Since 0.62500000 is < 1. then add 0 to result
       > Multiply 0.62500000 with 2.    Since 1.25000000 is >= 1. then add 1 to result
       > Multiply 0.25000000 with 2.    Since 0.50000000 is < 1. then add 0 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.7692307692307736 of decimal is .11000100111011000100111011000100111011000101 in binary
   so, 67.76923076923077 in binary is 1000011.11000100111011000100111011000100111011000101
-67.76923076923077 in simple binary => 1000011.11000100111011000100111011000100111011000101
so, -67.76923076923077 in normal binary is 1000011.11000100111011000100111011000100111011000101 => 1.00001111000100111011 * 2^6

single precision:
--------------------
sign bit is 1(-ve)
exponent bits are (127+6=133) => 10000101
   Divide 133 successively by 2 until the quotient is 0
       > 133/2 = 66, remainder is 1
       > 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 10000101
   So, 133 of decimal is 10000101 in binary
frac/significant bits are 00001111000100111011000

so, -67.76923076923077 in single-precision format is 1 10000101 00001111000100111011000
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 11000010100001111000100111011000 to hexadecimal
1100 => C
0010 => 2
1000 => 8
0111 => 7
1000 => 8
1001 => 9
1101 => D
1000 => 8
So, in hexadecimal 11000010100001111000100111011000 is 0xC28789D8

in hexadecimal it is 0xC28789D8

2)
-67.76923076923077
Converting 67.76923076923077 to binary
   Convert decimal part first, then the fractional part
   > First convert 67 to binary
   Divide 67 successively by 2 until the quotient is 0
       > 67/2 = 33, remainder is 1
       > 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 1000011
   So, 67 of decimal is 1000011 in binary
   > Now, Convert 0.76923077 to binary
       > Multiply 0.76923077 with 2.    Since 1.53846154 is >= 1. then add 1 to result
       > Multiply 0.53846154 with 2.    Since 1.07692308 is >= 1. then add 1 to result
       > Multiply 0.07692308 with 2.    Since 0.15384615 is < 1. then add 0 to result
       > Multiply 0.15384615 with 2.    Since 0.30769231 is < 1. then add 0 to result
       > Multiply 0.30769231 with 2.    Since 0.61538462 is < 1. then add 0 to result
       > Multiply 0.61538462 with 2.    Since 1.23076923 is >= 1. then add 1 to result
       > Multiply 0.23076923 with 2.    Since 0.46153846 is < 1. then add 0 to result
       > Multiply 0.46153846 with 2.    Since 0.92307692 is < 1. then add 0 to result
       > Multiply 0.92307692 with 2.    Since 1.84615385 is >= 1. then add 1 to result
       > Multiply 0.84615385 with 2.    Since 1.69230769 is >= 1. then add 1 to result
       > Multiply 0.69230769 with 2.    Since 1.38461538 is >= 1. then add 1 to result
       > Multiply 0.38461538 with 2.    Since 0.76923077 is < 1. then add 0 to result
       > Multiply 0.76923077 with 2.    Since 1.53846154 is >= 1. then add 1 to result
       > Multiply 0.53846154 with 2.    Since 1.07692308 is >= 1. then add 1 to result
       > Multiply 0.07692308 with 2.    Since 0.15384615 is < 1. then add 0 to result
       > Multiply 0.15384615 with 2.    Since 0.30769231 is < 1. then add 0 to result
       > Multiply 0.30769231 with 2.    Since 0.61538462 is < 1. then add 0 to result
       > Multiply 0.61538462 with 2.    Since 1.23076923 is >= 1. then add 1 to result
       > Multiply 0.23076923 with 2.    Since 0.46153846 is < 1. then add 0 to result
       > Multiply 0.46153846 with 2.    Since 0.92307693 is < 1. then add 0 to result
       > Multiply 0.92307693 with 2.    Since 1.84615386 is >= 1. then add 1 to result
       > Multiply 0.84615386 with 2.    Since 1.69230771 is >= 1. then add 1 to result
       > Multiply 0.69230771 with 2.    Since 1.38461542 is >= 1. then add 1 to result
       > Multiply 0.38461542 with 2.    Since 0.76923084 is < 1. then add 0 to result
       > Multiply 0.76923084 with 2.    Since 1.53846169 is >= 1. then add 1 to result
       > Multiply 0.53846169 with 2.    Since 1.07692337 is >= 1. then add 1 to result
       > Multiply 0.07692337 with 2.    Since 0.15384674 is < 1. then add 0 to result
       > Multiply 0.15384674 with 2.    Since 0.30769348 is < 1. then add 0 to result
       > Multiply 0.30769348 with 2.    Since 0.61538696 is < 1. then add 0 to result
       > Multiply 0.61538696 with 2.    Since 1.23077393 is >= 1. then add 1 to result
       > Multiply 0.23077393 with 2.    Since 0.46154785 is < 1. then add 0 to result
       > Multiply 0.46154785 with 2.    Since 0.92309570 is < 1. then add 0 to result
       > Multiply 0.92309570 with 2.    Since 1.84619141 is >= 1. then add 1 to result
       > Multiply 0.84619141 with 2.    Since 1.69238281 is >= 1. then add 1 to result
       > Multiply 0.69238281 with 2.    Since 1.38476562 is >= 1. then add 1 to result
       > Multiply 0.38476562 with 2.    Since 0.76953125 is < 1. then add 0 to result
       > Multiply 0.76953125 with 2.    Since 1.53906250 is >= 1. then add 1 to result
       > Multiply 0.53906250 with 2.    Since 1.07812500 is >= 1. then add 1 to result
       > Multiply 0.07812500 with 2.    Since 0.15625000 is < 1. then add 0 to result
       > Multiply 0.15625000 with 2.    Since 0.31250000 is < 1. then add 0 to result
       > Multiply 0.31250000 with 2.    Since 0.62500000 is < 1. then add 0 to result
       > Multiply 0.62500000 with 2.    Since 1.25000000 is >= 1. then add 1 to result
       > Multiply 0.25000000 with 2.    Since 0.50000000 is < 1. then add 0 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.7692307692307736 of decimal is .11000100111011000100111011000100111011000101 in binary
   so, 67.76923076923077 in binary is 1000011.11000100111011000100111011000100111011000101
-67.76923076923077 in simple binary => 1000011.11000100111011000100111011000100111011000101
so, -67.76923076923077 in normal binary is 1000011.11000100111011000100111011000100111011000101 => 1.00001111000100111011000100111011000100111011000101 * 2^6

64-bit format:
--------------------
sign bit is 1(-ve)
exponent bits are (1023+6=1029) => 10000000101
   Divide 1029 successively by 2 until the quotient is 0
       > 1029/2 = 514, remainder is 1
       > 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 10000000101
   So, 1029 of decimal is 10000000101 in binary
frac/significant bits are 0000111100010011101100010011101100010011101100010100

so, -67.76923076923077 in 64-bit format is 1 10000000101 0000111100010011101100010011101100010011101100010100
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 1100000001010000111100010011101100010011101100010011101100010100 to hexadecimal
1100 => C
0000 => 0
0101 => 5
0000 => 0
1111 => F
0001 => 1
0011 => 3
1011 => B
0001 => 1
0011 => 3
1011 => B
0001 => 1
0011 => 3
1011 => B
0001 => 1
0100 => 4
So, in hexadecimal 1100000001010000111100010011101100010011101100010011101100010100 is 0xC050F13B13B13B14

in hexadecimal it is 0xC050F13B13B13B14



Please let me know if you have any doubts Please upvote this answer. Thanks!!

Add a comment
Know the answer?
Add Answer to:
convert -881/13 to IEEE-754 single precision and double precision both. Need a lot of explanation. (Atleast...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT