When doing binary subtraction what is the borrow in and borrow out.
Binary subtraction works just like decimal subtraction. Subtraction is done column by column, from right to left. For each column, you need to know two things:
So if we are doing decimal subtraction:
110
-98
---
For the first column, there is no previous column, so no borrow in. But there is a borrow out - we needed to borrow because 0 < 8
. The result is 2
.
For the second column, there is a borrow in from the first column, and a borrow out since 0 < 9
. The result is 1
.
For the third column there is a borrow in, but no borrow out (0 >= 0
).