Simple Binary Subtraction Question

  • Engineering
  • Thread starter rugerts
  • Start date
  • Tags
    Binary
In summary, the question is about how to represent a negative number when subtracting binary numbers. The solution found online suggested borrowing a 1 to represent the negative number, but it is unclear where the 1 is borrowed from. The conversation also mentions the use of 1's and 2's complement as an alternative method. The final result of the subtraction depends on the chosen word length.
  • #1
rugerts
153
11
Homework Statement
Subtract the two binary numbers
Relevant Equations
none
1568595470451.png

Problem shown above. Work shown below.
1568595491081.png

My question is, at the final step, is this a negative one? I can't borrow from anything as there are no more 1's. The solution I've found online just puts a 1 out front without a minus sign and it says it borrowed a 1 to do this, but I don't know where from.

Please, don't say use 1's or 2's complement instead as that is the next section.

Thanks for your time and efforts.
 
Physics news on Phys.org
  • #2
rugerts said:
Homework Statement: Subtract the two binary numbers
Homework Equations: none

View attachment 249711
Problem shown above. Work shown below.
View attachment 249712
My question is, at the final step, is this a negative one? I can't borrow from anything as there are no more 1's. The solution I've found online just puts a 1 out front without a minus sign and it says it borrowed a 1 to do this, but I don't know where from.

Please, don't say use 1's or 2's complement instead as that is the next section.

Thanks for your time and efforts.
You would agree, wouldn't you, that the second number is larger than the first? So the difference would have to be negative? How would you represent a negative number? If you just put a ##-1## in the ##2^6## bit, the result is obviously not correct. You could just keep borrowing ##1## from the next higher bit, but you would never finish your homework. If you assume you have a computer word of finite length, though, you would eventually get to the the most significant bit and you would have to stop because there would be no place to store any more ones. So choose a word length.
 
  • #3
tnich said:
You would agree, wouldn't you, that the second number is larger than the first? So the difference would have to be negative? How would you represent a negative number? If you just put a ##-1## in the ##2^6## bit, the result is obviously not correct. You could just keep borrowing ##1## from the next higher bit, but you would never finish your homework. If you assume you have a computer word of finite length, though, you would eventually get to the the most significant bit and you would have to stop because there would be no place to store any more ones. So choose a word length.
I get what you're alluding to (the idea of overflow?). The answer to this is 1101 101. Is this a result of choice of length?
 
  • Like
Likes tnich
  • #4
rugerts said:
I get what you're alluding to (the idea of overflow?). The answer to this is 1101 101. Is this a result of choice of length?
That is the answer you would get if you chose 7 bits as your word length. An unconventional choice, but there is really nothing wrong it. If you chose 8 bits, you would get 1110 1101. You asked me not to mention 2's complement arithmetic, so I won't.
 

FAQ: Simple Binary Subtraction Question

1. What is Simple Binary Subtraction?

Simple Binary Subtraction is a basic mathematical operation used to subtract two binary numbers. It follows the same rules as traditional subtraction, but instead of using base 10 numbers, it uses numbers in the binary system (0 and 1).

2. How is Simple Binary Subtraction performed?

To perform Simple Binary Subtraction, you first need to convert the binary numbers into their decimal equivalents. Then, follow the traditional subtraction method by starting from the rightmost column and working your way to the left. If the result is a positive number, it can be written as is. If the result is a negative number, you will need to use the two's complement method to get the correct answer.

3. What is the two's complement method?

The two's complement method is used to represent negative numbers in the binary system. To get the two's complement of a number, you first need to find its one's complement (flipping all the bits). Then, add 1 to the one's complement to get the two's complement.

4. Can you provide an example of Simple Binary Subtraction?

Of course! Let's subtract 1001 from 1101. First, we convert these numbers into decimals, so we have 13 - 9. Then, we perform the subtraction, starting from the rightmost column: 1 - 1 = 0, 0 - 0 = 0, 0 - 0 = 0, and finally 1 - 1 = 0. The answer is 0 0 0 0, which is equivalent to 0 in the binary system.

5. Can Simple Binary Subtraction be performed on any binary numbers?

Yes, Simple Binary Subtraction can be performed on any binary numbers. However, if the result is a negative number, you will need to use the two's complement method to get the correct answer.

Similar threads

Replies
2
Views
2K
Replies
1
Views
2K
Replies
1
Views
1K
Replies
2
Views
10K
Replies
3
Views
3K
Replies
3
Views
3K
Replies
14
Views
2K
Back
Top