How to subtract $(101110.01)_2$ from $(110011.10)_2$?

187 Views Asked by At

My attempt:

enter image description here

My answer is wrong. The correct answer is 101.01:

enter image description here


I don't understand why I'm getting the wrong answer here. The problem seems to be in this column:

enter image description here

If I get a $0$ as the result there in that column, then everything will be good, but $1-0=1$, how can I get a $0$ there?

1

There are 1 best solutions below

0
On BEST ANSWER

You can't borrow from $0$, so you need to go one column further. Now the $1$ in column 7 (numbering from the right) becomes $0$ and in column 6 you have $(10)$ from which you can borrow $1$ to do column 5.

After that you have $1$ in column 6 and $0$ in column 7.

But it's much simpler if you add the complement (I'll omit the period that can be just reinserted at the end). The complement is $01000110$ and you add $$ \begin{array}{rr} 11001110 & + \\ 01000110 \\ \hline 100010100 \end{array} $$ You then remove the highest bit and add $1$ to get $$ 10101 $$ Why is this so? We have computed $$ x=11001110+(11111111-10111001)=11001110+(100000000-1-10111001) $$ and therefore $$ 11001110-10111001=x-100000000+1 $$