THE XOR GATE
The XOR gate is an electronic circuit that performs exclusive disjunction. The output of the XOR Boolean operator is true when precisely one of the two inputs is true. Otherwise, the output is false.
Consider the following scenario. You come to class without writing instruments, and so your good but very sensitive friend makes you an offer: you may have either the pen or the pencil. Clearly your friend is not meaning to offer you both the pen and the pencil. Your friend, too, must write. Hence, you really may only have one of them, not both. Table 1 lists the possible situations that may arise from your choices.
Observe that because your friend is a sensitive person, you are essentially required to take one of the offers; otherwise, your friends feelings will be hurt. If you refuse to take one, your friend will think you are upset and so will be sad. If you take both, your friend will think you are inconsiderate and so will be angry. You must take one, and only one. Such is the XOR function.
It is typical in engineering to use 1 instead of TRUE and 0 instead of FALSE. Therefore we rewrite the data from Table 1 in Table 2 accordingly.
For greater detail on the logic significance of the XOR function, read the Boolean algebra article.
In order to apply the principles of Boolean algebra to create real machines that can think and make decisions, we have had to find ways to physically implement the logic operators AND, OR, NOT, etc. To that end, modern day engineering uses transistor networks called logic gates. Hence, a logic gate is actually a group of transistors so arranged as to behave as a Boolean operator. Figure 1 below shows a transistor circuit that implements the XOR logic function on its input signals.
The use of transistors to build logic gates is quite modern. Before transistors we used other devices, such as vacuum tubes (aka thermionic valves). And very soon we may use DNA, or some other abundant material. There are many types of transistors. Our circuit in Figure 1, for example, uses complementary metal–oxide semiconductor (CMOS) technology. Our choice of CMOS is arbitrarily based on the fact that CMOS is by far the dominant technology in use today. The dominance is due to how well CMOS performs in all the important categories: fabrication cost, packing density, loading capacity (i.e. fan–out), operational speed (i.e. propagation delay), noise margin, and power dissipation (i.e. green technology).
There is of course more to transistors than can be presented here; especially since transistors are used for more than just digital systems. And so we refer you to any good micro–electronics textbook.
Below we show four additional typical constructions of the XOR gate. Each of the constructions presents specific conveniences to designers. If you are very new to digital systems design, you may not understand the importance of the figures below. Still, we include them in this article for the people who may need them.