XOR (Exclusive OR)

Inputs

PinTypeDescription
AbitFirst input signal
BbitSecond input signal

Outputs

PinTypeDescription
Qbit1 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

ABQ
000
011
101
110

Usage

Introduced in Level 5. Used in adders, bit comparison, and error detection.

Interactive Demo

Click inputs to toggle value (0 / 1)