Negating a number in two's complement: what's the algorithm and why does it work?

Published --