The binary of 4 "00000100" If you do a complement if becomes "11111011" which is actually -5. Just remember this when you do a complement on a positive number the resulting negative number will be one greater than the original positive number with a negative sign.

~4 = -(4+1)

When we are doing a complement we are actually doing a two's complement.