XNOR gate truth table | |||
---|---|---|---|
Input | Output | ||
A | B | A XNOR B | |
The XNOR gate (sometimes ENOR, EXNOR, NXOR, XAND and pronounced as Exclusive NOR) is a digital logic gate whose function is the logical complement of the Exclusive OR (XOR) gate.[1] It is equivalent to the logical connective (
\leftrightarrow
The algebraic notation used to represent the XNOR operation is
S=A\odotB
(A+\overline{B}) ⋅ (\overline{A}+B)
A ⋅ B+\overlineA ⋅ \overlineB
There are two symbols for XNOR gates: one with distinctive shape and one with rectangular shape and label. Both symbols for the XNOR gate are that of the XOR gate with an added inversion bubble.
XNOR gates are represented in most TTL and CMOS IC families. The standard 4000 series CMOS IC is the 4077, and the TTL IC is the 74266 (although an open-collector implementation). Both include four independent, two-input, XNOR gates. The (now obsolete) 74S135 implemented four two-input XOR/XNOR gates or two three-input XNOR gates.
Both the TTL 74LS implementation, the 74LS266, as well as the CMOS gates (CD4077, 74HC4077 and 74HC266 and so on) are available from most semiconductor manufacturers such as Texas Instruments or NXP, etc.[2] They are usually available in both through-hole DIP and SOIC formats (SOIC-14, SOC-14 or TSSOP-14).
Datasheets are readily available in most datasheet databases and suppliers.
An XNOR gate can be implemented using a NAND gate and an OR-AND-Invert gate, as shown in the following picture. [3] This is based on the identity
\overline{a\veebarb}\iff\left(a\overline{ ∧ }b\right)\overline{ ∧ }\left(a\lorb\right)
An alternative, which is useful when inverted inputs are also available (for example from a flip-flop), uses a 2-2 AND-OR-Invert gate, shown on below on the right.
CMOS implementations based on the OAI logic above can be realized with 10 transistors, as shown below. The implementation which uses both normal and inverted inputs uses 8 transistors, or 12 if inverters have to be used.
Both the 4077 and 74x266 devices (SN74LS266, 74HC266, 74266, etc.) have the same pinout diagram, as follows:
Pinout diagram of the 74HC266N, 74LS266 and CD4077 quad XNOR plastic dual in-line package 14-pin package (PDIP-14) ICs.
If a specific type of gate is not available, a circuit that implements the same function can be constructed from other available gates. A circuit implementing an XNOR function can be trivially constructed from an XOR gate followed by a NOT gate. If we consider the expression
(A+\overline{B}) ⋅ (\overline{A}+B)
As alternative, if different gates are available we can apply Boolean algebra to transform
(A+\overline{B}) ⋅ (\overline{A}+B)\equiv(A ⋅ B)+(\overlineA ⋅ \overlineB)
(A ⋅ B)+\overline{(A+B)}
An XNOR gate circuit can be made from four NOR gates. In fact, both NAND and NOR gates are so-called "universal gates" and any logical function can be constructed from either NAND logic or NOR logic alone. If the four NOR gates are replaced by NAND gates, this results in an XOR gate, which can be converted to an XNOR gate by inverting the output or one of the inputs (e.g. with a fifth NAND gate).
An alternative arrangement is of five NAND gates in a topology that emphasizes the construction of the function from
(A ⋅ B)+(\overline{A} ⋅ \overline{B})
(A+\overline{B}) ⋅ (\overline{A}+B)
For the NAND constructions, the lower arrangement offers the advantage of a shorter propagation delay (the time delay between an input changing and the output changing). For the NOR constructions, the upper arrangement requires fewer gates.
From the opposite perspective, constructing other gates using only XNOR gates is possible though XNOR is not a fully universal logic gate. NOT and XOR gates can be constructed this way.
Although other gates (OR, NOR, AND, NAND) are available from manufacturers with three or more inputs per gate, this is not strictly true with XOR and XNOR gates. However, extending the concept of the binary logical operation to three inputs, the SN74S135 with two shared "C" and four independent "A" and "B" inputs for its four outputs, was a device that followed the truth table:
This is effectively Q = NOT ((A XOR B) XOR C). Another way to interpret this is that the output is true if an even number of inputs are true. It does not implement a logical "equivalence" function, unlike two-input XNOR gates.