2’s complement (cont’d)
Example in 4 bits:
How do we represent -6?
6 in binary is 0110
Invert: 1001
Add 1: 1010
Note that if we do the same again, we get the original bit stream.
Also note that the msb conveniently tells us the sign of the number.
Previous slide
Next slide
Back to first slide
View graphic version