Bitwise XOR (exclusive or or exclusive disjunction) ( ^
) like the other operators (except ~
) takes two equal-length bit patterns. The XOR operator outputs a 1
whenever the inputs do not match.
XOR Truth Table
Input A Input B Output
0 0 0
0 1 1
1 0 1
1 1 0