OpenStax-CNX module: m46620 1 Secondary Logic Functions: NAND/NOR/XOR/XNOR/Buffer George Self This work is produced by OpenStax-CNX and licensed under the Creative Commons Attribution License 3.0 Abstract Boolean Algebra is used to mathematically describe, and simplify, digital circuits. It includes a number of primary and secondary logic functions. This module denes and illustrates the secondary logic functions (NAND/NOR/XOR/XNOR/Buer) with both mathematical equations and logic diagrams. 1 NAND A NAND gate is a Boolean function that is the opposite of an AND gate ("NOT AND"). It will output a logical zero, or false, only if all of the inputs are true. note: As a matter of interest, NAND and NOR gates are said to to be universal. That is, given enough of either of these gates, the operation of any other gate or function (even complete complex circuits) can be mimicked. For example, it is possible to build an OR circuit using three interconnected NAND gates. In fact, some logic systems have been designed around nothing but either NAND or NOR gates; with all the necessary logic functions being derived from interconnected collections of these gates. Following is the truth table for a NAND gate. Version 1.1: May 24, 2013 3:52 pm -0500 http://creativecommons.org/licenses/by/3.0/ 0 1 1 1 0 1 Table 1: Truth Table for NAND Gate
OpenStax-CNX module: m46620 2 In the following diagram, the input variables A and B are wired to a NAND gate, and the output from Figure 1: 2-Input NAND Gate. tip: The logic diagram symbol for a NAND gate looks like an AND gate, but with a small circle on the output pin. A circle (usually called a "bubble") in a logic diagram always represents some sort of signal inversion, and it can appear at the inputs or outputs of nearly any logic gate. For example, the bubble on a NAND gate could be interpreted as "take whatever the output is for the AND gate, and then invert it." As a nal note, bubbles are never found by themselves on a wire; they are always associated with a logic gate. To invert a signal on a wire, a NOT gate is used. 2 NOR A NOR gate is a Boolean function that is the opposite of an OR gate ("NOT OR"). It will output a logical one, or true, only if all of the inputs are false. Following is the truth table for a NOR gate. 0 1 0 1 0 0 Table 2: Truth Table for NOR Gate In the following diagram, the input variables A and B are wired to a NOR gate, and the output from Figure 2: 2-Input NOR Gate.
OpenStax-CNX module: m46620 3 3 XOR An XOR ("Exclusive OR") gate is a Boolean function that will output a logical one, or true, only if the two inputs are dierent. This is useful for circuits that compare inputs; if the inputs are dierent, then the output will be true, otherwise it is false. The XOR function is not often used in Boolean equations (though it is not so uncommon in physical circuits); but when necessary, it is represented by a plus sign inside a circle. Here is an example: Following is the truth table for an XOR gate. A B = Q (1) 0 0 0 0 1 1 1 0 1 Table 3: XOR Truth Table In the following diagram, the input variables A and B are wired to a XOR gate, and the output from Figure 3: XOR Gate 4 XNOR An XNOR gate (sometimes called an "equivalence" gate) is a Boolean function that will output a logical one, or true, only if the two inputs are the same. Following is the truth table for an XNOR gate.
OpenStax-CNX module: m46620 4 0 1 0 1 0 0 1 1 1 Table 4: XNOR Gate In the following diagram, the input variables A and B are wired to a XNOR gate, and the output from Figure 4: XNOR Gate 5 Buer A buer (sometimes called transfer) is a Boolean function that will transfer the input to the output without change. If the input is true, then the output will be true; if the input is false, then the output will be false. It may seem to be an odd function since the gate does not change anything; but it has an important use in a circuit. As logic circuits become more complex, the signal from input to output may become weak and no longer able to drive (or activate) additional gates. A buer is used to boost (and stabilize) a logic level so it is more dependable. Cleaning up a signal is one other important function done by a buer. When an electronic circuit interacts with the physical world (for example, when a user pushes a button), there is often a very brief period when the signal from that physical device waivers between high and low unpredictably. A buer can smooth out that signal so it is a constant high or low without a lot of spikes in between. There is no symbol to indicate a buer in a Boolean equation since it does nothing to change the input. Following is the truth table for buer. 0 0 0 1 1 1 Table 5: Buer Truth Table
OpenStax-CNX module: m46620 5 In the following diagram, the input variable A is transferred to output Y by a buer. Notice that a buer looks like a NOT gate, but lacks the bubble on the output. Figure 5: Buer