Logic Gates: OR

The OR logic gate takes two bits as an input. Its output follows the rule: "if at least one of the bits is $1$, output $1$; otherwise, output $0$." This gate acts exactly as the "or" operator in programming does: given the Boolean variables $x$ and $y$, the symbol: $x || y$ (

$x || y$
), $x \lor y$, or $x + y$ means "$x$ or $y$". You may also use the bitwise $|$ operator: $x | y$.

Below is the OR gate diagram and truth table.

OR Gate diagram.

OR Gate diagram. Miriam Briskman, CC BY-NC 4.0.

Input Output
$x$ $y$ $x + y$
$0$ $0$ $0$
$0$ $1$ $1$
$1$ $0$ $1$
$1$ $1$ $1$
OR truth table