This example shows a CMOSXOR gate. The
output is high whenever exactly one of the inputs is high,
and low otherwise. Click on the inputs
(on the left) to toggle their state.

When the first input is high, the two
MOSFETs on the left
act as an inverter, inverting the second input. The two MOSFETs on the right
form a transmission gate which is closed when
the first input is low, transmitting the second input to the output unchanged.