Question

In: Computer Science

3.5 (base 10) == 01000000011000000000000000000000 (base 2) -2.0625 (base 10) == 11000000000001000000000000000000 (base 2) -7.21875 (base...

3.5 (base 10) == 01000000011000000000000000000000 (base 2)
-2.0625 (base 10) == 11000000000001000000000000000000 (base 2)
-7.21875 (base 10) == 11000000111001110000000000000000 (base 2)

Calculate 3.5 * -2.0625 (= -7.21875) using the algorithm for floating point multiplication. You must show work for credit!

Solutions

Expert Solution

In single precison point format with 32 bit representation we can represent a number as

sign                    fraction/significand/mantissa (23 bits)
 |                      /                                     \
 |  exponent (8 bits)  /                                       \
 |   /           \    /                                         \
 0  1 0 0 0 0 0 0 0  1 0 0 1 0 0 1 0 0 0 0 1 1 1 1 1 1 0 1 1 0 1 1

Similarly a given number can be represented with the format

by using these two concepts we can rewrite the numbers as

01000000011000000000000000000000 = 0 10000000 11000000000000000000000   

(sign) 128 6291456

So this number could be represented like (-1)0     * 2(128-127) * (1+6291456*2-23)   = 1*21*1.75 = 2

11000000000001000000000000000000 = 1 10000000 00001000000000000000000

(sign) 128 262144

So this number could be represented like (-1)1 * 2(128-127) * (1+262144*2-23)   = -1*2*1.03125 =2.0625

Their multiplication can do in separate.

That is sign part is multiplied first

So (-1)0 * (-1)1 = (-1)1 = -1 ( this represents the result is a negative number so we can use 1 as the first bit in the answer)

Now we are multiplying the exponential part

21  * 21 = 22 ( So the multiplication result will be 22 )

Now we need to multiply the mantissa part

Finally we will get the result as (-1)1 * 22 * (1+6750208*2-23) = (-1)1 * 4 * 1.8046825 = -7.21875


Related Solutions

QUESTION 2 (2.5 + 2 + 3.5 + 2 = 10 marks) The length of time...
QUESTION 2 (2.5 + 2 + 3.5 + 2 = 10 marks) The length of time before roof tiles need replacing has a mean of 20 years and a standard deviation of 6 years. The length of time until a roof tile needs replacement is also found to have an approximately normal distribution. What is the proportion of roof tiles that last for more than 22 years? Show all working, define the variable, state the distribution and give your answer...
How to convert 12345 from base 10 to base 2?
How to convert 12345 from base 10 to base 2?
convert the binary number(base 2) To Octal (base 8) to decimal (base 10) a. 101 b....
convert the binary number(base 2) To Octal (base 8) to decimal (base 10) a. 101 b. 1001 c. 101010 d.1101101 convert the number to the other base a. 253 base 10 to base 8 b. 98 base 10 to base 3 C. 1340 base 10 to base 16 D. AB Base 16 to base 8 E. 111010 base 2 to base 16 F. 1010101 base 2 to base 6 g. 69 base 10 to base 2 h . 1023 base...
Convert 101 from base-2 number system to base-10 number system Convert 101 from base-2 number system...
Convert 101 from base-2 number system to base-10 number system Convert 101 from base-2 number system to base-16 number system Convert 100 from base-10 number system to base-2 number system Convert 100 from base-10 number system to base-16 number system Convert ef from base-16 number system to base-2 number system Convert ef from base-16 number system to base-10 number system
Write a Java program named BinaryConversion that will convert base 2 numbers to base 10 numbers....
Write a Java program named BinaryConversion that will convert base 2 numbers to base 10 numbers. The data for this program will be entered from the keyboard using JOptionPane one 16-bit binary number at a time. Note that each base 2 number is actually read in as a String. The program should continue until a 16-bit base 2 number consisting of all 0’s is entered. Once the 16-bit number has been entered your program should make sure that the input...
Suppose you are converting 273332 (base 10) to base 2 using the subtraction method. What is...
Suppose you are converting 273332 (base 10) to base 2 using the subtraction method. What is the decimal number you have left for conversion after 3 steps?
1) BOH is a weak Base. Kb = 2 x 10^-5. The pH of a 0.1M...
1) BOH is a weak Base. Kb = 2 x 10^-5. The pH of a 0.1M solution is? 2) A 0.1M solution of BCl is prepared. Kb for BOH is 6 x 10-6 . What is the solution’s pH?
Use a change of base formula to convert log4.5 9000 to base 10.
Use a change of base formula to convert log4.5 9000 to base 10.
Consider the reaction IO−4(aq)+2H2O(l)⇌H4IO−6(aq);Kc=3.5×10−2IO4−(aq)+2H2O(l)⇌H4IO6−(aq);Kc=3.5×10−2 If you start with 22.0 mLmL of a 0.908 MM solution of...
Consider the reaction IO−4(aq)+2H2O(l)⇌H4IO−6(aq);Kc=3.5×10−2IO4−(aq)+2H2O(l)⇌H4IO6−(aq);Kc=3.5×10−2 If you start with 22.0 mLmL of a 0.908 MM solution of NaIO4NaIO4, and then dilute it with water to 500.0 mLmL, what is the concentration of H4IO−6H4IO6− at equilibrium?
#2) Hydrazine (N2H4) is a weak base (Kb = 9.6 x 10-7). A student prepares a...
#2) Hydrazine (N2H4) is a weak base (Kb = 9.6 x 10-7). A student prepares a solution by adding an unknown mass of hydrazine to a flask of water with a total volume of 2.00 L. The resulting solution had a pH of 9.01. Calculate the mass of hydrazine that was initially dissolved in the flask. Be sure to include an acid-base equilibrium equation and an ICE table.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT