0
$\begingroup$

It is my belief that addition in one's complement is done the same way as unsigned addition except that if there is a carry out in the most significant bit then that carry is added to the last significant bit of the answer. If I am wrong about this, please tell me.

I am going to work in 4 bits. My claim is that $-1$ is $1110$ in one's compliment. Now, I want to add $-1$ to $-1$ in one's compliment. I should get $-2$ or $1101$. Here is my work:

 1110
+1110
-----
 1000
    1
 ----
 1001

In this case, we added the one because we had a carry out of the most significant bit. However, my answer is not $-2$. Where did I go wrong?

$\endgroup$

1 Answer 1

0
$\begingroup$

Something went wrong in the addition. 1110 + 1110 is not 1000 (with carry), but 1100 (with carry). This is hopefully obvious in retrospect, after all two times 1110 had better shift that number one place to the left, by definition.

1100 plus the end-around carry is 1101 which corresponds to -2.

$\endgroup$
1
  • $\begingroup$ You are right. I did the binary addition incorrectly. $\endgroup$
    – Bob
    Jan 9, 2022 at 1:51

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.