Question

Inspired of the IEEE 754 standard, a floating point format that is only 10 bits wide is defined f...

Inspired of the IEEE 754 standard, a floating point format that is only 10 bits wide is defined for a special computer. The leftmost bit is still the sign bit, the exponent is 5 bits wide and has a bias of 15, and the fractions is 4 bits long. A hidden 1 is assumed for the normal number, but not for the denormalized number.

c) Construct a case to show that floating point addition is not associative

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

(c) Example to show that floating point addition is not associative

Let suppose we want to add three numbers

let a=16, b =17, c=-4

we want to find Y = a + b + c

According to associative law

(a+b)+c = (16 + 17) +(-4)

=33 + (-4) [Since 33 is out of range it is truncated to 32]

=32 + (-4)

=28 (Ans)

a+(b+c) = 16 + (17 +(-4) )

= 16 + 13

= 29 (Ans)

It's clear that (a+b)+c is not equal to a+(b+c)

Hence floating point addition is not associative.

Now let us do the calculation using  IEEE 754 standard, a floating point format that is only 10 bits wide is defined for a special computer.

(a+b)+c = (16 + 17) +(-4)

=33 + (-4)

Let us represent 33 in IEEE 754 standard, a floating point format that is only 10 bits wide is defined for a special computer.

33 = 1000012 x 20 = 1.00001 x 25 = 1.M x 25 (Where 1 in 1.M is the hidden bit )

Sing bit, S = 0

Actual exponent, e = 5

biased exponent, E = e + 15 = 5 + 15 =20 = 101002

Mantissa, M= 00001 = 0000 (Mantissa is 4 -bit)

Therefore, 33 in IEEE 754 standard, a floating point format that is only 10 bits wide is defined for a special computer.

33 = 0 10100 0000

Let us convert A=0 10100 0000 into decimal

A = (-1)S x 1.M x 2E-15

S = 0, M=0000 i.e. 1.M=1.0000

e=E-15 = 20 - 15 =5

A = (-1)0 x 1.0000 x 220-15

=1 x 1.0000 x 25

=32

Since 33 is out of range it's truncated to 32

i.e.

(a+b)+c = (16 + 17) +(-4)

=33 + (-4) (33 is out of range and is truncated to 32 as shown above)

=32 + (-4)

=28 (Wrong result)

On the other hand , a+(b+c )= 16 + (17 +(-4))

=16 + 13 (All the numbers are within the range i.e. <= 32 , so there is no loss of precision)

= 29 (Correct result)

Hence floating point addition is not associative.

Add a comment
Know the answer?
Add Answer to:
Inspired of the IEEE 754 standard, a floating point format that is only 10 bits wide is defined f...
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
  • IEEE 754-2008 contains a half precision that is only 16 bits wide. The leftmost bit is...

    IEEE 754-2008 contains a half precision that is only 16 bits wide. The leftmost bit is still the sign bit, the exponent is 5 bits wide and has a bias of 15, and the mantissa is 10 bits long. A hidden 1 is assumed. Write down the bit pattern to represent -1.6875 X 100 assuming a version of this format, which uses an excess-16 format to store the exponent. Comment on how the range and accuracy of this 16-bit floating...

  • 4. (5 points) IEEE 754-2008 contains a half precision that is only 16 bits wide. The leftmost bit...

    4. (5 points) IEEE 754-2008 contains a half precision that is only 16 bits wide. The leftmost bit is still the sign bit, the exponent is 5 bits wide and has a bias of 15, and the mantissa is 10 bits long. A hidden 1 is assumed. Write down the bit pattern to represent-1.09375 x 10-1 assuming a version of this format, which uses an excess-16 format to store the exponent. Comment on how the range and accuracy of this...

  • IEEE 754-2008 contains a half precision that is only 16 bits wide. The leftmost bit is...

    IEEE 754-2008 contains a half precision that is only 16 bits wide. The leftmost bit is still the sign bit, the exponent is 5 bits wide and has a bias of 15, and the mantissa is 10 bits long. A hidden 1 is assumed. Write down the bit pattern to represent -1.5625 * 10-2 assuming a version of this format. Calculate the sum of 2.6125*102 and 4.150390625 * 10-1 by hand, assuming both numbers are stored in the 16-bit half...

  • Problem 5 (20 points) Consider a floating point number representation that is 16 bit wide. The...

    Problem 5 (20 points) Consider a floating point number representation that is 16 bit wide. The leftmost bit is the sign bit, and the next 5 bits from the left make up an exponent (which has a bias of 15). The remainder 10 bits give the magnitude of the number. This representation assumes a hidden 1. Consider the number -1.3215 x 10-1 How doe its rine and acrac cmpare wit a he same number, this time b) How does its...

  • 2. Represent 25.28255 in 32 bit IEEE-754 floating point format as shown in the following format...

    2. Represent 25.28255 in 32 bit IEEE-754 floating point format as shown in the following format discussed in class. Sign Bit BIT 31 Exponent BITS 30:23 Mantissa BITS 22:0 BYTE 3+1 bit 7 Bits BYTE 1 BYTE O

  • (2 pts) Express the base 10 numbers 16.75 in IEEE 754 single-precision floating point format. Express...

    (2 pts) Express the base 10 numbers 16.75 in IEEE 754 single-precision floating point format. Express your answer in hexadecimal. Hint: IEEE 754 single-precision floating-point format consists of one sign bit 8 biased exponent bits, and 23 fraction bits) Note:You should show all the steps to receive full credits) 6.7510 Type here to search

  • Question: Calculate the sum of 2.6125x101 and 4.150390625 x 10-1 by hand, assuming A and B...

    Question: Calculate the sum of 2.6125x101 and 4.150390625 x 10-1 by hand, assuming A and B are stored in the 16-bit half precision described in Exercise 1. Assume 1 guard, 1 round bit, and 1 sticky bit, and round to the nearest even. Note: show all the steps for your calculation. Exercise 1: IEEE 754-2008 contains a half precision that it is only 16 bits wide. The leftmost bit is still the sign bit, the exponent is 5 bits wide...

  • Assume a 10-bit floating point representation format where the Exponent Field has 4 bits

    Assume a 10-bit floating point representation format where the Exponent Field has 4 bits and the Fraction Field has 6 bits and the sign bit field uses 1 bit  S      Exponent Field: 4 bits       Fraction Fleld: 5 bits a) What is the representation of -8.80158 × 10-2 in this Format - assume bias =2M-1-1=24-1-1=7 (where N= number of exponent field bits) for normalized representation 1 -bias =-6 : for denormalized representationb) What is the range of representation for...

  • Calculate 1.666015625 x 10° (1.9760 x 104 + - 1.9744 x 10^) by hand, assuming each...

    Calculate 1.666015625 x 10° (1.9760 x 104 + - 1.9744 x 10^) by hand, assuming each of the values are stored in the 16-bit half precision format IEEE 754-2008. IEEE 754-2008 contains a half precision that is only 16 bits wide. The left most bit is still the sign bit, the exponent is 5 bits wide and has a bias of 15, and the mantissa is 10 bits long. A hidden 1 is assumed. Assume 1 guard, 1 round bit,...

  • Convert the following numbers to 32b IEEE 754 Floating Point format. Show bits in diagrams below....

    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

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