Question

1. (a) Convert the following decimal numbers into their EEE-754 single-precision (32-bit) representations. Give your answers

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

Ans) give direct solutions hoping you know the process of conversion. Gneralisied steps are also enclosed.

1)-3.3125 = 0xc0540000

2)0 =0x00000000

3)52240 =0x48ff0000

genaralised procedure for conversion solving for 1)

1. We start with the positive version of the number:

|-3.312 5| = 3.312 5

2. First, convert to binary (base 2) the integer part: 3. Divide the number repeatedly by 2, keeping track of each remainder, until we get a quotient that is equal to zero:

  • division = quotient + remainder;
  • 3 ÷ 2 = 1 + 1;
  • 1 ÷ 2 = 0 + 1;

3. Construct the base 2 representation of the integer part of the number, by taking all the remainders starting from the bottom of the list constructed above:

3(10) =

11(2)

4. Convert to binary (base 2) the fractional part: 0.312 5. 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:

  • #) multiplying = integer + fractional part;
  • 1) 0.312 5 × 2 = 0 + 0.625;
  • 2) 0.625 × 2 = 1 + 0.25;
  • 3) 0.25 × 2 = 0 + 0.5;
  • 4) 0.5 × 2 = 1 + 0;

5. Construct the base 2 representation of the fractional part of the number, by taking all the integer parts of the multiplying operations, starting from the top of the constructed list above:

0.312 5(10) =

0.0101(2)

Positive number before normalization:

3.312 5(10) =

11.0101(2)

6. Normalize the binary representation of the number, shifting the decimal mark 1 positions to the left so that only one non zero digit remains to the left of it:

3.312 5(10) =

11.0101(2) =

11.0101(2) × 20 =

1.1010 1(2) × 21

Up to this moment, there are the following elements that would feed into the 32 bit single precision IEEE 754 binary floating point representation:

Sign: 1 (a negative number)

Exponent (unadjusted): 1

Mantissa (not normalized): 1.1010 1

7. Adjust the exponent in 8 bit excess/bias notation and then convert it from decimal (base 10) to 8 bit binary, by using the same technique of repeatedly dividing by 2:

Exponent (adjusted) =

Exponent (unadjusted) + 2(8-1) - 1 =

1 + 2(8-1) - 1 =

(1 + 127)(10) =

128(10)

  • division = quotient + remainder;
  • 128 ÷ 2 = 64 + 0;
  • 64 ÷ 2 = 32 + 0;
  • 32 ÷ 2 = 16 + 0;
  • 16 ÷ 2 = 8 + 0;
  • 8 ÷ 2 = 4 + 0;
  • 4 ÷ 2 = 2 + 0;
  • 2 ÷ 2 = 1 + 0;
  • 1 ÷ 2 = 0 + 1;

Exponent (adjusted) =

128(10) =

1000 0000(2)

8. Normalize 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:

Mantissa (normalized) =

1. 1 0101 00 0000 0000 0000 0000 =

101 0100 0000 0000 0000 0000

Add a comment
Know the answer?
Add Answer to:
1. (a) Convert the following decimal numbers into their EEE-754 single-precision (32-bit) representations. Give your answers...
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