XNOR gate
This articleneeds additional citations forverification.(September 2020) |
XNOR gatetruth table | ||
---|---|---|
Input | Output | |
A | B | A XNOR B |
0 | 0 | 1 |
0 | 1 | 0 |
1 | 0 | 0 |
1 | 1 | 1 |
Logical connectives | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
||||||||||||||||||||||
Related concepts | ||||||||||||||||||||||
Applications | ||||||||||||||||||||||
![]() | ||||||||||||||||||||||
TheXNOR gate(sometimesENOR,EXNOR,NXOR,XANDand pronounced asExclusive NOR) is a digitallogic gatewhose function is thelogical complementof the Exclusive OR (XOR) gate.[1]It is equivalent to the logical connective () frommathematical logic,also known as the material biconditional. The two-input version implementslogical equality,behaving according to the truth table to the right, and hence the gate is sometimes called an "equivalence gate". A high output (1) results if both of the inputs to the gate are the same. If one but not both inputs are high (1), a low output (0) results.
Thealgebraic notationused to represent the XNOR operation is.The algebraic expressionsandboth represent the XNOR gate with inputsAandB.
Symbols
[edit]There aretwo symbols for XNOR gates:one with distinctive shape and one with rectangular shape and label. Both symbols for the XNOR gate are that of theXOR gatewith an added inversion bubble.
Hardware description
[edit]XNOR gates are represented in mostTTLandCMOSICfamilies. The standard4000 seriesCMOS IC is the 4077, and the TTL IC is the 74266 (although anopen-collectorimplementation). 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 TTL74LSimplementation, the 74LS266, as well as the CMOS gates (CD4077, 74HC4077 and 74HC266 and so on) are available from most semiconductor manufacturers such asTexas InstrumentsorNXP,etc.[2]They are usually available in both through-holeDIPandSOICformats (SOIC-14, SOC-14 or TSSOP-14).
Datasheets are readily available in mostdatasheet databasesand suppliers.
Implementation
[edit]AND-OR-Invert logic
[edit]An XNOR gate can be implemented using a NAND gate and anOR-AND-Invertgate, as shown in the following picture.[3] This is based on the identity
An alternative, which is useful when inverted inputs are also available (for example from aflip-flop), uses a 2-2AND-OR-Invertgate, shown on below on the right.
-
XNOR implemention using a NAND and an OAI gate
-
XNOR implementation using a 2-2-AOI gate with normal and inverted inputs
CMOS
[edit]CMOS implementations based on the OAI logic above can be realized with 10transistors,as shown below. The implementation which uses both normal and inverted inputs uses 8 transistors, or 12 if inverters have to be used.
-
An XNOR-gate in CMOS using a NAND and an OR-AND-Invert gate
-
An XNOR gate in CMOS using both normal and inverted inputs
Pinout
[edit]Both the 4077 and 74x266 devices (SN74LS266, 74HC266, 74266, etc.) have the same pinout diagram, as follows:
![](https://upload.wikimedia.org/wikipedia/commons/thumb/2/22/XNOR_Pinout.png/350px-XNOR_Pinout.png)
Pinout diagram of the 74HC266N, 74LS266 and CD4077 quad XNOR plasticdual in-line package14-pin package (PDIP-14)ICs.
- Input A1
- Input B1
- Output Q1 (high if and only if A1 and B1 have the same logic level)
- Output Q2
- Input B2
- Input A2
- Vss(GND) common power and signal ground pin
- Input A3
- Input B3
- Output Q3
- Output Q4
- Input B4
- Input A4
- Vddfor CMOS (Vccfor TTL) positive power supply (see datasheets for acceptable voltage ranges)
Alternatives
[edit]![](https://upload.wikimedia.org/wikipedia/commons/thumb/6/66/3_gate_XNOR.svg/270px-3_gate_XNOR.svg.png)
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,we can construct an XNOR gate circuit directly using AND, OR and NOT gates. However, this approach requires five gates of three different kinds.
As alternative, if different gates are available we can applyBoolean algebrato transformas stated above, and applyde Morgan's Lawto the last term to getwhich can be implemented using only three gates as shown on the right.
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 eitherNAND logicorNOR logicalone. 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).
Desired gate | NAND construction | NOR construction |
---|---|---|
![]() |
![]() |
![]() |
An alternative arrangement is of five NAND gates in a topology that emphasizes the construction of the function from,noting fromde Morgan's Lawthat a NAND gate is an inverted-input OR gate. Another alternative arrangement is of five NOR gates in a topology that emphasizes the construction of the function from,noting fromde Morgan's Lawthat a NOR gate is an inverted-input AND gate.
Desired gate | NAND construction | NOR construction |
---|---|---|
![]() |
![]() |
![]() |
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 fullyuniversal logic gate.NOT and XOR gates can be constructed this way.
More than two inputs
[edit]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 thebinarylogical 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:
Input | Output | ||
---|---|---|---|
A | B | C | Q |
0 | 0 | 0 | 1 |
0 | 0 | 1 | 0 |
0 | 1 | 0 | 0 |
0 | 1 | 1 | 1 |
1 | 0 | 0 | 0 |
1 | 0 | 1 | 1 |
1 | 1 | 0 | 1 |
1 | 1 | 1 | 0 |
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.
See also
[edit]![](https://upload.wikimedia.org/wikipedia/en/thumb/4/4a/Commons-logo.svg/30px-Commons-logo.svg.png)
- AND gate
- OR gate
- NOT gate
- NAND gate
- NOR gate
- XOR gate
- Kronecker delta function
- Logical biconditional
- If and only if
References
[edit]- ^"Exclusive-NOR Gate Tutorial".Retrieved6 May2018.
- ^"XNOR Logic Gates".Retrieved6 May2018.
- ^Fischer, P."Aussagenlogik und Gatter"(PDF).University of Heidelberg.Retrieved2024-01-21.