hello,

i’ve been going over this weeks material and am confused about two claims:

one claim says the MSB determines the sign of the number (1- negative, 0-positive).

another claim says something like: -[A[n-1:0]] = [INV A[n-1:0]] +1

i’m confused as to what happens if we try to negate the smallest number represented by twos complement (n bit string) (-2^(n-1)), do we get a negative number?

does two’s complement work in the same way we usually define negative integers? (-a +a = 0)? or is this something else?

thank you

Hello,

The problem you’re facing is the asymmetry in 2’s complement range. Because the smallest number representable in 2’s complement has bigger absolute value than the largest number, we cannot represent it’s negation using only n bits. This problem is dealt with using the overflow output bit in our signed adders.

This is exactly why in recitation 11 slide 15, the output string is 1 bit longer than the input string.

2’s complement is just a way of describing integers, but they’re the same integers you’re used to, the same as binary representation and even decimal representation. Integers will always have the same properties regardless of the representation.

Alon Lukatch