XOR Calculator
Perform bitwise exclusive OR (XOR) operations on binary, decimal, and octal numbers
Calculate XOR Operation
XOR Operation Results
Operation: 0 ⊕ 0 = 0
Binary operation: 00000000 ⊕ 00000000 = 00000000
Step-by-Step Calculation
Bit Position | A | B | A ⊕ B | Explanation |
---|---|---|---|---|
7 | 0 | 0 | 0 | 0 ⊕ 0 = 0 |
6 | 0 | 0 | 0 | 0 ⊕ 0 = 0 |
5 | 0 | 0 | 0 | 0 ⊕ 0 = 0 |
4 | 0 | 0 | 0 | 0 ⊕ 0 = 0 |
3 | 0 | 0 | 0 | 0 ⊕ 0 = 0 |
2 | 0 | 0 | 0 | 0 ⊕ 0 = 0 |
1 | 0 | 0 | 0 | 0 ⊕ 0 = 0 |
0 | 0 | 0 | 0 | 0 ⊕ 0 = 0 |
Example Calculation
XOR of 80 and 100 (8-bit)
Number 1: 80 (decimal) = 01010000 (binary)
Number 2: 100 (decimal) = 01100100 (binary)
XOR Result: 52 (decimal) = 00110100 (binary)
Bit-by-bit XOR
0⊕0=0, 1⊕1=0, 0⊕1=1, 1⊕0=1, 0⊕0=0, 0⊕1=1, 0⊕0=0, 0⊕0=0
Result: 00110100
XOR Truth Table
2-Input XOR (A ⊕ B)
A | B | A ⊕ B |
---|---|---|
0 | 0 | 0 |
0 | 1 | 1 |
1 | 0 | 1 |
1 | 1 | 0 |
3-Input XOR (A ⊕ B ⊕ C)
A | B | C | Result |
---|---|---|---|
0 | 0 | 0 | 0 |
0 | 0 | 1 | 1 |
0 | 1 | 0 | 1 |
0 | 1 | 1 | 0 |
1 | 0 | 0 | 1 |
1 | 0 | 1 | 0 |
1 | 1 | 0 | 0 |
1 | 1 | 1 | 1 |
XOR Properties
Commutative
A ⊕ B = B ⊕ A
Associative
(A ⊕ B) ⊕ C = A ⊕ (B ⊕ C)
Self-Inverse
A ⊕ A = 0
Identity
A ⊕ 0 = A
Understanding XOR (Exclusive OR) Operation
What is XOR?
XOR (exclusive OR) is a logical operation that compares input bits and produces an output. The result is 1 (true) when the input bits are different, and 0 (false) when they are the same.
XOR Logic Rule
- •If both bits are the same (0,0 or 1,1): output is 0
- •If bits are different (0,1 or 1,0): output is 1
- •For 3+ inputs: result is 1 if odd number of 1s
Boolean Expression
A ⊕ B = A·B̄ + Ā·B
Where Ā means NOT A, B̄ means NOT B
Applications of XOR
Cryptography
Used in encryption algorithms and one-time pads
Error Detection
Parity checking in data transmission
Data Storage
RAID systems for data protection
Computer Arithmetic
Binary addition without carry
XOR vs Other Operations
XOR vs OR: XOR excludes the case where both inputs are 1
XOR vs AND: XOR includes cases where only one input is 1
Also called: Exclusive OR, EXOR, EOR, mod-2 addition