Primary
XOR Gate ○꠹|Definition|1st|20251119205401-00-⌔
XOR gate
The XOR gate (sometimes EOR, or EXOR and pronounced as exclusive OR, ksor or sometimes EX-OR) is a digital logic gate that gives a true (1 or HIGH) output when the number of true inputs is odd. An XOR gate implements an exclusive or () from mathematical logic; that is, a true output results if one, and only one, of the inputs to the gate is true. If both inputs are false (0/LOW) or both are true, a false output results. XOR represents the inequality function, i.e., the output is true if the inputs are not alike otherwise the output is false. A way to remember XOR is “must have one or the other but not both”.
An XOR gate may serve as a “programmable inverter” in which one input determines whether to invert the other input, or to simply pass it along with no change. Hence it functions as a inverter (a NOT gate) which may be activated or deactivated by a switch.12
XOR can also be viewed as addition modulo 2. As a result, XOR gates are used to implement binary addition in computers. A half adder consists of an XOR gate and an AND gate. The gate is also used in subtractors and comparators.3
The algebraic expressions or or or all represent the XOR gate with inputs A and B. The behavior of XOR is summarized in the truth table shown on the right.
Printed 2026-06-28.
(echo:: @ ᯤ)
Link to original Footnotes
Broesch, James D. (2012). Practical Programmable Circuits: A Guide to PLDs, State Machines, and Microcontrollers. Elsevier Science. p. 20. ISBN 978-0323139267. ↩
Van Houtven, Laurens (2017). Crypto 101 (PDF). p. 17. ↩
Fletcher, William (1980). An engineering approach to digital design. Prentice-Hall. p. 98. ISBN 0-13-277699-5. ↩
Secondary
• • •