Question

7. Perform the sum of the following two decimal numbers: [10 Marks] a. -1203.232 and -253.1398...

7. Perform the sum of the following two decimal numbers: [10 Marks]
a. -1203.232 and -253.1398
b. -2037.4235 and 653.25
All the operation should be performed in IEEE 754 single precision.

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

Solution:

Given,

=>All the operations should be performed in IEEE 754 single precision.

(a)

Given,

=>First number = -1203.232

=>Second number = -253.1398

Explanation:

Single precision frame format:

Sign(S) Exponent(E) Mantissa(M)

1 bit 8 bits 23 bits

=>Normalized form = (-1)^S*(1.M)*2^(E-127)

Converting given decimal numbers to binary:

=>First number = -1203.232 in decimal

=>First number in binary = -10010110011.0011101101100100011

=>First number in normalized form = -1.00101100110011101101100*2^10

=>Second number = -253.1398 in decimal

=>Second number in bianry = -11111101.00100011110010011111

=>Second number in normalized form = -1.11111010010001111001001*2^7

Now performing addition:

=>First number in normalized form = -1.00101100110011101101100*2^10

=>Second number in normalized form = -1.11111010010001111001001*2^7

Step 1:

=>Rewrite the smaller larger such that exponent of smaller number matches with higher number

=>Second number in normalized form = -1.11111010010001111001001*2^7

=>Second number in normalized form = -0.00111111010010001111001*2^10

Step 2:

=>Add mantissa part of both the numbers

=>-1.11111010010001111001001*2^10 -0.00111111010010001111001*2^10 = -10.0011100110010000100001*2^10

Step 3:

=>Now normalizing the sum

=>-10.0011100110010000100001*2^10 = -1.00011100110010000100001*2^11

Step 4:

=>Checking overflow

=>As -126 < 11 < 127 so there is no overflow

Step 5:

=>Now converting into decimal

=>-1.00011100110010000100001*2^11 = -100011100110.010000100001

=>-100011100110.010000100001 = 2278.258056640625

=>Hence sum of -1203.232 and -253.1398 = -2278.258056640625

(b)

Given,

=>First number = -2037.4235

=>Second number = 653.25

Explanation:

=>First number = -2037.4235 in decimal

=>First number in binary = -11111110101.01101100011010101

=>First number in nomarlized form = -1.11111101010110110001101*2^10

=>Second number = 653.25 in decimal

=>Second number in binary = 1010001101.01

=>Second number in normalized form = 1.01000110101000000000000*2^9

Now performing additon:

=>First number in nomarlized form = -1.11111101010110110001101*2^10

=>Second number in normalized form = 1.01000110101000000000000*2^9

Step 1:

=>Make the exponent part of smaller number same as higher number's exponent.

=>Second number in normalized form = 1.01000110101000000000000*2^9

=>Second number = 0.10100011010100000000000*2^10

Step 2:

=>Now adding mantissa part.

=>-1.11111101010110110001101*2^10 + 0.10100011010100000000000*2^10 = -1.01011010000010110001101*2^10

Step 3:

=>Checking overflow

=>-126 < 10 < 127 hence no overflow

Step 4:

=>Normalize the summation. As summation is already normalized so no need to do that.

Step 5:

=>Convert into decimal

=>-1.01011010000010110001101*2^10 = -10101101000.0010110001101

=>10101101000.0010110001101 = -1384.1734619140625

I have explained each and every part with the help of statements attached to it.

Add a comment
Know the answer?
Add Answer to:
7. Perform the sum of the following two decimal numbers: [10 Marks] a. -1203.232 and -253.1398...
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