Question

Convert the following numbers to 32b IEEE 754 Floating Point format. Show bits in diagrams below. a) -769.0234375 Mantissa Exponent b) 8.111 Mantissa Exponent

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

1.)

-769.0234375

We start with positive version of the number: 769.0234375

First we will convert the integer part to binary as follows:

To convert from decimal to binary: Divide the number repeatedly by 2, keeping track of each remainder, until we get a quotient that is equal to zero

  • 769 ÷ 2 = 384 + 1;
  • 384 ÷ 2 = 192 + 0;
  • 192 ÷ 2 = 96 + 0;
  • 96 ÷ 2 = 48 + 0;
  • 48 ÷ 2 = 24 + 0;
  • 24 ÷ 2 = 12 + 0;
  • 12 ÷ 2 = 6 + 0;
  • 6 ÷ 2 = 3 + 0;
  • 3 ÷ 2 = 1 + 1;
  • 1 ÷ 2 = 0 + 1;

​769 in binary = 1100000001(2)

Now we will convert the fractional part to binary as follows:

Multiply it repeatedly by 2, keeping track of each integer part of the results, until we get a fractional part that is equal to zero:

  • 1) 0.023 437 5 × 2 = 0 + 0.046 875;
  • 2) 0.046 875 × 2 = 0 + 0.093 75;
  • 3) 0.093 75 × 2 = 0 + 0.187 5;
  • 4) 0.187 5 × 2 = 0 + 0.375;
  • 5) 0.375 × 2 = 0 + 0.75;
  • 6) 0.75 × 2 = 1 + 0.5;
  • 7) 0.5 × 2 = 1 + 0;

0.023 437 5(10) = 00000011(2)

Hence given number in binary will be:

769.023 437 5(10) = 11 0000 0001.0000 011(2)

Now we will normalize the number, by shifting the decimal mark 9 positions to the left so that only one non zero digit remains to the left of it:

769.023 437 5(10) = 1.1000 0000 1000 0011(2) × 29

Since the number is negative, sign bit will be 1 in the IEEE format.

Unadjusted exponent = 9

Unnormalized Mantissa = 1.1000 0000 1000 0011

To get the adjusted exponent, we will add the bias 127 to it.

Hence adjusted exponent = 136

136 in binary = 1000 1000(2)

To normalize the mantissa: remove the leading (the leftmost) bit, since it's allways 1 (and the decimal point, if the case) then adjust its length to 23 bits, by adding the necessary number of zeros to the right

Normalized mantissa: 100 0000 0100 0001 1000 0000

Hence the three fields in IEEE 754 format are as follows:

Sign (1 bit) = 1 (a negative number)

Exponent (8 bits) = 1000 1000

Mantissa (23 bits) = 100 0000 0100 0001 1000 0000

S Exponent Mantissa
1 1 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 1 1 0 0 0 0 0 0 0

2.)

8.111:

First convert the integer part to binary:

  • 8 ÷ 2 = 4 + 0;
  • 4 ÷ 2 = 2 + 0;
  • 2 ÷ 2 = 1 + 0;
  • 1 ÷ 2 = 0 + 1;

8(10) = 1000(2)

Now convert the franctional part to binary: Multiply it repeatedly by 2, keeping track of each integer part of the results, until we get a fractional part that is equal to zero:

  • 1) 0.111 × 2 = 0 + 0.222;
  • 2) 0.222 × 2 = 0 + 0.444;
  • 3) 0.444 × 2 = 0 + 0.888;
  • 4) 0.888 × 2 = 1 + 0.776;
  • 5) 0.776 × 2 = 1 + 0.552;
  • 6) 0.552 × 2 = 1 + 0.104;
  • 7) 0.104 × 2 = 0 + 0.208;
  • 8) 0.208 × 2 = 0 + 0.416;
  • 9) 0.416 × 2 = 0 + 0.832;
  • 10) 0.832 × 2 = 1 + 0.664;
  • 11) 0.664 × 2 = 1 + 0.328;
  • 12) 0.328 × 2 = 0 + 0.656;
  • 13) 0.656 × 2 = 1 + 0.312;
  • 14) 0.312 × 2 = 0 + 0.624;
  • 15) 0.624 × 2 = 1 + 0.248;
  • 16) 0.248 × 2 = 0 + 0.496;
  • 17) 0.496 × 2 = 0 + 0.992;
  • 18) 0.992 × 2 = 1 + 0.984;
  • 19) 0.984 × 2 = 1 + 0.968;
  • 20) 0.968 × 2 = 1 + 0.936;
  • 21) 0.936 × 2 = 1 + 0.872;
  • 22) 0.872 × 2 = 1 + 0.744;
  • 23) 0.744 × 2 = 1 + 0.488;
  • 24) 0.488 × 2 = 0 + 0.976;

We didn't get any fractional part that was equal to zero. But we had enough iterations (over Mantissa limit) and at least one integer that was different from zero

0.111(10) = 0.0001 1100 0110 1010 0111 1110(2)

Hence

8.111(10) = 1000.0001 1100 0110 1010 0111 1110(2)

Normalizing the binary form, by shifting the decimal mark 3 positions to the left so that only one non zero digit remains to the left of it:

8.111(10) = 1.0000 0011 1000 1101 0100 1111 110(2) × 23

Sign: 0 (a positive number)

Exponent (unadjusted): 3

Mantissa (not normalized): 1.0000 0011 1000 1101 0100 1111 110

To adjust the exponent, add the bias of 127 to it.

Adjusted exponent = 127 + 3 = 130

130 in binary = 1000 0010(2)

To normalize the mantissa: remove the leading (the leftmost) bit, since it's allways 1 (and the decimal point, if the case) then adjust its length to 23 bits, by removing the excess bits, from the right

Mantissa (normalized) = 000 0001 1100 0110 1010 0111

Hence the three fields in IEEE 754 format are as follows:

Sign (1 bit) = 0 (a positive number)

Exponent (8 bits) = 1000 0010

Mantissa (23 bits) = 000 0001 1100 0110 1010 0111

S Exponent Mantissa
0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 1 1 0 0 0 1 1 0 1 0 1 0 0 1 1 1

Please give this solution a thumbs up if you find it helpful and comment if you have any doubts in it.

Add a comment
Know the answer?
Add Answer to:
Convert the following numbers to 32b IEEE 754 Floating Point format. Show bits in diagrams below....
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