0
votes

I've been given the directions

Add the following binary 2's compliment representation values in 16 bits, then write "overflow".

0001 0101 0111 1101 + 0111 1111 1011 1111

I've tried to understand 2's complement, and I do to an extent. But, I'm still not clear on several things. Is 2's complement only used for negative values? I think how I would solve this problem would be to start by taking each number, inverting it, adding 1, then adding them together. Is this the proper way to do it?

Thank you

1

1 Answers

0
votes

Two's compliment is a representation for handling positive and negative values in a way that allows you to follow the mechanics for doing addition as if they were positive values, but end up with the correct result even if either or both values represent negative values.

Taking the two's compliment is used to change the representation to be that of the negative of the value you started with. Since you are not asked to negate anything, you should not be doing this.