MOD NOTE: This post was originally a response to a long-dead thread of the same title and was split off so that any new responses won't generate notifications to long-gone participants.
It is indeed possible if your definition of a multi-input XOR is: result is high if exactly one of the inputs is high. For 3 inputs, in boolean algebra, given inputs a, b, and c, and output y (& = AND, ^ = XOR, | = OR):
y = ((a ^ b) ^ c) ^ (a & b & c)
This can be expanded to support four inputs:
y = (((a ^ b) ^ c) ^ d) ^ (a & b & c & d) ^ ((a & b & c) | (b & c & d) | (a & c & d) | (a & b & d))
and so on. It's provable by running it through a truth table.
A 3 input XOR as a circuit:
It is indeed possible if your definition of a multi-input XOR is: result is high if exactly one of the inputs is high. For 3 inputs, in boolean algebra, given inputs a, b, and c, and output y (& = AND, ^ = XOR, | = OR):
y = ((a ^ b) ^ c) ^ (a & b & c)
This can be expanded to support four inputs:
y = (((a ^ b) ^ c) ^ d) ^ (a & b & c & d) ^ ((a & b & c) | (b & c & d) | (a & c & d) | (a & b & d))
and so on. It's provable by running it through a truth table.
A 3 input XOR as a circuit:
Last edited by a moderator: