a⊕b =(? a ∧ b) ∨ (a ∧? b)
If the values of a and b are different, the XOR result is 1. If the values of a and b are the same, the XOR result is 0.
XOR is also called half addition, and its algorithm is equivalent to binary addition without carry: in binary, 1 stands for true and 0 stands for false, so the algorithm of XOR is: 0 ⊕ 0 = 0, 1 = 1, 0 ⊕ 1.
Extended data:
XOR operation rules:
1、⊕ a = 0
⊕b =⊕a
3.、a ⊕b⊕c = a⊕(b⊕c)=(a⊕b)⊕c;
4.d = a ⊕ b ⊕ c can be deduced as A = D ⊕ B ⊕ C.
5.、a ⊕ b ⊕ a = b
6. If X is a binary number 0 10 1, Y is a binary number101;
X⊕y= 1 1 10.
Only when the two compared bits are different, the result is 1, otherwise the result is 0.
That is, "0 when the two inputs are the same, and 1 when they are different"!
Baidu Encyclopedia-XOR