Animation · 8 steps
Without the lower limit every calculation stays a sum. The four switch positions one after another, with Next or Play.

Top switchBottom switchNeuron Asum of switchesNeuron Bsum of switches − 1Output neuron CA − 2 · Bbias 0 1−2