XNOR Gate
Exclusive NOR, equivalence gate, Y=(A xor B)'.
The XNOR gate (Exclusive NOR gate) is the complement of the XOR gate. It produces a HIGH output only when its inputs are equal, which is why it is also called the equivalence gate. In digital systems, equality detection is a fundamental operation needed in comparators, address decoders, and error checkers.
In GATE examinations, XNOR questions appear in Boolean simplification, comparator circuit design, and in identifying gate equivalences. The XNOR operation has a clean relationship with XOR through simple inversion, and its identities parallel those of XOR in a complementary fashion.
Core Concept: What XNOR Gate Does
The XNOR gate is the complement of the XOR gate. While XOR outputs HIGH when inputs differ, XNOR outputs HIGH when inputs are the same. This equality-detection behavior earns it the name equivalence gate. For two inputs A and B, the XNOR output is 1 only when A = B (either both are 0 or both are 1).
Physically, an XNOR gate is realized by adding an inverter at the output of an XOR gate. In IC form, the circuit uses the same internal XOR structure followed by a NOT stage. This adds a small propagation delay compared to XOR. In CMOS technology, XNOR and XOR gates are often designed together from shared transistor structures to reduce area and power.
The XNOR gate is functionally the logical biconditional operator from Boolean logic (A if and only if B). This makes it directly useful for checking whether two binary words are identical, which is the core function of a magnitude comparator for the equal output signal.
Mathematical Expression
The Boolean expression for a 2-input XNOR gate is:
Y = (A xor B)' = AB + A'B'
The expanded SOP form AB + A'B' shows the two minterms where the output is HIGH: both inputs HIGH (AB) and both inputs LOW (A'B'). This form is directly used in Karnaugh maps and is the complement of A'B + AB' (which is XOR). Note that XNOR is sometimes written as A odot B using the odot symbol in textbooks.
Key XNOR identities parallel those of XOR: A xnor A = 1 (same inputs always), A xnor 0 = A' (XNOR with 0 inverts), A xnor 1 = A (XNOR with 1 is identity). These identities are directly testable in GATE and are useful for simplifying long XNOR chains in digital circuit problems.
Practical Understanding: Comparators and Applications
The primary application of XNOR is in binary comparators. To check whether two n-bit numbers are equal, you connect one XNOR gate per bit pair. The XNOR output is 1 for each bit position where the two numbers have the same value. All XNOR outputs are then ANDed together. If the AND output is 1, the two n-bit numbers are completely equal. IC 7485 uses this XNOR-AND structure internally for 4-bit magnitude comparison.
XNOR is also used in error detection circuits where received data must be compared bit by bit against expected data. If any bit differs, the corresponding XNOR output goes LOW, flagging an error. This is more direct than XOR-based comparison because the active-HIGH equality signal is more intuitive in comparator design.
In cryptographic and security hardware, XNOR is used in certain key comparison circuits and feedback shift registers. In FPGA design, XNOR logic is inferred automatically by synthesis tools when equality operators are used in HDL code, making it important to recognize XNOR patterns in RTL and gate-level design.
Numerical Example
A 2-bit equality comparator must check if A[1:0] = B[1:0]. Given A1=1, A0=0, B1=1, B0=0, determine the output of each XNOR gate and the final equality output.
Given:
A1 = 1, A0 = 0 (2-bit number A = 10 in binary = 2 decimal)
B1 = 1, B0 = 0 (2-bit number B = 10 in binary = 2 decimal)
Circuit: Two XNOR gates, one per bit pair, outputs ANDed
Why this formula applies:
Equality check per bit: Xi = Ai xnor Bi = Ai.Bi + Ai'.Bi'
Final equality: Equal = X1 AND X0
Formula:
Xi = Ai xnor Bi
Equal = X1 . X0
Substitution:
X1 = A1 xnor B1 = 1 xnor 1 = 1.1 + 0.0 = 1 + 0 = 1
X0 = A0 xnor B0 = 0 xnor 0 = 0.0 + 1.1 = 0 + 1 = 1
Equal = X1 . X0 = 1 . 1 = 1
Calculation:
Both bit pairs are equal, so both XNOR outputs = 1
AND of all XNOR outputs = 1 (numbers are equal)
Final Answer with units:
X1 = 1, X0 = 1, Equal output = 1 (Logic HIGH)
Conclusion: A = B = 2 (decimal) is confirmed by the comparatorExam Tip: XNOR output is 1 when inputs are equal (same), and 0 when they differ. This is the opposite of XOR. Remember: Y = AB + A'B' is the SOP form. XNOR of n-bit numbers is the basis of equality in comparators; AND all XNOR bit outputs for the final equal signal.
- Y = (A xor B)' = AB + A'B': output is 1 when A and B are the same value.
- XNOR is the equivalence gate or logical biconditional operator in Boolean algebra.
- Key identities: A xnor A = 1, A xnor 0 = A', A xnor 1 = A. Complement of XOR identities.
- 2-bit comparator: place one XNOR per bit pair, AND all outputs for equality detection.
- XNOR gate physically is an XOR gate followed by an inverter stage.
Loading lab...
Quick Revision
- XNOR expression: Y = (A xor B)' = AB + A'B'. Output HIGH when inputs are equal.
- Truth table: Outputs 1 for (0,0) and (1,1). Outputs 0 for (0,1) and (1,0).
- Key identities: A xnor A = 1, A xnor 0 = A', A xnor 1 = A. These are testable in GATE.
- Application: Equality comparator uses one XNOR per bit pair, ANDed for final output.
- XNOR = XOR + NOT at output. Same internal structure with an extra inverter stage.
- Exam trap: Do not confuse XNOR (equal=1) with XOR (different=1). The truth tables are exact complements of each other.
- XNOR is also called the equivalence gate or coincidence gate in some textbooks.
XNOR Gate Quiz
Test your understanding of XNOR gate behavior, truth tables, and equivalence logic.
Q1.For a 2-input XNOR gate with inputs A and B, the output Y is HIGH when:
Related Articles
OR Gate
Two input OR, truth table, Boolean expression Y=A+B, IC 7432.
5 min read
AND Gate
Two input AND, truth table, Boolean expression Y=AB, IC 7408.
12 min read
NOR Gate
Universal gate, truth table, Y=(A+B)', IC 7402.
12 min read
NAND Gate
Universal gate, truth table, Y=(AB)', IC 7400.
10 min read
NOT Gate
Inverter, truth table, Boolean expression Y=A', IC 7404.
9 min read