Two conditions for one output
Imagine two signals: A means “permission” and B means “button pressed.” With AND, Y is 1 only when both are 1. If either is 0, the output is 0. The truth table lists all four possibilities, including those you are not currently testing.
Switch to XOR: with A = 1 and B = 1, the output becomes 0. XOR means the inputs differ, not just that one or more are active. This distinction is useful in digital comparators and adders.
Seven operations, one convention
- AND (&): all inputs must be 1.
- OR (≥1): at least one input must be 1.
- NOT (1 with inversion bubble): inverts its single input.
- NAND: inverts the AND output.
- NOR: inverts the OR output.
- XOR (=1): exactly one of the two inputs is 1.
- XNOR: inverts XOR; 1 when the inputs match.
We use rectangular IEC-style symbols. The small output circle means inversion, not a connection. An arrow marks the active truth-table row as well as background color. Each button announces its state through both text and its accessible state.
A bit is not a universal voltage
0 and 1 are ideal logic states, not necessarily 0 V and 5 V. Thresholds depend on the logic family and supply voltage. This tool does not model floating inputs, propagation delays, contact bounce or undefined states.
NOT uses only A and has two rows. The other six gates use exactly two inputs and four rows. XOR means “exactly one” in this two-input case.
Common mistakes
- Confusing OR with XOR when both inputs are on.
- Applying the inversion bubble to one input when the diagram places it at the output.
- Assuming a disconnected input is automatically 0 in a real circuit.
Try it yourself
When is NAND 0?
Only with A = 1 and B = 1. AND gives 1 and inversion turns it into 0.
Which gate detects matching inputs A and B?
XNOR gives 1 for 00 and 11, and 0 for 01 and 10.