OR Gate Explained: Truth Table and Simulator
An OR gate outputs 1 when at least one input is 1. Explore its truth table and test Y = A + B in the interactive mini-demo.
How an OR gate works
An OR gate produces a true output when at least one of its inputs is true. For binary inputs A and B, the output Y is 0 only when both inputs are 0; the other three combinations produce 1. The Boolean expression Y = A + B uses a plus sign for logical OR. This is not ordinary addition: when both inputs are 1, the OR output remains the single binary value 1 rather than becoming 2. The truth table makes that distinction clear.
OR is a combinational gate, so it has no stored state and responds to the present input values. A gate may have more than two inputs; its output is 1 if any one of them is 1. When a circuit has only two-input OR gates, several can be connected in a tree to combine many alternatives while preserving the same behavior.
Why OR gates matter in digital circuits
OR logic is useful when any one of several events should activate an output. For example, an alarm can turn on if a smoke sensor OR a heat sensor is active. In a full adder, multiple carry conditions are combined with OR so that any valid carry path sets the carry-out. OR gates also combine decoded control signals and merge alternative paths in a digital circuit.
Use the live demo to toggle A and B independently and compare the output with all four rows in the truth table. Then open the free logic gate simulator to connect an OR gate to input and output pads. Testing each combination helps catch a common mistake: treating logical OR as an exclusive choice. Unlike XOR, an OR gate still outputs 1 when both inputs are 1.
OR truth table
Boolean expression: Y = A + B
| A | B | Y |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 1 |
Use the interactive controls on this page to toggle the inputs and see the output change.
Frequently asked questions
When does an OR gate output 0?
A two-input OR gate outputs 0 only when both inputs are 0. Any input value of 1 makes the output 1.
Is an OR gate the same as XOR?
No. OR outputs 1 when one or both inputs are 1. XOR outputs 1 only when the inputs differ.