Search code examples
bit-manipulationbitwise-operatorsbitwise-xor

Order of precedence in sequential XOR operations


I have the following expression to calculate a parity bit:

AB0E XOR 73C9 XOR D46A XOR 06E3

How would this be evaluated? Is it:

(((AB0E XOR 73C9) XOR D46A) XOR 06E3)

or is it:

(AB0E XOR (73C9 XOR (D46A XOR 06E3)))


Solution

  • There is no difference; XOR is associative.