Tens complement subtraction in binary

  • Thread starter Thread starter caljuice
  • Start date Start date
  • Tags Tags
    Binary
AI Thread Summary
The discussion revolves around performing binary addition of 8 and -2 using ten's complement, which is incorrectly referenced instead of the standard two's complement method. The user attempts to find the negative of 2 by calculating the nine's complement and adding one, leading to confusion in the addition process. Clarifications indicate that the correct approach involves using two's complement for binary operations, where -2 is represented as 1110. Ultimately, the user realizes that for binary addition, if the sum exceeds nine, an adjustment of six is needed, highlighting the importance of understanding binary representation and complement methods.
caljuice
Messages
70
Reaction score
0

Homework Statement


I want to do 8 + (-2) in binary


Homework Equations



8= 1 0 0 0
2= 0 0 1 0

The Attempt at a Solution



To find the negative of 2 I find the tens complement of it by finding nines complement and +1

7 is the nines complement = 0 1 1 1 and adding 0 0 0 1 = 1 0 0 0

1 0 0 0
+1 0 0 0
----------
1 0 0 0 0

Knocking off the carry I get all zeros. The answer should be six. What am I doing wrong?
 
Physics news on Phys.org
caljuice said:

Homework Statement


I want to do 8 + (-2) in binary


Homework Equations



8= 1 0 0 0
2= 0 0 1 0

The Attempt at a Solution



To find the negative of 2 I find the tens complement of it by finding nines complement and +1

7 is the nines complement = 0 1 1 1 and adding 0 0 0 1 = 1 0 0 0

1 0 0 0
+1 0 0 0
----------
1 0 0 0 0

Knocking off the carry I get all zeros. The answer should be six. What am I doing wrong?

Don't you mean "twos complement"? I've never heard of 10's complement. See http://en.wikipedia.org/wiki/Two's_complement.

The twos-complement form for -2 is the ones-complement for 2, plus 1, or
1101 + 1 = 1110

8 + (-2) = 1000 + 1101 = (1)0110 = ?
 
No, it's ten's complement. I can do it in two's complement.

I figured it though. For binary after adding the ten's complement to the other number, you have to add 6 to it if the sum is greater than nine.
 
Back
Top