Tens complement subtraction in binary

  • Thread starter caljuice
  • Start date
  • Tags
    Binary
In summary, the conversation is discussing how to do 8 + (-2) in binary. The solution involves finding the ten's complement of -2, which is 1101, and adding it to 1000. This results in (1)0110, and the answer is six. There is some confusion between ten's and two's complement, but it is clarified that ten's complement is used in this case and involves adding 6 if the sum is greater than nine.
  • #1
caljuice
70
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
  • #2
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 = ?
 
  • #3
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.
 

Related to Tens complement subtraction in binary

1. What is Tens complement subtraction in binary?

Tens complement subtraction in binary is a method used to subtract two binary numbers by converting them into their tens complement form and then performing addition on the numbers. This method is commonly used in computer systems to perform subtraction operations.

2. How does Tens complement subtraction work?

In this method, the minuend (number being subtracted from) is first converted into its tens complement by inverting all the bits and adding 1 to the result. The subtrahend (number being subtracted) is then added to the tens complement of the minuend, resulting in a binary sum. The final result is obtained by taking the tens complement of this binary sum.

3. Why is Tens complement subtraction used in binary?

Tens complement subtraction is used in binary because it allows for the use of a single addition operation to perform subtraction, making it more efficient and faster than traditional subtraction methods. It also allows for the representation of negative numbers in binary without using a separate sign bit.

4. How is borrowing handled in Tens complement subtraction?

In Tens complement subtraction, borrowing is handled by adding 1 to the next digit when a borrow is needed. This is because when the minuend is converted to its tens complement, the final digit will always be a 1, ensuring that there is always a 1 available for borrowing.

5. Can Tens complement subtraction be used for decimal numbers?

No, Tens complement subtraction is only applicable for binary numbers. In order to use this method for decimal numbers, they would first need to be converted into binary form. However, this method is not commonly used for decimal numbers due to its complexity and the availability of more efficient algorithms.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
4
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
5
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
5
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
457
  • Engineering and Comp Sci Homework Help
Replies
1
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
3
Views
991
  • Engineering and Comp Sci Homework Help
Replies
2
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
7
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
7
Views
2K
Back
Top