Question

In: Computer Science

Determine for 5-bits system, if there is any overflow or carry produced from the addition of...

Determine for 5-bits system, if there is any overflow or carry produced from the addition of following decimal numbers: [4*5 = 20 Marks]
a. -9 and -10
b. -14 and 14
c. 12 and -13
d. 9 and 12

Solutions

Expert Solution

Ans 1. -9 and -10

In the above problem we have two signed numbers -9 and -10.

As we know to add two signed numbers in binary we have to take 2's complement of negative numbers.

Note: 2's Complement is done by first complimenting true binary digit and then adding +1 to it. eg. -9 is 11001 where MSB is a signed digit (0 for positive and 1 for negative numbers). First complement of 1001 is 0110 and then by adding +1, 2's complement is 0111.

Decimal Sign digit Binary form 2's Complement

    -9 1 1001 0111

    -10 1 1010 0110

On adding 2's complement of -9 and -10, we get

-9 = 1 0111

-10 = 1 0110

___________

         101101

Now, MSB is 1 denoting negative and 01101 is in 2's complement form. When we retake 2's complement form, we get 10011 that is 19 in decimal and hence the final output is -19 in decimal.

Note: The result is having an additional bit because in binary we need 5 bits required to represent 19 whereas 9 and 10 requires only 4 bits.

Ans 2. -14 and 14

In the above problem we have two equal and opposite numbers.

Decimal Sign digit Binary form 2's Complement

    -14 1 1110 0010

     14 0 1110 NA

On adding 2's complement of -14 and 14, we get

-14 = 1 0010

14 = 0 1110

___________

         1 0 0000

The extra 1 gets discarded/removed and the final result is 00000.

Ans 3. 12 and -13

In the above problem we have one positive and one larger negative number.

Decimal Sign digit Binary form 2's Complement

     12 0 1100 NA

    -13 1 1101 0011

On adding 2's complement of 12 and -13, we get

12 = 0 1100

-13 = 1 0011

___________

            1 1111

The final sum is represented in complemented form and on retaking 2's complement we get 0001 and MSB 1 shows negative numbers. Hence the final result is -1 in decimal.

Ans 4. 9 and 12

In the above problem we have both positive numbers or unsigned numbers.

Decimal Sign digit Binary form 2's Complement

        9 0 1001 NA

      12 0 1100 NA

On adding 2's complement of 12 and -13, we get

   9 = 0 1001

12 = 0 1100

___________

           010101

The final sum is 10101 that is 21 and MSB is 0 means positive number.

Note: The extra bit is because 21 requires 5 bits whereas 9 and 12 requires only 4 bits.


Related Solutions

A company uses a ranking system of values from 0 to 5 to determine pay raise...
A company uses a ranking system of values from 0 to 5 to determine pay raise percentage and new salary for employees. Create the code for a python application that prompts the user for the annual performance ranking for an employee and their current salary.   Your code should use the annual performance ranking to determine the pay raise percentage based on the table below, then calculate the new annual salary ( salary + raise) in dollars. Assume rankings are only...
5) A company wants to determine if its employees have any preference among 5 different 5)...
5) A company wants to determine if its employees have any preference among 5 different 5) health plans which it offers to them. A sample of 200 employees provided the data below. Find the P-value to test the claim that the probabilities show no preference. Use α = 0.01. plan 1 2 3 4 5 Employees 55 32 65 30 18 I have given you the observed frequencies, you must find the expected frequencies, hint: We would expect 20% to...
Determine the mass of calcium phosphate that can be produced from the reaction of 3.75 g...
Determine the mass of calcium phosphate that can be produced from the reaction of 3.75 g of calcium chloride with a 4.35 g of potassium phosphate.
1. State and explain any four (5) attributes of a good tax system?
1. State and explain any four (5) attributes of a good tax system?
Identify and discuss any five (5) major functions performed by the financial system.
Identify and discuss any five (5) major functions performed by the financial system.
determine how many grams of N2 are produced from the reaction of 9.70 g of H2O2...
determine how many grams of N2 are produced from the reaction of 9.70 g of H2O2 and 5.08 g of N2H4. 2H2O+N2H4= 4H2O+N2
3. Determine if the outcome is unusual. Consider as unusual any result that differs from the...
3. Determine if the outcome is unusual. Consider as unusual any result that differs from the mean by more than 2 standard deviations. That is, unusual values are either less than or greater than   According to AccuData Media Research, 36% of televisions within the Chicago city limits are tuned to "Eyewitness News" at 5:00 pm on Sunday nights. At 5:00 pm on a given Sunday, 2500 such televisions are randomly selected and checked to determine what is being watched. a)...
Absolute or 100% ethanol is produced from a mixture of 95% ethanol and 5% water using...
Absolute or 100% ethanol is produced from a mixture of 95% ethanol and 5% water using the Keyes distillation process. A third component, benzene, is added to lower the volatility of the alcohol. Under these conditions, the overhead product is a constat-boiling mixture of 18.5% ethanol, 7.4% water and 74.1% benzene. Use the following data to calculate the volume of benzene that should be fed to the still in order to produce 250 litres of absolute ethanol: density of 100%...
Brief Exercise 4-5 Bramble Corporation had income from operations of $6,285,800. In addition, it suffered an...
Brief Exercise 4-5 Bramble Corporation had income from operations of $6,285,800. In addition, it suffered an unusual and infrequent pretax loss of $781,200 from a volcano eruption, interest revenue of $15,910, and a write-down on buildings of $50,000. The corporation’s tax rate is 30%. Prepare a partial income statement for Bramble beginning with Income from operations. The corporation had 4,961,500 shares of common stock outstanding during 2017. (Round earnings per share to 2 decimal places, e.g. 1.48.)
Search Engines carry national identities and cultures. Compare major search engines from ANY TWO continents/countries, based...
Search Engines carry national identities and cultures. Compare major search engines from ANY TWO continents/countries, based on their local markets, strategies, and national characteristics?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT