OR
OR is a connective in logic which yields true if any one of a sequence conditions is
true, and false if all
conditions are false. In formal logic, the term disjunction
(or, more specifically, inclusive disjunction) is commonly used to describe the OR
operator. ๐ A
OR ๐ B
is denoted ๐ A v B
(Mendelson 1997, p. 13), ๐ A|B
,
๐ A+B
(Simpson 1987, p. 539), or ๐ A union B
(Simpson 1987, p. 539).
The circuit diagram symbol for an OR gate is illustrated above.
The symbol ๐ v
derives from the first letter of the
Latin word "vel," meaning "or," and the expression ๐ A v B
is voiced either "๐ A
or ๐ B
"
or "๐ A
vel ๐ B
." The way to distinguish the similar symbols ๐ ^
(AND) and ๐ v
(OR) is to note that the symbol for AND is oriented in the
same direction as the capital letter 'A." The OR operation is implemented in
the Wolfram Language as [A,
B, ...].
The OR operation can be written in terms of NOT and AND as
(Mendelson 1997, p. 26).
The binary OR operator has the following truth table (Carnap 1958, p. 10; Simpson 1987, p. 542; Mendelson 1997, p. 13).
| ๐ A | ๐ B | ๐ A v B |
| T | T | T |
| T | F | T |
| F | T | T |
| F | F | F |
A product of ORs is called a disjunction and is denoted
For example, the truth table for the ternary OR operator is shown below (Simpson 1987, p. 543).
| ๐ A | ๐ B | ๐ C | ๐ A v B v C |
| T | T | T | T |
| T | T | F | T |
| T | F | T | T |
| T | F | F | T |
| F | T | T | T |
| F | T | F | T |
| F | F | T | T |
| F | F | F | F |
A bitwise version of OR can also be defined that performs a bitwise OR on the binary digits of two numbers ๐ x
and ๐ y
and then converts the resulting binary
number back to decimal. Bitwise OR is sometimes denoted ๐ AโฅB
and is implemented in the Wolfram
Language as [n1,
n2, ...]. The illustration above plots the bitwise OR of the array of numbers
from ๐ -31
to 31 (Wolfram 2002, p. 871).
See also
AND, Binary Operator, Connective, Disjunction, Exclusive Disjunction, Inclusive Disjunction, Logic, NAND, NOR, NOT, Truth Table, Union, Vee, XNOR, XORExplore with Wolfram|Alpha
More things to try:
References
Carnap, R. Introduction to Symbolic Logic and Its Applications. New York: Dover, pp. 7 and 10, 1958.Mendelson, E. Introduction to Mathematical Logic, 4th ed. London: Chapman & Hall, p. 13, 1997.Simpson, R. E. "The OR Gate." ยง12.5.1 in Introductory Electronics for Scientists and Engineers, 2nd ed. Boston, MA: Allyn and Bacon, pp. 542-544, 1987.Wolfram, S. A New Kind of Science. Champaign, IL: Wolfram Media, 871, 2002.Referenced on Wolfram|Alpha
ORCite this as:
Weisstein, Eric W. "OR." From MathWorld--A Wolfram Resource. https://mathworld.wolfram.com/OR.html
