Binary subtraction with borrow

542 Views Asked by At

$1000_2 - 0111_2$ = $8_{10}-7_{10} = 1_{10}$.

When there are no more on-bits to borrow from the number that is being subtracted from, is the resultings bits in the sum all zeros? (Se pic)

enter image description here

We know the result is $1$. So when there are no bits to borrow is the result zero?

1

There are 1 best solutions below

0
On BEST ANSWER

Starting from the question,

$$\begin{array}{rrrrr} &1&0&0&0\\ -&&1&1&1\\ \hline \end{array}$$

From the rightmost digit, it needs to borrow from the left, so column-wise,

$$\begin{array}{rrrrr} &1&0&0&0\\ &&&\tiny{-1}&\tiny{+10}\\ -&&1&1&1\\ \hline\\ \end{array} \longrightarrow \begin{array}{rrrrr} &1&0&0&0\\ &&&\tiny{-1}&\tiny{+10}\\ -&&1&1&1\\ \hline &&&&1 \end{array}$$

Then the twos-digit, it also needs to borrow enough from the left to subtract 1 twice,

$$\begin{array}{rrrrr} &1&0&0&0\\ &&&\tiny{-1}&\tiny{+10}\\ &&\tiny{-1}&\tiny{+10}\\ -&&1&1&1\\ \hline &&&&1 \end{array} \longrightarrow \begin{array}{rrrrr} &1&0&0&0\\ &&&\tiny{-1}&\tiny{+10}\\ &&\tiny{-1}&\tiny{+10}\\ -&&1&1&1\\ \hline &&&0&1 \end{array}$$

Then the fours-digit and up,

$$\begin{array}{rrrrr} &1&0&0&0\\ &&&\tiny{-1}&\tiny{+10}\\ &&\tiny{-1}&\tiny{+10}\\ &\tiny{-1}&\tiny{+10}\\ -&&1&1&1\\ \hline &&&0&1 \end{array} \longrightarrow \begin{array}{rrrrr} &1&0&0&0\\ &&&\tiny{-1}&\tiny{+10}\\ &&\tiny{-1}&\tiny{+10}\\ &\tiny{-1}&\tiny{+10}\\ -&&1&1&1\\ \hline &0&0&0&1 \end{array}$$

So $$1000-111=1$$