Tens complement subtraction in binary

  • Thread starter Thread starter caljuice
  • Start date Start date
  • Tags Tags
    Binary
Click For Summary
SUMMARY

The discussion centers on performing binary arithmetic using two's complement for the operation 8 + (-2). The initial confusion arises from the incorrect reference to "ten's complement" instead of the correct "two's complement." The correct two's complement for -2 is derived by taking the one's complement of 2 (binary 0010) and adding 1, resulting in 1110. The final calculation of 8 (1000) + (-2) (1110) yields 0110, which is 6 in decimal.

PREREQUISITES
  • Understanding of binary number representation
  • Knowledge of two's complement arithmetic
  • Familiarity with binary addition
  • Basic concepts of binary overflow
NEXT STEPS
  • Study the process of converting decimal numbers to binary
  • Learn about binary addition and handling carries
  • Explore the differences between two's complement and one's complement
  • Research binary overflow and its implications in arithmetic operations
USEFUL FOR

Students studying computer science, software engineers working with low-level programming, and anyone interested in binary arithmetic and number representation.

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.
 

Similar threads

  • · Replies 4 ·
Replies
4
Views
2K
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 6 ·
Replies
6
Views
4K
Replies
1
Views
2K
  • · Replies 3 ·
Replies
3
Views
1K