x and y are 4 bit signed numbers (2s complement..)
x - y can be obtained by:
!(!x + y)
I know that in 2s complement
-y = (!y + 1)
So I can pretty much understand how this works:
x - y = x + (!y + 1)
But, what sort of magic is going on in here, how does this work:
!(!x + y)
I mean, when I do the math with pen and paper all is fine, but I do not know why it is working..