XOR expanded to SOP — XOR gate

exam standardwhy XOR resists minimisation

Answer

A′ · B + A · B′

Why this example is worth doing

Written as a sum of products, XOR is two terms of two literals with no adjacency between them, so Quine–McCluskey and the K-map both report it as already minimal at a cost of five gates — against one gate for the XOR symbol. This is the concrete case behind the general warning that two-level minimisation optimises the wrong cost function for XOR-heavy logic, which matters because arithmetic and error-correction circuits are almost entirely XOR.

Try your own input in the XOR gate. Truth table, symbol and algebraic form for A ⊕ B, the difference detector.

How the answer is reached

Step by step

A ⊕ BA · B′ + A′ · BDefinition of XOR — A ⊕ B = A·B' + A'·B

Warning:

A ⊕ B simplifies to A · B′ + A′ · B in 1 step. That is a proven minimum (2 terms, 4 literals), not a best effort. It is the only minimum-cost form.

Quine–McCluskey

Prime implicants — Quine–McCluskey
#Term
1A′ · B
2A · B′
Minimum cover — Quine–McCluskey
#Cover
1A′ · B + A · B′
Warning:

2 term(s), 4 literal(s); 2 essential prime implicant(s).

Truth table

Truth table — columns #, A, B, F
#ABF
0000
1011
2101
3110

Compare with

Open the XOR gate

This input is entered in the tool itself — it is too rich for a link to carry.

Note:

Notation this page assumes

  • Symbols: · is AND, + is OR, ⊕ is XOR, a prime or an overline is NOT. The field also takes ∧ ∨ ¬ ~ ! & | and the words.
  • Operator precedence, tightest first: NOT, then AND (including juxtaposition), then XOR/XNOR, then NAND/NOR, then OR, then IMPLIES, then IFF.
  • Gate symbols follow whichever standard the header toggle is set to: ANSI/IEEE Std 91-1984 distinctive shapes, or IEC 60617-12 rectangles.

Sources

  • ANSI/IEEE Std 91-1984, Graphic Symbols for Logic Functions
  • IEC 60617-12, Graphical Symbols for Diagrams — Binary Logic Elements