Question

a. Convert the following decimal numbers to 32-bit floating point number. 1. 25.875 2.-7.0625 b. What decimal value is repres

please answer with steps.

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

a.

1. 25.875

--convert the integer part 25 to binary by dividing it with 2 until the quotient becomes 0.

Division=quotient remainder

25÷2= 12 1

12÷2= 6 0

6÷2=3 0

3÷2=1 1

1÷2=0 1

-- take the remainder values from down to up.

11001

---convert the fraction part .875 to binary by multiplying with 2 and take integer part of result until the fraction part becomes 0.

Multiplication = integer part fraction part

0.875 × 2 = 1 0.75

0.75 × 2 =1 0.5

0.5 × 2 =1 0

Take integer part value = 111

Total integer+ fraction value = 11001.111

Move decimal point to left for 4 places= 1.1001111×2^4 here mantissa is 1001111.

E=127+4 = 131(10000011)

Floating point representation:

Sign E Mantissa

0 10000011 1001 111 1111 1111 1111 1111

2. -7.0625

Follow the same steps as above.

Integer part 7

Division = quotient remainder

7÷2 = 3 1

3÷2 = 1 1

1÷2 = 0 1

7 value is 111

-- now fraction part .0625

Multiplication = integerpart fraction part

0.625×2 = 0 0.125

0.125×2 = 0 0.25

0.25×2 = 0 0.5

0.5×2 = 1 0

0.625 value is : 0001

Total value : 111.0001

Decimal point move to left for 2 places: 1.110001×2^2

E=127+2=129 (10000001)

Floating point representation:

S E Mantissa

1 10000001 1100 0100 0000 0000 0000 000

b.

1.given : C 1 0 B 0 0 0 0

- convert to binary

1100 0001 0000 1011 0000 0000 0000 0000

S E Mantissa

1st bit ---- S

Next 8 bits -----E

Next 23 bits -----mantissa

E= 10000010 =130

Exponential bias = 130-127 = 3

Mantissa part 000 1011 0000 ...........

2^-4 + 2^-6 + 2^-7 = 0.0859375

Decimal value will be obtained by the following formula :

(-1)^S × (1+Mantissa ) × 2^E

(-1)^1 × (1+0.0859375)×2^3

=-8.6875

2. Given : 4 6 A B 0 0 0 0

Binary value :

0100 0110 1010 1011 0000 0000 0000 0000

S E Mantissa

1st bit ---S

Next 8 bits ---E

Next 23 bits -- Mantissa

E= 10001101 = 141

Exponential bias : 141-127=14

Mantissa part : 010 1011 00000 .......

2^-2 +2^-4 + 2^-6 +2^-7 = 0.3359375

Binary value will be obtained from the formula :

(-1)^S × (1+Mantissa )×2^E

(-1)^0 × (1+0.3359375) × 2^ 14

=21888

Add a comment
Know the answer?
Add Answer to:
please answer with steps. a. Convert the following decimal numbers to 32-bit floating point number. 1....
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