ECE199JL:IntroductiontoComputer Engineering Fall 2012 …
Result). But 2 N= (2 −1)+1. Note that 2N −1 is the pattern of all 1 bits. Subtracting any value kfrom this value is equivalent to simply ﬂipping the bits, changing 0s to 1s and 1s to 0s. (This operation is called a 1’s complement, by the way.) We then add 1 to the result to ﬁnd the pattern for −k. Negation can overﬂow, of course.
binary 2's complement converter