Two inputs
The inputs are a = 0, b = 1. Tap an input node to type 0 or 1; the network computes all four cases.
The first hidden neuron
h₁ is a neuron with a step activation and bias −0.50. With the default weights it fires when at least one input is 1, that is it computes OR. Now h₁ = 1.
The second hidden neuron
h₂ also has a step activation, with bias −1.50. With the default weights it fires only when both inputs are 1, that is it computes AND. Now h₂ = 0.
The output neuron
The output neuron adds h₁ and h₂ with the weights v₁ and v₂, bias −0.50. With the default weights it fires when OR holds but AND does not; that is the definition of exclusive or. The output is y = 1.
Four cases
0 for (0, 0), 1 for (0, 1), 1 for (1, 0), 0 for (1, 1). 4 of the four rows of exclusive or are right.
The hidden layer bends the space
The hidden layer moves each input to an (h₁, h₂) pair: (0, 0) → (0, 0), (0, 1) → (1, 0), (1, 0) → (1, 0), (1, 1) → (1, 1). With the default weights (0, 1) and (1, 0) land on the same spot; in the new space a single line separates the two classes, and that is exactly what the output neuron does.
Why it matters
Here we picked the weights by hand. The real power is that weights are learned from data: the backpropagation topic will show it. Even a network with one hidden layer, given enough neurons, can get as close as needed to any continuous function.