Define the XOR gate and write its Boolean expression.

The XOR (Exclusive OR) gate is a digital logic gate that outputs true (1) when the number of true inputs is odd. For a 2-input XOR gate, it outputs 1 when one of the inputs is 1 and the other is 0, and outputs 0 when both inputs are the same (either both 0 or both 1). The Boolean expression for a 2-input XOR gate is:

A⊕B=A′B+AB′

This expression indicates that the output is true when A and B are different.