I'm sorry about this, but I'm at my wit's end. I'm trying do to an incredibly simple calculation. I want to calculate 4 - 7 using the two's complement method for signed binary numbers with a 4 bit register. I've been doing this calculation over and over again for an hour and I can't get the right answer no matter how hard I try and I can't figure out why.
4 = 0100 7 = 0111
2's complement of 7 = 1000 + 1 = 1001
0100 + 1001 = 1101 = -5
This is quite obviously wrong. The answer should be 1011 = -3
I found a handful of resources online that say that the two's complement of seven is 0111, which makes the math work but has nothing to do with the method as I learned it. I feel like I'm missing something painfully obvious but I don't have a clue what it is and it's about to drive me mad. Please help me, kind nerds of math.stackexchange!