|
The EXCLUSIVE OR (XOR) gate is very commonly used in arithmetic circuits.
The XOR gate compares the inputs. If both inputs (there can only be two
inputs for this gate) are the same, the output is LOW. In contrast, if the
inputs differ, then the output is HIGH. Here is the truth table for the
XOR gate:
|
INPUT
|
OUTPUT |
| A |
B |
Y |
| 0 |
0 |
0 |
| 0 |
1 |
1 |
| 1 |
0 |
1 |
| 1 |
1 |
0 |
|
The XOR gate is most complex of all gates; it requires two AND gates, two
NOT gates, as well as an OR gate. Here is a diagram which shows how the
five gates are arranged to create the XOR gate:
The A and B inputs are both split into two to allow them to be the inputs
for two gates at the same time. The two inputs that were just created from
the split are inverted. There are two AND gates. The two original inputs
go to the different AND gates. The inverted input of A becomes the second
input of the AND gate in which B is the other input. Likewise, the
inverted input of B becomes the second input of the AND gate in which A is
the other input. The outputs of the AND gates become the inputs of the OR
gate. If either of the inputs is HIGH, then the output of the whole XOR
gate is HIGH. Otherwise, the output of the XOR gate is LOW.
Just like the two other gates in this section, the XOR gate is simplified
in diagrams. Here is the symbol used to represent the XOR gate:
|