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...
Question 1 i) A binary system uses 8-bits to represent an analog value ranging from 120...
Question 1 i) A binary system uses 8-bits to represent an analog value ranging from 120 ounces to 700 ounces, determine the resolution of the system and interprete your result. ii) Determine the number of bits that would be needed for the above resolution to improve to better than 0.01 ounces per increment. Interpret your results. iii) Use the binary coded decimal (BCD) representation of integers to represent each of the following integers. 2194 4576 7865 3947 3782
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.
Determine the theoretical yield and the percent yield if 21.8 g of K2CO3 is produced from...
Determine the theoretical yield and the percent yield if 21.8 g of K2CO3 is produced from reacting 27.9 g KO2 with 29.0 L of CO2 (at STP).   The molar mass of KO2 = 71.10 g/mol and K2CO3 = 138.21 g/mol.
Specify in detail of the joint notation system of the robot used Any robot from any...
Specify in detail of the joint notation system of the robot used Any robot from any brand: FANUC Yaskawa Motoman ABB KUKA
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
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.
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)...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT