# Homework Help: Tens complement subtraction in binary

1. Oct 10, 2011

### caljuice

1. The problem statement, all variables and given/known data
I want to do 8 + (-2) in binary

2. Relevant equations

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

3. 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?

2. Oct 10, 2011

### Staff: Mentor

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 = ?

3. Oct 10, 2011

### caljuice

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.