6

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)))

rdasxy
  • 1,641
  • 4
  • 16
  • 22
  • 1
    XOR is addition without carry, so the order is not important. AB0E XOR 73C9 XOR D46A XOR 06E3 = AB0E XOR 06E3 XOR 73C9 XOR D46A – dbasnett Dec 09 '11 at 13:31

2 Answers2

17

There is no difference; XOR is associative.

Oliver Charlesworth
  • 267,707
  • 33
  • 569
  • 680
0

Since expressions have the same level or priority, so precedence will be left to right