Bitwise XOR Operator (^)
If a=10,b=11
Related Video: https://www.youtube.com/watch?v=Ui8F9tCTl1U&feature=youtu.be
Next Topic:
Next Topic: Operator Precedence
If a=10,b=11
a=10à1010
b=11à1011
-----------
a^b= 0001
This operator performs
exclusive or (XOR) operation on the bits of numbers. The symbol is ^ (cap
operator), carat symbol. When we have the odd number of 1’s in the input bits, we
can get the output as 1.
Truth table
a
|
b
|
a^b
|
0
|
0
|
0
|
0
|
1
|
1
|
1
|
0
|
1
|
0
|
0
|
0
|
1
|
1
|
0
|
Related Video: https://www.youtube.com/watch?v=Ui8F9tCTl1U&feature=youtu.be
Next Topic:
Next Topic: Operator Precedence
Previous Topic: Bit wise Right Shift operators (>>)
No comments:
Post a Comment