December 2012
Beginner
552 pages
12h 58m
English
The bitwise exclusive-OR operator, which is often called the XOR operator, works as follows: For corresponding bits of the two operands, if either bit is a 1 (but not both bits), the corresponding bit of the result is a 1; otherwise, it is a 0. The truth table for this operator is as shown.
b1 b2 b1 ^ b2———————————————————————0 0 00 1 11 0 11 1 0
If w1 and w2, were set equal to hexadecimal 5e and d6, respectively, the result of w1 exclusive-ORed with w2 would be hexadecimal e8, as illustrated:
w1 0000 0000 0101 1110 0x5ew2 0000 0000 1011 0110 ^ 0xd6———————————————————————————————————— 0000 0000 1110 1000 0xe8
Read now
Unlock full access