Simple Binary Subtraction Question

  • Context: Engineering 
  • Thread starter Thread starter rugerts
  • Start date Start date
  • Tags Tags
    Binary
Click For Summary

Discussion Overview

The discussion revolves around a binary subtraction problem, specifically addressing the representation of negative results in binary arithmetic. Participants explore the implications of borrowing in binary subtraction and the representation of negative numbers without resorting to 1's or 2's complement methods.

Discussion Character

  • Homework-related
  • Debate/contested
  • Exploratory

Main Points Raised

  • One participant questions whether the final result of the binary subtraction is negative, noting the inability to borrow from any 1's.
  • Another participant asserts that since the second number is larger than the first, the difference must be negative and discusses how to represent this in binary.
  • There is a suggestion that continuously borrowing from higher bits would lead to an unresolved situation, especially with finite word lengths in computing.
  • Participants mention the concept of overflow in relation to binary subtraction and how the choice of word length affects the result.
  • A specific answer of 1101 101 is provided, with a note that this corresponds to a 7-bit word length, while an 8-bit choice would yield a different result.

Areas of Agreement / Disagreement

Participants express differing views on how to handle the negative result in binary subtraction, with no consensus on the best approach to represent negative numbers or the implications of word length choices.

Contextual Notes

Participants have not reached a resolution regarding the borrowing process in binary subtraction or the representation of negative results, and there are limitations related to assumptions about word length and the methods of representation discussed.

rugerts
Messages
153
Reaction score
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
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.
 
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   Reactions: tnich
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.
 

Similar threads

  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
Replies
15
Views
3K
Replies
5
Views
13K
  • · Replies 10 ·
Replies
10
Views
3K
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
11K
  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 14 ·
Replies
14
Views
3K