Question

In: Computer Science

What is the 8-bit sum of the following 2’s complement numbers: 11101100+00001101? Show your work.

What is the 8-bit sum of the following 2’s complement numbers: 11101100+00001101? Show your work.

Solutions

Expert Solution

Finding sum of numbers in 2's complement format is similar to finding the sum of unsigned numbers.What we need to take care while finding the sum is whaether there is an overflow or not.We need to check on overflow .In this case we have 2 8 bit numbers and that is too be stored on a 8-bit register as well.If there is an overflow then the result is invalid.

Here are few of my examples to illustate how addition takes place in 2's complement system taking care of the overflow .

One thing is to be noted that an overflow in 2's complement form doesnt always mean that the result is invalid.Following are the times when an overflow occurs:--

The rules for detecting overflow in a two's complement sum are simple:

  1. If the sum of two positive numbers yields a negative result ,there is an overflow.
  2. If the sum of two negative numbers yields a positive result, the sum has an overflow.
  3. Otherwise, the sum has not overflowed.

It is important to note the overflow and the carry in and carry out.If both carry in and carry out are not equal,then there is an overflow and the result is invalid result.

Few examples on binary addition of numbers :--

-39 + 92 = 53:

1 1 1 1
1 1 0 1 1 0 0 1
+ 0 1 0 1 1 1 0 0
0 0 1 1 0 1 0 1

Carryout without overflow. Sum is correct.

-19 + -7 = -26:

1 1 1 1 1 1
1 1 1 0 1 1 0 1
+ 1 1 1 1 1 0 0 1
1 1 1 0 0 1 1 0

Carryout without overflow. Sum is correct.

43 + 46 = 89:
1 1 1
0 0 1 0 1 1 0 1
+ 0 0 1 0 1 1 1 0
0 1 0 1 1 0 1 1

No overflow nor carryout.

• 104 + 45 = 149:
1 1 1
0 1 1 0 1 0 0 0
+ 0 0 1 0 1 1 0 1
1 0 0 1 0 1 0 1

Overflow, no carryout. Sum is not correct.

.

127 + 1 = 128:

1 1 1 1 1 1 1
0 1 1 1 1 1 1 1
+ 0 0 0 0 0 0 0 1
1 0 0 0 0 0 0 0

Overflow, no carryout. Sum is not correct.

HERE IS THE ANSWER TO PROBLEM ASKED THE ABOVE EXAMPLES WILL HELP TO UNDERSTAND THIS BETTER:--

-20 + 13 = -7

1 1
1 1 1 0 1 1 0 0
+ 0 0 0 0 1 1 0 1
1 1 1 1 1 0 0 1

" No overflow nor carryout. SUM IS =-7 AND IS CORRECT ."


Related Solutions

Please show all work: Determine the 2’s complement equivalent of the following numbers in 8-bit format...
Please show all work: Determine the 2’s complement equivalent of the following numbers in 8-bit format (N.B: You must show your work for full credit)! -12 = -9 =
What decimal number is represented by the binary 2’s complement 8-bit number 11100111? Show your work
What decimal number is represented by the binary 2’s complement 8-bit number 11100111? Show your work
Convert -18 to 8-bit sign magnitude, 1's complement and 2's complement.
Convert -18 to 8-bit sign magnitude, 1's complement and 2's complement.
Convert -18 to 8-bit sign magnitude, 1's complement and 2's complement.
Convert -18 to 8-bit sign magnitude, 1's complement and 2's complement.
Convert -18 to 8-bit sign magnitude, 1's complement and 2's complement.
Convert -18 to 8-bit sign magnitude, 1's complement and 2's complement.
Convert -122 to 8-bit sign magnitude, 1's complement and 2's complement
Convert -122 to 8-bit sign magnitude, 1's complement and 2's complement
Convert -122 to 8-bit sign magnitude, 1's complement and 2's complement
Convert -122 to 8-bit sign magnitude, 1's complement and 2's complement
Convert -122 to 8-bit sign magnitude, 1's complement and 2's complement
Convert -122 to 8-bit sign magnitude, 1's complement and 2's complement
add the following numbers using 16-bit 2's complement. show all the steps and calculations. Please also...
add the following numbers using 16-bit 2's complement. show all the steps and calculations. Please also show steps to verify that the answer is correct. -7493 and -6372
7 – For the following operations: • write the operands as 4-bit 2's complement binary numbers,...
7 – For the following operations: • write the operands as 4-bit 2's complement binary numbers, • perform the operation shown, • show all work in binary operating on 4-bit numbers, and • identify overflow if necessary. a) 4 + 2 b) 4 – 2 c) 2 – 4 d) 4 + 4
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT