The disjunction or OR of a set of operands is true if any of them is true. With two inputs, is only when both are .

000
011
101
111

Disjunction is the analogue of set union. The corresponding hardware element is the OR gate.

In digital circuits, a parallel connection of two switches realizes OR — current flows if either path is closed. As with AND in CMOS, the output polarity flips: two NMOS in parallel in the pull-down network conduct (and so pull the output low) when either input is high, giving — NOR, not OR. To produce a true OR output you build NOR followed by an inverter.

This is inclusive OR — true when any input is true, including the case where both are. The version that’s true only when exactly one input is true is the XOR.

Notation

The symbol in formal logic and Boolean algebra is . In electronics, OR is written with a . Don’t confuse with arithmetic addition — in Boolean algebra, , not . In code, | is bitwise OR and || is short-circuit OR.

Identities to remember: , , . See Boolean Algebra for everything else.