Multi-Switch OR Gate System
Multiple OR gates controlling a lighting system. Any switch can turn on the lights. Great for understanding parallel control systems.
Lo que aprenderás
- Apply OR-gate logic to multi-switch parallel-control systems.
- Read a 4-input OR truth table and identify the single all-zeros row that produces 0.
- Compare OR-based switch control to AND-based — and pick the right pattern.
- Understand why adding a switch to an OR-controlled lamp is trivial (just add an input).
- See OR's associativity in action: chained 2-input ORs equal a single wide OR.
Cómo funciona
This circuit demonstrates the classic application of OR gates in lighting control: any one of several switches can independently turn on a lamp. Picture a long corridor with switches at both ends — flip either, the lights come on. Real installations sometimes use 3-way or 4-way switches (which are XOR-style, not OR), but the OR pattern is what you want when adding new switches in parallel.
Four input switches feed a 4-input OR gate (or equivalently, three cascaded 2-input ORs). With four inputs, OR produces 16 possible combinations; only one (all switches off) leaves the light dark.
The key insight: OR enforces "trigger if any of these," so adding a switch is just adding an input. Compare to AND-based control, where adding a switch makes the system *harder* to activate (requiring it plus all the others to be on).
This is also a good place to see why OR is associative: chaining OR(OR(A, B), OR(C, D)) gives the same output as a single 4-input OR. The internal grouping is invisible to the result.
Tabla de verdad
Four switches into a 4-input OR. With 16 possible combinations, only the all-off state keeps the lamp dark.
| Entradas | Salida | ||||
|---|---|---|---|---|---|
| S1 | S2 | S3 | S4 | Lamp | |
| 0 | 0 | 0 | 0 | 0 | All off — lamp dark |
| 0 | 0 | 0 | 1 | 1 | |
| 0 | 0 | 1 | 0 | 1 | |
| 0 | 1 | 0 | 0 | 1 | |
| 1 | 0 | 0 | 0 | 1 | Any one switch on — lamp on |
| 1 | 1 | 1 | 1 | 1 | All on — lamp on (no extra brightness) |
Expresión booleana
4-input OR — output is 1 if any input is 1.
Same expression with explicit pairing — associativity guarantees the result is identical.
De Morgan equivalent: NOT(AND of inverses).
Pruébalo paso a paso
Configura las entradas en la simulación de arriba, lee qué debería suceder y verifícalo.
- 1S1 = 0 S2 = 0 S3 = 0 S4 = 0Esperado:
Lamp = 0Lo que verás: All four switches off — lamp dark. The only combination of 16 that keeps it off. - 2S1 = 1 S2 = 0 S3 = 0 S4 = 0Esperado:
Lamp = 1Lo que verás: Single switch on — lamp on. OR fires on the first 1 it sees. - 3S1 = 0 S2 = 1 S3 = 1 S4 = 0Esperado:
Lamp = 1Lo que verás: Two switches on — lamp still on. OR doesn't get "more on" with multiple high inputs. - 4S1 = 1 S2 = 1 S3 = 1 S4 = 1Esperado:
Lamp = 1Lo que verás: All on — lamp on. The output is binary: 0 or 1, no scaling.
Componentes utilizados
Aplicaciones en el mundo real
Multi-switch lighting. Hotel hallways, parking garages, and warehouses use OR-gated control so any switch in the area turns lights on. Adding a new switch just adds another OR input.
Vehicle headlight beam-up. Headlight high-beam can be triggered by the manual stalk switch OR by an auto-flash switch — either path lights the beam. The two paths OR into the same lamp driver.
Pump and fan control with redundancy. A circulation pump runs if any of multiple thermostats requests cooling. Adding a thermostat just adds an OR input — no rewiring of the existing logic needed.
Multi-source enable signals. "Allow data flow if requested by CPU or DMA controller" — both requesters drive lines that OR into a single bus-grant signal.
Building access control with multiple credentials. Door unlocks if a master key is presented OR a valid badge is scanned OR a valid PIN is typed. The unlock signal is the OR of all valid credential paths.