Deriving the XOR Function

Direct links to other logic pages:


Combinational Logic: [Basic Gates] [Derived Gates] [The XOR Function] [Binary Addition] [Multiplexer] [Decoder/Demultiplexer]
Sequential Logic: [RS NAND Latch] [Clocked RS Latch] [RS Flip-Flop] [JK Flip-Flop] [D Latch] [Flip-Flop Symbols]
Counters: [Basic 4-Bit Counter]
Registers: (Coming Soon)


Return to Digital index page.
Return to Play-Hookey Home Page.

On the previous page we stated that the Exclusive-OR, or XOR function can be described verbally as, "Either A or B, but not both." In the realm of digital logic there are several ways of stating this in a more detailed and precise format. We won't go here into such devices as Truth tables and graphic representations. We will stick with the more complete verbal statement, "NOT A and B, or A and NOT B."

The circuit required to implement this description is shown below:






Derived XOR function

The practical problem with the circuit above is that it contains three different kinds of gates: AND, OR, and NOT. While this illustrates a practical application using all three of the basic gate types, it is cumbersome to construct on a printed circuit board.

There are commercial packages which contain four XOR gates, but often only a single XOR function is wanted in a given application. What is also wanted is a way to create that function with a single IC package.

This can easily be done with a single quad two-input NAND gate, as shown in the circuit below:






XOR from only NAND gates

There are many ways in which the simple logic gates we have examined can be combined to perform useful functions. Some of these circuits produce outputs which are only dependent upon the current logic states of all inputs. These are called combinational logic circuits. Other circuits are designed to actually remember the past states of their inputs, and to produce outputs based on those past signals as well as the current states of their inputs. These circuits can act in accordance with a sequence of input signals, and are therefore known as sequential logic circuits.

In these pages, we will look first at combinational circuits. Then we will move on to sequential circuits. If you wish to skip immediately to sequential circuits, use the navigational links at the top of this page to select the type of circuit you would like to examine.

Previous Digital Index Next
Derived Logic Gates Return to Digital Page Binary Addition
Back to the Play-Hookey main page.