Monday 27 May 2019

Bitwise XOR Operator (^)

Bitwise XOR Operator (^)

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

No comments:

Post a Comment

Files with Exception handling

#Ask the user to take two input integer values var a,b try:     a=int(input("enter any integer value:"))     b=int(input(&qu...