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?
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...
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.
#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.
a) If you have five capacitors with capacitances 1.1 × 10-6 F, 3.5 × 10-6 F,...
a) If you have five capacitors with capacitances 1.1 × 10-6 F, 3.5 × 10-6 F, 5.5 × 10-6 F, and two 8.6 × 10-6 F in series. What is the equivalent capacitance of all five? b) Initially the capacitors are uncharged. Now a 7 V battery is attached to the system. How much charge is on the positive plate of the 5.5 × 10-6 F capacitor? c)What is the potential difference between the plates of the 5.5 × 10-6...
1a. 569 (base 10)=_________(base 3) SHOW WORK 1b. 357 (base 9)=___________(base 3) SHOW WORK 1c. 10011100...
1a. 569 (base 10)=_________(base 3) SHOW WORK 1b. 357 (base 9)=___________(base 3) SHOW WORK 1c. 10011100 (base 2)=__________(base 10) SHOW WORK
A certain weak base has a Kb of 7.50 × 10-7. What concentration of this base...
A certain weak base has a Kb of 7.50 × 10-7. What concentration of this base will produce a pH of 10.02?
A certain weak base has a Kb of 7.70 × 10-7. What concentration of this base...
A certain weak base has a Kb of 7.70 × 10-7. What concentration of this base will produce a pH of 10.03?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT