OR Gate Explorer
Interactive OR gate demonstration. Learn how OR gates work with visual feedback - any input can activate the output.
学べること
- 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.
仕組み
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.
真理値表
A 2-input OR has 2² = 4 possible combinations. Only the all-zeros row produces 0; every other row produces 1.
| 入力 | 出力 | ||
|---|---|---|---|
| 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 |
ブール式
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.
順を追って試す
上の埋め込み回路で入力を設定し、期待される結果と一致するか確認しましょう。
- 1A = 0 B = 0期待値:
Y = 0観察ポイント: Both switches off — the output is dark. This is the only combination that produces 0. - 2A = 1 B = 0期待値:
Y = 1観察ポイント: One input high — output goes high. OR doesn't care which input lifts it, just that at least one does. - 3A = 0 B = 1期待値:
Y = 1観察ポイント: Symmetry: flipping which input is high gives the same result. OR is commutative. - 4A = 1 B = 1期待値:
Y = 1観察ポイント: Both inputs high — output stays high. Unlike XOR, OR doesn't flip back to 0 when both inputs match.
使用コンポーネント
実世界での応用
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."