I recently needed an XOR gate, but only had NAND gates on hand. NAND (and NOR) gates are sometimes known as “universal” logic elements, as it is possible to contruct any other type of logic gate with them. So while a little wasteful, I’m using the four NAND gates of a single 74LS132 chip to produce one XOR gate. As always, all notes, schematics and code are in the Little Electronics & Arduino Projects repo on GitHub