* Complement of 13&7 13 00000000 00000000 00000000 00001101 7 00000000 00000000 00000000 00000111 13&7 00000000 00000000 0 0000000 00000101 = 5 5|4 5 Complement 00000000 00000000 00000000 00000101 4 Complement 00000000 00000000 00000000 00000100 5|4 00000000 00 000000 00000000 000000101 =5-3^3-3 's complement-3 of the original code 10000000 00000000 00000000 00000011-3 Anti-code 11111111 11111111 11111111 1111110 0-3 complement 11111111 11111111 11111111 11111101 3 Complement 00000000 00000000 00000000 00000011-3^3 11111111 11111111 11111111 11111 110 "complement" push anti-code "to complement-1" 11111111 11111111 11111111 11111101 "anti-code" push the original code "symbol bit invariant other inversion" 10000000 00000000 00000000 00000010 "original Code" =-2 Note: Because binary does not have carry and abdication, can be regarded as 10-1, that is equal to 1
*
PHP bit Operation vs. XOR or negation