OR Gate Explorer
Interactive OR gate demonstration. Learn how OR gates work with visual feedback - any input can activate the output.
What You'll Learn
- Read and write the 2-input OR truth table from memory.
- Recognise that OR is the dual of AND — it returns 0 only when every input is 0.
- Translate "or" / "either" / "any of" English statements into Boolean OR.
- Identify OR gates inside larger circuits like alarms, interrupts, and reset trees.
- Understand why OR is commutative and associative, and why those properties matter.
How It Works
The OR gate is the digital embodiment of the word "or" in everyday language: the output is high (1) when at least one input is high. Only when every input is low (0) does the output drop to 0. With two inputs A and B, the function is Y = A + B (the plus sign denotes logical OR, not arithmetic addition).
The circuit wires two input switches into a single OR gate. Toggle either switch and the output light turns on; both off keeps it dark. Of the four possible input combinations, three drive the output high — exactly the inverse of an AND gate, where only one of four combinations produces a high output.
Two important properties: OR is commutative (A + B = B + A — input order doesn't matter) and associative ((A + B) + C = A + (B + C) — chaining gates produces the same result regardless of grouping). These properties let you build wide N-input ORs from any combination of 2-input ORs without changing the result.
Truth Table
A 2-input OR has 2² = 4 possible combinations. Only the all-zeros row produces 0; every other row produces 1.
| Inputs | Output | ||
|---|---|---|---|
| A | B | Y | |
| 0 | 0 | 0 | Both off — output low |
| 0 | 1 | 1 | One input high — output high |
| 1 | 0 | 1 | |
| 1 | 1 | 1 | Both high — output still high |
Boolean Expression
Standard form. The + denotes logical OR, not arithmetic addition.
Formal logic notation using the disjunction symbol.
De Morgan equivalent — OR equals NAND of the inverted inputs.
Try It Step-by-Step
Set the inputs in the embed above, then read what should happen and confirm.
- 1A = 0 B = 0Expected:
Y = 0What you'll see: Both switches off — the output is dark. This is the only combination that produces 0. - 2A = 1 B = 0Expected:
Y = 1What you'll see: One input high — output goes high. OR doesn't care which input lifts it, just that at least one does. - 3A = 0 B = 1Expected:
Y = 1What you'll see: Symmetry: flipping which input is high gives the same result. OR is commutative. - 4A = 1 B = 1Expected:
Y = 1What you'll see: Both inputs high — output stays high. Unlike XOR, OR doesn't flip back to 0 when both inputs match.
Components Used
Real-World Applications
Door alarm systems. Multiple sensors — window contact, motion detector, glass-break — feed an OR gate. Any one tripping triggers the alarm. This is the canonical use of OR: "trigger if any of these."
CPU interrupt lines. A processor's interrupt input is typically the OR of every peripheral that might need attention. Whichever device raises its line, the CPU sees the interrupt and reads a separate vector to find out who.
Reset propagation. "Reset on any of these conditions" — power-on, watchdog timeout, manual button, debug request — is implemented as a wide OR fed into the reset distribution network.
Status flag aggregation. "Is anything wrong?" lights on dashboards combine error bits with OR. Any individual fault lights the master warning.
Error detection in arrays. A parity-error line across 32 memory banks is the OR of each bank's local error flag — convenient single bit indicating "someone has a problem."