2
$\begingroup$

I'm being asked this question for my computer conceptes class, can't find anything about this in my text book, and have only been able to find half-baked answers googling it.

Why is binary subtraction referred to as the invert-add-shift-add method?

$\endgroup$
1
  • $\begingroup$ I think it's a silly question (on behalf of your instructor). I'd prefer the name "complement-add". $\endgroup$ Feb 4, 2013 at 0:44

1 Answer 1

5
$\begingroup$

I found an excellent answer here, which I summarize below.

Given two number $A,B$ in binary notation, we calculate $A-B$ by adding to $A$ the two's complement of $B$. Since the two's complement of $B$ is formed by inverting all bits of $B$ and adding $1$, one way to implement this idea is invert $B$, add the result to $A$, shift the carry $1$ bit (which will appear if $A\geq B$), and add it (i.e. $1$) to the result.

$\endgroup$
1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.