Engineering Simple Binary Subtraction Question

  • Thread starter Thread starter rugerts
  • Start date Start date
  • Tags Tags
    Binary
AI Thread Summary
The discussion revolves around a binary subtraction problem where the second number is larger than the first, leading to confusion about representing a negative result. Participants clarify that in binary subtraction, if borrowing is not possible due to a lack of 1's, the result can indicate overflow or a negative value. The answer derived depends on the chosen word length, with examples given for both 7-bit and 8-bit representations. The conversation emphasizes the importance of understanding how to represent negative numbers in binary without using 1's or 2's complement methods. Ultimately, the issue of overflow and word length choice is central to the resolution of the subtraction problem.
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 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.
 
Back
Top