in reply to Flipping partial bits
This sounds like converting one's complement to two's complement number?
If so, if the number is negative then add one.