Katana VentraIP

Exclusive or

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.[1]

"XOR" redirects here. For the logic gate, see XOR gate. For other uses, see XOR (disambiguation).

XOR

yes

no

yes

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 [2]: 16  and by the infix operators XOR (/ˌɛks ˈɔːr/, /ˌɛks ˈɔː/, /ˈksɔːr/ or /ˈksɔː/), EOR, EXOR, , , , , , , and .

Negation of the operator[edit]

The spirit of De Morgan's laws can be applied, we have:

was used by in 1847.[6] Although Boole used mainly on classes, he also considered the case that are propositions in , and at the time is a connective. Furthermore, Boole used it exclusively. Although such use does not show the relationship between inclusive disjunction (for which is almost fixedly used nowadays) and exclusive disjunction, and may also bring about confusions with its other uses, some classical and modern textbooks still keep such use.[7][8]

George Boole

was used by in 1883.[9] Strictly speaking, Ladd used to express " is-not " or "No is ", i.e., used as exclusions, while implicitly has the meaning of exclusive disjunction since the article is titled as "On the Algebra of Logic".

Christine Ladd-Franklin

, denoting the negation of , was used by Ernst Schröder in 1890,[10]: 307  Although the usage of as equivalence could be dated back to George Boole in 1847,[6] during the 40 years after Boole, his followers, such as Charles Sanders Peirce, Hugh MacColl, Giuseppe Peano and so on, did not use as non-equivalence literally which is possibly because it could be defined from negation and equivalence easily.

equivalence

was used by in 1894: ". The sign corresponds to Latin aut; the sign to vel."[11]: 10  Note that the Latin word "aut" means "exclusive or" and "vel" means "inclusive or", and that Peano use as inclusive disjunction.

Giuseppe Peano

was used by Izrail Solomonovich Gradshtein (Израиль Соломонович Градштейн) in 1936.: 76 

[12]

was used by in 1938.[13] Shannon borrowed the symbol as exclusive disjunction from Edward Vermilye Huntington in 1904.[14] Huntington borrowed the symbol from Gottfried Wilhelm Leibniz in 1890 (the original date is not definitely known, but almost certainly it is written after 1685; and 1890 is the publishing time).[15] While both Huntington in 1904 and Leibniz in 1890 used the symbol as an algebraic operation. Furthermore, Huntington in 1904 used the symbol as inclusive disjunction (logical sum) too, and in 1933 used as inclusive disjunction.[16]

Claude Shannon

, also denoting the negation of , was used by Alonzo Church in 1944.[17]

equivalence

(as a , ) was used by Józef Maria Bocheński in 1949.[2]: 16  Somebody[18] may mistake that it is Jan Łukasiewicz who is the first to use for exclusive disjunction (it seems that the mistake spreads widely), while neither in 1929[19] nor in other works did Łukasiewicz make such use. In fact, in 1949 Bocheński introduced a system of Polish notation that names all 16 binary connectives of classical logic which is a compatible extension of the notation of Łukasiewicz in 1929, and in which for exclusive disjunction appeared at the first time. Bocheński's usage of as exclusive disjunction has no relationship with the Polish "alternatywa rozłączna" of "exclusive or" and is an accident for which see the table on page 16 of the book in 1949.

prefix operator

^, the , has been used in several programming languages to denote the bitwise exclusive or operator, beginning with C[20] and also including C++, C#, D, Java, Perl, Ruby, PHP and Python.

caret

The of two sets and , which may be interpreted as their elementwise exclusive or, has variously been denoted as , , or .[21]

symmetric difference

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:

1 XOR 1 = 0

1 XOR 0 = 1

0 XOR 1 = 1

0 XOR 0 = 0

11102 XOR 10012 = 01112 (this is equivalent to addition without )

carry

Encodings[edit]

It is also called "not left-right arrow" (\nleftrightarrow) in LaTeX-based markdown (). Apart from the ASCII codes, the operator is encoded at U+22BB XOR (⊻) and U+2295 CIRCLED PLUS (⊕, ⊕), both in block mathematical operators.

All About XOR

Proofs of XOR properties and applications of XOR, CS103: Mathematical Foundations of Computing, Stanford University