Exclusive or, exclusive disjunction, exclusive alternation, logical non-equivalence, or logical inequality is a logical operator whose negation is the logical biconditional. With two inputs, XOR is true if and only if the inputs differ (one is true, one is false). With multiple inputs, XOR is true if and only if the number of true inputs is odd. It gains the name "exclusive or" because the meaning of "or" is ambiguous when both operands are true. XOR excludes that case. Some informal ways of describing XOR are "one or the other but not both", "either one or the other", and "A or B, but not A and B". It is symbolized by the prefix operator J and by the infix operators XOR ( or ), EOR, EXOR, ∨˙, ∨‾, ∨_, ⩛, ⊕, ↮, ≢, and ^.
Definition
The truth table of A↮B shows that it outputs true whenever the inputs differ:
Equivalences, elimination, and introduction Exclusive disjunction essentially means 'either one, but not both nor none'. In other words, the statement is true if and only if one is true and the other is false. The exclusive disjunction p↮q, also denoted by p?q or Jpq, can be expressed in terms of the logical conjunction ("logical and", ∧), the disjunction ("logical or", ∨), and the negation (¬) as follows:
p↮q=(p∨q)∧¬(p∧q) The exclusive disjunction p↮q can also be expressed in the following way:
p↮q=(p∧¬q)∨(¬p∧q) This representation of XOR may be found useful when constructing a circuit or network, because it has only one ¬ operation and small number of ∧ and ∨ operations. A proof of this identity is given below:
p↮q=(p∧¬q)∨(¬p∧q)=((p∧¬q)∨¬p)∧((p∧¬q)∨q)=((p∨¬p)∧(¬q∨¬p))∧((p∨q)∧(¬q∨q))=(¬p∨¬q)∧(p∨q)=¬(p∧q)∧(p∨q) It is sometimes useful to write p↮q in the following way:
p↮q=¬((p∧q)∨(¬p∧¬q)) or:
p↮q=(p∨q)∧(¬p∨¬q) This equivalence can be established by applying De Morgan's laws twice to the fourth line of the above proof. The exclusive or is also equivalent to the negation of a logical biconditional, by the rules of material implication (a material conditional is equivalent to the disjunction of the negation of its antecedent and its consequence) and material equivalence. In summary, we have, in mathematical and in engineering notation:
p↮q=(p∧¬q)∨(¬p∧q)=pq‾+p‾q=(p∨q)∧(¬p∨¬q)=(p+q)(p‾+q‾)=(p∨q)∧¬(p∧q)=(p+q)(pq‾)
Negation of the operator By applying the spirit of De Morgan's laws, we get: ¬(p↮q)≡¬p↮q≡p↮¬q. Generally, the negation of the XOR of multiple inputs is any XOR of the same number of inputs such that an odd number of the original inputs have been negated.
Relation to modern algebra Although the operators ∧ (conjunction) and ∨ (disjunction) are very useful in logic systems, they fail a more generalizable structure in the following way: The systems ({T,F},∧) and ({T,F},∨) are monoids, but neither is a group. This unfortunately prevents the combination of these two systems into larger structures, such as a mathematical ring. However, the system using exclusive or ({T,F},⊕) is an abelian group. The combination of operators ∧ and ⊕ over elements {T,F} produce the well-known two-element field 𝔽2. This field can represent any logic obtainable with the system (∧,∨) and has the added benefit of the arsenal of algebraic analysis tools for fields. More specifically, if one associates F with 0 and T with 1, one can interpret the logical "AND" operation as multiplication on 𝔽2 and the "XOR" operation as addition on 𝔽2:
r=p∧q⇔r=p⋅q(mod2)r=p⊕q⇔r=p+q(mod2) The description of a Boolean function as a polynomial in 𝔽2, using this basis, is called the function's algebraic normal form.
Exclusive or in natural language Disjunction is often understood exclusively in natural languages. In English, the disjunctive word "or" is often understood exclusively, particularly when used with the particle "either". The English example below would normally be understood in conversation as implying that Mary is not both a singer and a poet.
1. Mary is a singer or a poet. However, disjunction can also be understood inclusively, even in combination with "either". For instance, the first example below shows that "either" can be felicitously used in combination with an outright statement that both disjuncts are true. The second example shows that the exclusive inference vanishes away under downward entailing contexts. If disjunction were understood as exclusive in this example, it would leave open the possibility that some people ate both rice and beans.
2. Mary is either a singer or a poet or both. 3. Nobody ate either rice or beans. Examples such as the above have motivated analyses of the exclusivity inference as pragmatic conversational implicatures calculated on the basis of an inclusive semantics. Implicatures are typically cancellable and do not arise in downward entailing contexts if their calculation depends on the Maxim of Quantity. However, some researchers have treated exclusivity as a bona fide semantic entailment and proposed nonclassical logics which would validate it. This behavior of English "or" is also found in other languages. However, many languages have disjunctive constructions which are robustly exclusive such as French soit... soit.
Alternative symbols The symbol used for exclusive disjunction varies from one field of application to the next, and even depends on the properties being emphasized in a given context of discussion. In addition to the abbreviation "XOR", any of the following symbols may also be seen:
… excerpt ends here. Continue reading the full article.





