Introduction
An Exclusive-NOR (XNOR) gate is a digital logic gate formed by combining an Exclusive-OR (XOR) gate with a NOT gate. It is also known as an Equivalence Gate because its output is logic 1 when its inputs are logically equal or equivalent. For a two-input XNOR gate, the output is 1 when both inputs are the same. If the inputs are different, the output is 0. The logic symbol of an XNOR gate is similar to an XOR gate, but it has a small circle, known as an inversion bubble, at its output to represent the NOT operation.
What is an XNOR Gate?
An XNOR gate, also called an Ex-NOR gate, performs the opposite operation of an XOR gate. While an XOR gate produces logic 1 when its inputs are different, an XNOR gate produces logic 1 when its inputs are the same.
For two inputs A and B:
- If A = B, then Q = 1.
- If A ≠ B, then Q = 0.
Therefore, an XNOR gate is commonly used for equality detection and digital comparison.
XNOR Gate Equivalent
An XNOR gate can be constructed by combining an XOR gate and a NOT gate. The XOR gate first determines whether the inputs are different, and the NOT gate inverts the result.
The Digital Logic XNOR Gate
2-Input XNOR Gate
A two-input XNOR gate has two inputs, A and B, and one output, Q.
2-Input XNOR Gate Truth Table
| A | B | Q |
|---|---|---|
| 0 | 0 | 1 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
Boolean Expression of XNOR Gate
The Boolean expression for a two-input XNOR gate is:
Q = A ⊙ B
It can also be expressed as:
Q = AB + A̅B̅
This means that the output is 1 when both inputs are the same.
In simple words:
If A and B are the SAME, then Q is 1.
3-Input XNOR Gate
An XNOR function can also be extended to more than two inputs. For three inputs, the output is determined by the parity of the number of logic 1 inputs. For an even-parity implementation, the output is 1 when the number of logic 1 inputs is even.
3-Input XNOR Truth Table
| 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 |
Boolean Expression:
Q = A ⊕ B ⊕ C with inversion at the output, or equivalently:
Q = A ⊕ B ⊕ C
For three inputs, this produces logic 1 when there is an even number of 1s among the inputs.
XNOR Boolean Expression Using Basic Gates
The two-input XNOR function can be expanded using AND, OR, and NOT operations:
Q = AB + A̅B̅
This expression means that the output becomes 1 in either of the following conditions:
- A = 0 and B = 0
- A = 1 and B = 1
Therefore, the XNOR function can be implemented using two AND gates, two NOT gates, and one OR gate.
XNOR Gate Equivalent Circuit
The basic XNOR circuit can be constructed using three types of logic gates: AND, NOT, and OR. The inputs are first inverted where required and then processed using AND gates. The outputs of the AND gates are finally combined using an OR gate to produce the XNOR output.
Although this method can implement the XNOR function, it requires multiple gates and therefore may be more complex than using a dedicated XNOR gate.
XNOR Function Realization Using NAND Gates
The XNOR function can also be implemented using only NAND gates. NAND is a universal logic gate, so multiple NAND gates can be interconnected to perform XNOR logic.
Using NAND gates can be useful when a digital circuit is designed using a single type of universal logic gate.
XNOR Gate vs XOR Gate
| Feature | XOR Gate | XNOR Gate |
|---|---|---|
| Full Name | Exclusive-OR | Exclusive-NOR |
| Output for Equal Inputs | 0 | 1 |
| Output for Different Inputs | 1 | 0 |
| Primary Function | Detects inequality | Detects equality |
| Output Logic | High when inputs differ | High when inputs are equal |
Applications of XNOR Gates
XNOR gates are widely used in digital electronics because they can determine whether two binary inputs are equal.
1. Digital Comparator Circuits
XNOR gates are commonly used in digital comparator circuits. They compare corresponding bits of two binary numbers and produce logic 1 when the compared bits are equal.
2. Adders and Subtractors
XNOR logic can be used as part of arithmetic circuits, including certain adder and subtractor implementations.
3. Parity Checking
XNOR logic can be used in parity-related circuits for detecting the parity of binary data.
4. Equality Detection
Because an XNOR gate produces logic 1 when its inputs are equal, it is useful for equality detection in digital systems.
5. Digital Logic Circuits
XNOR gates are used as building blocks in various combinational and sequential digital logic circuits.
Conclusion
An Exclusive-NOR (XNOR) gate is a digital logic gate that produces a logic 1 when its inputs are equal and a logic 0 when its inputs are different. Because of this property, it is also known as an Equivalence Gate. The XNOR gate is essentially an XOR gate followed by a NOT operation. Its Boolean expression for two inputs is Q = AB + A̅B̅. XNOR gates are particularly useful in digital comparator circuits, equality detection, parity circuits, adders, subtractors, and other digital logic applications.