Is my 2's complement addition correct?

  • Thread starter TranscendArcu
  • Start date
  • Tags
    Addition
In summary, the two's complement addition in 8-bit binary for the given equations is incorrect as the numbers were not converted to decimal properly. Additionally, for two's complement addition, the numbers should be added as if they were unsigned binary numbers. The "twos complement" of 10001001 is -119.
  • #1
TranscendArcu
285
0
Do the following additions in 8-bit binary two's complement:

a) 01110110 + 10001001 = (64+32+16+4+2) + (-(64+32+16+4+2+1)) = 118 -119 = -1
b) 11010101 + 10101010 = -(64+16+4+1) + (-(64+16+4+1+1)) = -86 -87 = -171

Have I done these correctly?
 
Physics news on Phys.org
  • #2
You do understand that converting to base 10 combining adding those is NOT "twos complement" don't you?

What is the "twos complement" of 10001001.
 
  • #3
TranscendArcu said:
Do the following additions in 8-bit binary two's complement:

a) 01110110 + 10001001 = (64+32+16+4+2) + (-(64+32+16+4+2+1)) = 118 -119 = -1
b) 11010101 + 10101010 = -(64+16+4+1) + (-(64+16+4+1+1)) = -86 -87 = -171

Have I done these correctly?

For starters, you're not even converting the numbers to decimal correctly.
[tex]A = f(B) = b_02^0 +b_12^1 +b_22^2 + ... + b_{n-1}2^{n-1} -b_n2^n[/tex]
where A is the base 10 representation, B is a binary 2's complement representation of a number with n+1 digits with b_0 being the least significant digit. Note that only the last digit has a minus sign.
 
  • #4
For two's complement addition in binary, you just add the two numbers as if they were unsigned binary numbers (ignoring any carries past the most significant bit), to get the sum. I don't know if this assignment requires that you indicate if signed overflow has occurred.
 

Related to Is my 2's complement addition correct?

What is 2's Complement Addition?

2's Complement Addition is a method of binary addition used to represent negative numbers in a computer. It is commonly used to perform arithmetic operations in computer systems.

How is 2's Complement Addition calculated?

To calculate 2's Complement Addition, we first convert the numbers to their binary form. Then, we add the numbers as we would in regular binary addition. However, if the result has more bits than the original numbers, we discard the extra bit on the left and only keep the rightmost bits to represent the final result.

Why is 2's Complement Addition used?

2's Complement Addition is used because it simplifies the process of representing and performing operations on negative numbers in a computer. It also allows for the use of a single addition operation for both positive and negative numbers.

What are the advantages of using 2's Complement Addition?

The main advantage of using 2's Complement Addition is that it allows for the representation and manipulation of negative numbers using the same hardware and circuitry as positive numbers. This saves space and resources in computer systems.

Are there any limitations to 2's Complement Addition?

One limitation of 2's Complement Addition is that it has a limited range of numbers it can represent. For example, if we have 8 bits, we can only represent numbers from -128 to 127. If we want to represent larger numbers, we need to use more bits, which can become inefficient. Additionally, there are certain scenarios where 2's Complement Addition may result in an overflow, which can lead to incorrect results.

Similar threads

  • Precalculus Mathematics Homework Help
Replies
4
Views
831
  • Math Proof Training and Practice
Replies
10
Views
979
  • Introductory Physics Homework Help
Replies
9
Views
859
  • Biology and Chemistry Homework Help
Replies
4
Views
2K
  • Precalculus Mathematics Homework Help
Replies
11
Views
1K
  • Precalculus Mathematics Homework Help
Replies
6
Views
3K
  • Programming and Computer Science
Replies
3
Views
984
  • Precalculus Mathematics Homework Help
Replies
6
Views
967
  • Precalculus Mathematics Homework Help
Replies
12
Views
2K
  • Precalculus Mathematics Homework Help
Replies
3
Views
1K
Back
Top