Question

This problem covers floating-point IEEE format. (a) Assuming single precision IEEE 754 format, what is the...

This problem covers floating-point IEEE format.

(a) Assuming single precision IEEE 754 format, what is the binary pattern for decimal number -6.16?

(b) Assuming single precision IEEE 754 format, what decimal number is represented by this word: 0 01111100 01100000000000000000000

(Hint: remember to use the biased form of the exponent.)

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

a)
-6.16
Converting 6.16 to binary
   Convert decimal part first, then the fractional part
   > First convert 6 to binary
   Divide 6 successively by 2 until the quotient is 0
       > 6/2 = 3, remainder is 0
       > 3/2 = 1, remainder is 1
       > 1/2 = 0, remainder is 1
   Read remainders from the bottom to top as 110
   So, 6 of decimal is 110 in binary
   > Now, Convert 0.16000000 to binary
       > Multiply 0.16000000 with 2.    Since 0.32000000 is < 1. then add 0 to result
       > Multiply 0.32000000 with 2.    Since 0.64000000 is < 1. then add 0 to result
       > Multiply 0.64000000 with 2.    Since 1.28000000 is >= 1. then add 1 to result
       > Multiply 0.28000000 with 2.    Since 0.56000000 is < 1. then add 0 to result
       > Multiply 0.56000000 with 2.    Since 1.12000000 is >= 1. then add 1 to result
       > Multiply 0.12000000 with 2.    Since 0.24000000 is < 1. then add 0 to result
       > Multiply 0.24000000 with 2.    Since 0.48000000 is < 1. then add 0 to result
       > Multiply 0.48000000 with 2.    Since 0.96000000 is < 1. then add 0 to result
       > Multiply 0.96000000 with 2.    Since 1.92000000 is >= 1. then add 1 to result
       > Multiply 0.92000000 with 2.    Since 1.84000000 is >= 1. then add 1 to result
       > Multiply 0.84000000 with 2.    Since 1.68000000 is >= 1. then add 1 to result
       > Multiply 0.68000000 with 2.    Since 1.36000000 is >= 1. then add 1 to result
       > Multiply 0.36000000 with 2.    Since 0.72000000 is < 1. then add 0 to result
       > Multiply 0.72000000 with 2.    Since 1.44000000 is >= 1. then add 1 to result
       > Multiply 0.44000000 with 2.    Since 0.88000000 is < 1. then add 0 to result
       > Multiply 0.88000000 with 2.    Since 1.76000000 is >= 1. then add 1 to result
       > Multiply 0.76000000 with 2.    Since 1.52000000 is >= 1. then add 1 to result
       > Multiply 0.52000000 with 2.    Since 1.04000000 is >= 1. then add 1 to result
       > Multiply 0.04000000 with 2.    Since 0.08000000 is < 1. then add 0 to result
       > Multiply 0.08000000 with 2.    Since 0.16000000 is < 1. then add 0 to result
       > Multiply 0.16000000 with 2.    Since 0.32000000 is < 1. then add 0 to result
       > Multiply 0.32000000 with 2.    Since 0.64000000 is < 1. then add 0 to result
       > Multiply 0.64000000 with 2.    Since 1.28000000 is >= 1. then add 1 to result
       > Multiply 0.28000000 with 2.    Since 0.56000000 is < 1. then add 0 to result
       > Multiply 0.56000000 with 2.    Since 1.12000000 is >= 1. then add 1 to result
       > Multiply 0.12000000 with 2.    Since 0.24000001 is < 1. then add 0 to result
       > Multiply 0.24000001 with 2.    Since 0.48000002 is < 1. then add 0 to result
       > Multiply 0.48000002 with 2.    Since 0.96000004 is < 1. then add 0 to result
       > Multiply 0.96000004 with 2.    Since 1.92000008 is >= 1. then add 1 to result
       > Multiply 0.92000008 with 2.    Since 1.84000015 is >= 1. then add 1 to result
       > Multiply 0.84000015 with 2.    Since 1.68000031 is >= 1. then add 1 to result
       > Multiply 0.68000031 with 2.    Since 1.36000061 is >= 1. then add 1 to result
       > Multiply 0.36000061 with 2.    Since 0.72000122 is < 1. then add 0 to result
       > Multiply 0.72000122 with 2.    Since 1.44000244 is >= 1. then add 1 to result
       > Multiply 0.44000244 with 2.    Since 0.88000488 is < 1. then add 0 to result
       > Multiply 0.88000488 with 2.    Since 1.76000977 is >= 1. then add 1 to result
       > Multiply 0.76000977 with 2.    Since 1.52001953 is >= 1. then add 1 to result
       > Multiply 0.52001953 with 2.    Since 1.04003906 is >= 1. then add 1 to result
       > Multiply 0.04003906 with 2.    Since 0.08007812 is < 1. then add 0 to result
       > Multiply 0.08007812 with 2.    Since 0.16015625 is < 1. then add 0 to result
       > Multiply 0.16015625 with 2.    Since 0.32031250 is < 1. then add 0 to result
       > Multiply 0.32031250 with 2.    Since 0.64062500 is < 1. then add 0 to result
       > Multiply 0.64062500 with 2.    Since 1.28125000 is >= 1. then add 1 to result
       > Multiply 0.28125000 with 2.    Since 0.56250000 is < 1. then add 0 to result
       > Multiply 0.56250000 with 2.    Since 1.12500000 is >= 1. then add 1 to result
       > Multiply 0.12500000 with 2.    Since 0.25000000 is < 1. then add 0 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.16000000000000014 of decimal is .001010001111010111000010100011110101110000101001 in binary
   so, 6.16 in binary is 110.001010001111010111000010100011110101110000101001
-6.16 in simple binary => 110.001010001111010111000010100011110101110000101001
so, -6.16 in normal binary is 110.001010001111010111000010100011110101110000101001 => 1.10001010001111010111 * 2^2

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

so, -6.16 in single-precision format is 1 10000001 10001010001111010111000
in hexadecimal it is 0xC0C51EB8

b)
0 01111100 01100000000000000000000
sign bit is 0(+ve)
exp bits are 01111100
   => 01111100
   => 0x2^7+1x2^6+1x2^5+1x2^4+1x2^3+1x2^2+0x2^1+0x2^0
   => 0x128+1x64+1x32+1x16+1x8+1x4+0x2+0x1
   => 0+64+32+16+8+4+0+0
   => 124
in decimal it is 124
so, exponent/bias is 124-127 = -3
frac bits are 011

IEEE-754 Decimal value is 1.frac * 2^exponent
IEEE-754 Decimal value is 1.011 * 2^-3
1.011 in decimal is 1.375
   => 1.011
   => 1x2^0+0x2^-1+1x2^-2+1x2^-3
   => 1x1+0x0.5+1x0.25+1x0.125
   => 1+0.0+0.25+0.125
   => 1.375
so, 1.375 * 2^-3 in decimal is 0.171875
so, 00111110001100000000000000000000 in IEEE-754 single precision format is 0.171875
Answer: 0.171875

Add a comment
Know the answer?
Add Answer to:
This problem covers floating-point IEEE format. (a) Assuming single precision IEEE 754 format, what is the...
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