Was du lernst

  • 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.

So funktioniert es

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.

Wahrheitstabelle

A 2-input OR has 2² = 4 possible combinations. Only the all-zeros row produces 0; every other row produces 1.

Eingänge Ausgang
AB Y
00 0 Both off — output low
01 1 One input high — output high
10 1
11 1 Both high — output still high

Boolescher Ausdruck

Y=A+BY = A + B

Standard form. The + denotes logical OR, not arithmetic addition.

Y=ABY = A \lor B

Formal logic notation using the disjunction symbol.

Y=ABY = \overline{\overline{A} \cdot \overline{B}}

De Morgan equivalent — OR equals NAND of the inverted inputs.

Schritt für Schritt ausprobieren

Stelle die Eingänge in der Einbettung oben ein, lies was passieren sollte und überprüfe es.

  1. 1
    A = 0 B = 0
    Erwartet: Y = 0
    Was du siehst: Both switches off — the output is dark. This is the only combination that produces 0.
  2. 2
    A = 1 B = 0
    Erwartet: Y = 1
    Was du siehst: One input high — output goes high. OR doesn't care which input lifts it, just that at least one does.
  3. 3
    A = 0 B = 1
    Erwartet: Y = 1
    Was du siehst: Symmetry: flipping which input is high gives the same result. OR is commutative.
  4. 4
    A = 1 B = 1
    Erwartet: Y = 1
    Was du siehst: Both inputs high — output stays high. Unlike XOR, OR doesn't flip back to 0 when both inputs match.

Verwendete Komponenten

Praxisanwendungen

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."

Häufig gestellte Fragen

Is OR the same as inclusive-or in English?
Yes. Boolean OR is the inclusive sense: "A or B or both." The exclusive sense ("A or B but not both") is XOR — a different gate.
Why does + mean OR instead of addition?
It's a notational convention from George Boole's algebra. In Boolean expressions, + is OR and · is AND — different operators that share symbols with arithmetic for historical reasons.
Can I build an OR gate using only NAND gates?
Yes. NAND is universal — any logic function, including OR, can be built from NANDs alone. Specifically: A OR B = NAND(NOT A, NOT B), and NOT A = NAND(A, A).
What's the OR of more than two inputs?
It's high if any input is high. Wide ORs are typically built from 2-input ORs chained together; gate associativity guarantees the result is the same regardless of grouping.
What's the difference between OR and XOR?
OR returns 1 when at least one input is 1 (including when both are 1). XOR returns 1 only when an odd number of inputs are 1 — it's 0 when both inputs are 1. They differ on exactly the row where both inputs are high.

Weiterlernen