0

$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?

  • Don't understand what the question is exactly. Does your example illustrate your question? – Allawonder Dec 28 '19 at 17:35
  • 3
    You borrow from the digit on the left? Binary subtraction works similar to decimal subtraction. How do you subtract $111_{10}$ from $1000_{10}$? – an4s Dec 28 '19 at 17:36

1 Answers1

1

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$$

peterwhy
  • 22,256