XOR and XNOR operations with 2 or 3 inputs