Logical XOR, or exclusive OR, returns 1 when exactly one of two binary inputs is 1. It returns 0 when both inputs agree: both are 0 or both are 1. For inputs x0 and x1, XOR can be written as ¬x0x1 + x0¬x1. section 7.2.1 section 7.5.2
The two-input truth table is:
- 0, 0 → 0: neither input is true. section 7.4.1
- 0, 1 → 1: only the second input is true. section 7.5.2
- 1, 0 → 1: only the first input is true. section 7.5.2
- 1, 1 → 0: both inputs are true, so the exclusive condition fails. section 7.2.1
Rock-music friendship recommendation
Let each input indicate whether one person likes rock music. XOR identifies disagreement: one person likes rock and the other does not. Applying NOT to XOR instead recommends friendship when both like rock or both dislike it: friendship = ¬(rockA ⊕ rockB). section 7.2.1
XOR matters for neural networks because its positive points, (0,1) and (1,0), cannot be separated from its negative points, (0,0) and (1,1), by one straight line. A single perceptron therefore cannot model XOR. Multiple perceptrons can form the required nonlinear partition. section 7.4.1 section 7.4
Figure 7.13 MLP for the logical function corresponding to table 7.1
|
(a) Perceptron for x̄0x1 |
|
(b) Perceptron for x0x̄1 |
|
(c) MLP for x̄0x1 + x0x̄1 |
Inspect the MLP construction: implement x̄0x1 and x0x̄1 with separate perceptrons, then combine the two terms with OR. section 7.5.2





