For example, suppose I have x XOR y = y XOR x = z
. Is it possible to have something like a XOR b = z
?
Short answer: Yes
Long answer: XOR is a binary operation, it works on the individual bits and it's commutative.
It has the truth table:
A B Q
0 0 0
0 1 1
1 0 1
1 1 0
As the number is made up of these bits then the result will be the same as long as for each bit position the two bits have the same result. For example take the 2 eight bit numbers 113 and 42
113 = 01110001
42 = 00101010
XOR = 01011011 = 91
but if I swap the fourth bit from the left I get
97 = 01100001
58 = 00111010
XOR = 01011011 = 91
So yes again...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With