XOR gate truth table

Dave

Joined Nov 17, 2003
6,969
Ah i see the error of my ways in posting an erroneous question. The main thing that got me confused was how to analyse A xor B xor C xor D. I guess i just assumed that something like a 4 input XOR gate existed.
The XOR function can accommodate any number of inputs. Whether a physical XOR-gate exists with more than 2-inputs is one thing, as is whether we defined XOR purely in terms of exclusive disjunction hence limiting the XOR-gate to 2-inputs.

If you are dealing with XOR-gates in an academic capacity then you will come across XOR-gates with more than 2-inputs. Hence it is worthwhile noting the rule I mentioned before.

Dave
 

bloguetronica

Joined Apr 27, 2007
1,544
Ah i see the error of my ways in posting an erroneous question. The main thing that got me confused was how to analyse A xor B xor C xor D. I guess i just assumed that something like a 4 input XOR gate existed.
You can assume ((A xor B) xor C) xor D, or any other number of combinations.

The XOR function can accommodate any number of inputs. Whether a physical XOR-gate exists with more than 2-inputs is one thing, as is whether we defined XOR purely in terms of exclusive disjunction hence limiting the XOR-gate to 2-inputs.

If you are dealing with XOR-gates in an academic capacity then you will come across XOR-gates with more than 2-inputs. Hence it is worthwhile noting the rule I mentioned before.

Dave
The confusion starts when you have more than two inputs. Take these examples:

Gate 1 truth table:
Rich (BB code):
A B C  O
0 0 0  0
0 0 1  1
0 1 0  1
0 1 1  0
1 0 0  1
1 0 1  0
1 1 0  0
1 1 1  0
This can be considered an XOR gate, as it is true for A, or B, or C, but not for A and B, or A and C, or B and C, or A and B and C.

Gate 2 truth table:
Rich (BB code):
A B C  O
0 0 0  0
0 0 1  1
0 1 0  1
0 1 1  0
1 0 0  1
1 0 1  0
1 1 0  0
1 1 1  1
This gate behaves like an XOR gate with one input connected to the other XOR gate's output. It is true if the number of true inputs is odd.

My question is: What would be the correct definition of a 3 input XOR gate?
 

Dave

Joined Nov 17, 2003
6,969
My question is: What would be the correct definition of a 3 input XOR gate?
Gate 2 would be. This is by virtue of the fact the XOR-gate follows the associative property of addition. Therefore:

\(1\otimes1\)\(\otimes1\) is the same as \((1\otimes1)\)\(\otimes1\)

Furthermore it also follows the commutative property of addition, therefore the position of the bracket is irrelevant.

Dave
 
Top