What you want is to bitwise invert the value, or create its "complement", swapping every 0 for a 1 and vice versa. Every language known to man has this, a single character operation. It looks like this: