Question

3. Assume that a floating-point number system has base 2, word length 32 bits, mantissa length...

3. Assume that a floating-point number system has base 2, word length 32 bits, mantissa length 24 bits, and does rounding. Assume also that the first bit is implicit. Represent the numbers 1/2, 2/3 and 3/5 as floating-point numbers in this system. (Hint: For less confusion, you might want to write out all 25 binary digits.)

Homework Answers

Answer #1

2/3 = 0.666666.....

In binary equivalent number is 0.101010101010101010101010 (in 24 bits)

= 1.01010101010101010101010 x 2-1

Since mantissa must be represent as 1.bbbbbbbbbbbb...

i.e.1 in integer part, remaining part at fraction part, and adjust exponent in such a way that the value remains same.

Therefore mantissa = 01010101010101010101010

For 8 bits exponent, 127 bias is used.

so, add the exponent -1 added with bias 127, that is 126. [ -1 + 127 = 126 ]

Now, binary representation of 126 is 0111 1110 (in 8 bits)

For positive number sign bit is 0

Therefore, 2/3 can be represented in 32 bit floating point number system has base 2 is:

sign bit exponent mantissa
0 01111110 01010101010101010101010

3/5 = 0.6

In binary equivalent number is 0.100110011001100110011001  (in 24 bits)

= 1.00110011001100110011001 x 2-1

Since mantissa must be represent as 1.bbbbbbbbbbbb...

i.e.1 in integer part, remaining part at fraction part, and adjust exponent in such a way that the value remains same.

Therefore mantissa = 00110011001100110011001

For 8 bits exponent, 127 bias is used.

so, add the exponent -1 added with bias 127, that is 126 [ -1 + 127 = 126 ]

Now, binary representation of 126 is 0111 1110

For positive number sign bit is 0

Therefore, 3/5 can be represented in 32 bit floating point number system has base 2 is:

sign bit exponent mantissa
0 01111110 00110011001100110011001

1/2 = 0.5

In binary equivalent number is 0.100000000000000000000000 (in 24 bits)

= 1.00000000000000000000000 x 2-1

Since mantissa must be represent as 1.bbbbbbbbbbbb...

i.e.1 in integer part, remaining part at fraction part, and adjust exponent in such a way that the value remains same.

Therefore mantissa = 00000000000000000000000

For 8 bits exponent, 127 bias is used.

so, add the exponent -1 added with bias 127, that is 126 [ -1 + 127 = 126 ]

Now, binary representation of 126 is 0111 1110 (in 8 bits)

For positive number sign bit is 0

Therefore, 1/2 can be represented in 32 bit floating point number system has base 2 is:

sign bit exponent mantissa
0 01111110 00000000000000000000000

N.B The given hint more confusion, "all 25 binary digits" means what?

In 32 bits representation, 1 bit sign, 8 bits exponent and 24 bits mantissa (including 1 in integer part) is used here.

If you want 24 bits mantissa (excluding 1 in integer part) then please share with me. I'll modify the answer.

Then also mention the number of exponent bits (I think that should be 7 bits, and 1 sign bit)

Know the answer?
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
Similar Questions
For each of the following, assume that we are using a 32-bit system with single-precision (32-bit)...
For each of the following, assume that we are using a 32-bit system with single-precision (32-bit) floating point numbers (floats) in IEEE format, double-precision (64-bit) doubles in IEEE format, and 32-bit integers. Which of the following evaluate to true for all argument values? (Circle each that is always true). char c = .. int x = .. short y = .. float f = .. double d = .. c == (char)(float) c y == (short)(int) y f == (float)(double)...
Base Conversion One algorithm for converting a base 10 number to another base b involves repeatedly...
Base Conversion One algorithm for converting a base 10 number to another base b involves repeatedly dividing by b. Each time a division is performed the remainder and quotient are saved. At each step, the dividend is the quotient from the preceding step; the divisor is always b. The algorithm stops when the quotient is 0. The number in the new base is the sequence of remainders in reverse order (the last one computed goes first; the first one goes...
1. The memory units that follow are specified by the number of words times the number...
1. The memory units that follow are specified by the number of words times the number of bits per word. How many address lines and input/output data lines are needed in each case? (a) 8K X 16 (b) 2G X 8 (c) 16M X 32 (d) 256K X 64 2. Give the number of bytes stored in each memory unit in question 1. 3. Word number 563 decimal in the memory shown in Fig. 7.3 (see Mano-Ch7.pdf) contains the binary...
Use Python 3.8: Problem Description Many recipes tend to be rather small, producing the fewest number...
Use Python 3.8: Problem Description Many recipes tend to be rather small, producing the fewest number of servings that are really possible with the included ingredients. Sometimes one will want to be able to scale those recipes upwards for serving larger groups. This program's task is to determine how much of each ingredient in a recipe will be required for a target party size. The first inputs to the program will be the recipe itself. Here is an example recipe...
1) Describe an example of each of the following that may be found of your kitchen:...
1) Describe an example of each of the following that may be found of your kitchen: Explain how your choice falls into this category, and if there is a chemical name or symbol for it, provide that as well. Provide a photo of your example with your ID card in it. a) a compound b) a heterogeneous mixture c) an element (symbol) Moving to the Caves… Lechuguilla Caves specifically. Check out this picture of crystals of gypsum left behind in...
Please answer the following Case analysis questions 1-How is New Balance performing compared to its primary...
Please answer the following Case analysis questions 1-How is New Balance performing compared to its primary rivals? How will the acquisition of Reebok by Adidas impact the structure of the athletic shoe industry? Is this likely to be favorable or unfavorable for New Balance? 2- What issues does New Balance management need to address? 3-What recommendations would you make to New Balance Management? What does New Balance need to do to continue to be successful? Should management continue to invest...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT