XOR (Exclusive OR)
Inputs
| Pin | Type | Description |
|---|---|---|
| A | bit | First input signal |
| B | bit | Second input signal |
Outputs
| Pin | Type | Description |
|---|---|---|
| Q | bit | 1 if A≠B |
How It Works
XOR outputs 1 when the two inputs differ. It acts as a "controlled inverter": when B=1, the output is the inverse of A; when B=0, the output equals A.
Truth Table
| A | B | Q |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
Usage
Introduced in Level 5. Used in adders, bit comparison, and error detection.