A perceptron is one artificial neuron. It multiplies inputs by weights, adds a bias and applies a threshold to predict a class. With two inputs, its decision boundary is a straight line. Train it on AND, OR or NAND, then try XOR. The plot updates after each epoch (one full pass through the truth table).
Each dot is one row of the truth table, placed at its two input values. Blue dots have output 1 and orange dots have output 0. The dotted square joins the four input pairs. The solid line is the perceptron's decision boundary. A dashed ring marks a row it still gets wrong.