XNOR Gate Circuit Diagram: Exclusive NOR Logic, Truth Table & Equality Detector
This is a free printable xnor gate circuit diagram: download the diagram as SVG or open it and print to paper or PDF.
An XNOR (Exclusive NOR) gate outputs HIGH when its inputs are equal — both LOW or both HIGH — and outputs LOW when the inputs differ. It is the logical complement of XOR. The Boolean expression is Y = (A ⊕ B)' = AB + A'B'. XNOR gates are used as 1-bit equality comparators, in parity checkers, and in XNOR-feedback linear feedback shift registers (LFSRs).
The XNOR gate computes logical equivalence or XNOR (exclusive-NOR). For two inputs A and B, Y = (A ⊕ B)' which expands to Y = AB + A'B'. In words: the output is 1 when both inputs are the same value. This 'equality' property makes it a natural 1-bit comparator.
Truth table: when A=0, B=0, Y=1 (equal); when A=0, B=1, Y=0 (different); when A=1, B=0, Y=0 (different); when A=1, B=1, Y=1 (equal). The output pattern (1, 0, 0, 1) is the bitwise complement of the XOR pattern (0, 1, 1, 0).
Logic symbol: the XNOR symbol combines the XOR curved-arc body with the inversion bubble at the output. It looks like an XOR gate plus a bubble. In IEC notation the body label is '=1' with an output inversion circle, or alternatively labelled with an 'E' (equivalence).
Implementation from NAND gates: XNOR requires five 2-input NAND gates. Starting from the 4-NAND XOR construction, add a fifth NAND gate (wired as a NOT) to invert the XOR output: - G1: P = (AB)' - G2: Q = (AP)' - G3: R = (BP)' - G4: S = (QR)' = A ⊕ B - G5: Y = (SS)' = (A ⊕ B)' = A XNOR B This requires two 7400 ICs (8 NAND gates available, 5 used).
Alternate two-XOR approach: a simpler XNOR uses one XOR gate (7486) followed by one NOT gate (from a 7404): Y = NOT(A ⊕ B). This requires only 2 ICs.
Dedicated XNOR IC: although no standard 74xx XNOR-only quad IC exists as a standalone part (unlike the 7486 for XOR), XNOR is typically built from a 7486 XOR gate with its output connected to a 7404 inverter, or sourced from complex-function logic ICs. Some CPLD and FPGA cell libraries include XNOR primitives directly.
Equality comparator application: to compare two 4-bit words A[3:0] and B[3:0] for equality, connect one XNOR gate per bit pair: Y0 = A0 XNOR B0, Y1 = A1 XNOR B1, etc. Then AND all four XNOR outputs: EQUAL = Y0 · Y1 · Y2 · Y3. The EQUAL output is 1 only when every bit pair matches. This is the basis of the 7485 4-bit magnitude comparator IC's equality output.
Parity checker application: XOR-tree parity generators produce even parity. An XNOR at the final comparison stage checks received parity: if received parity bit XNOR computed parity = 1, no single-bit error detected. If = 0, an error occurred. This is used in UART, SPI, and memory ECC systems.
LFSR feedback: XNOR-feedback LFSRs produce maximal-length pseudo-random sequences. Unlike XOR-feedback LFSRs, XNOR-feedback includes the all-ones state in the sequence instead of the all-zeros state, which can be advantageous in test pattern generation.
For CMOS the XNOR function at the transistor level requires 8 transistors (versus 6 for a 2-input NAND gate), making it more expensive in silicon area. In practice, complex CMOS cells (like OAI and AOI gates) can implement XNOR more efficiently than a simple series/parallel stack.
Try building a 2-bit equality comparator with two XNOR gates and one AND gate in the free Circuit Diagram Maker editor — it perfectly demonstrates the XNOR equality-detection principle.
How to wire xnor gate circuit diagram
- Select implementation Choose either a 7486 XOR gate + 7404 inverter (simplest), or build a 5-NAND XNOR on a single 7400 plus one gate from a second 7400.
- Power both ICs Connect Vcc (pin 14) and GND (pin 7) on each IC. Add 100nF decoupling capacitors on each supply pin pair.
- Wire XOR stage Connect input A to pin 1 of the 7486 and input B to pin 2. The XOR output appears at pin 3.
- Invert XOR output Connect pin 3 of the 7486 to pin 1 of the 7404 inverter. The XNOR output appears at pin 2 of the 7404.
- Add output indicator Connect the XNOR output through a 470Ω resistor to an LED anode; LED cathode to GND. The LED is ON when inputs are equal.
- Test all four combinations Inputs 00 → LED on; 01 → LED off; 10 → LED off; 11 → LED on. Confirm equality detection.
- Build 2-bit comparator Add a second XNOR for a second bit pair, then AND the two XNOR outputs with a 7408 AND gate. The AND output is HIGH only when both bit pairs are equal.
Specifications
| A=0, B=0 | Y=1 |
|---|---|
| A=0, B=1 | Y=0 |
| A=1, B=0 | Y=0 |
| A=1, B=1 | Y=1 |
| Boolean expression | Y = (A ⊕ B)' = AB + A'B' |
| Common implementation | 7486 XOR + 7404 NOT inverter |
| NAND-only implementation | 5 × 2-input NAND gates |
| Supply voltage (74HC) | 2V – 6V |
| Equality output condition | Y=1 when A equals B |
| 4-bit comparator IC | 7485 (uses XNOR internally) |
| LFSR use | XNOR-feedback for maximal-length including all-ones state |
Safety warnings
- When using two ICs (7486 + 7404) on the same breadboard, ensure both ICs share the same GND reference; a floating ground between ICs causes unreliable logic levels and may damage outputs.
- CMOS XNOR implementations are sensitive to ESD — always ground yourself before handling and keep unused inputs tied to defined voltage levels.
Tools needed
- 7486 quad XOR gate IC and 7404 hex NOT gate IC (or two 7400 NAND ICs)
- Breadboard and jumper wires
- 5V DC power supply
- Digital multimeter
- LED and 470Ω resistor
- 10kΩ pull-down resistors
Common mistakes
- Using XOR where XNOR is needed in comparator circuits: XOR produces 0 for equality (1 for inequality), while XNOR produces 1 for equality. Choosing the wrong gate inverts the comparator's sense.
- Forgetting the inverter when building XNOR from XOR: the most common error is wiring the 7486 output directly to the AND gate in a multi-bit comparator, producing an inequality detector instead of an equality one.
- Assuming a standalone XNOR quad IC exists in TTL: no 74LS/HC standard quad XNOR standalone DIP IC is widely available. Always plan to use XOR + NOT or a 5-NAND construction.
- Misinterpreting the XNOR truth table as an OR-like gate: XNOR has a 1 output for 11 (like OR) but also for 00 (unlike OR). Students often forget the 00→1 row.
Troubleshooting
- XNOR output is inverted — 0 for equal inputs
- Cause: XOR output taken directly without the NOT inversion stage Fix: Add a 7404 inverter between the XOR output and the LED/next stage. Verify the NOT gate is powered and oriented correctly.
- Comparator AND output never goes HIGH
- Cause: One or more XNOR stages producing 0 when inputs are equal Fix: Test each XNOR stage independently with a multimeter. Check that each XOR + NOT pair is correctly wired and powered.
- Intermittent output during fast input transitions
- Cause: Propagation delay of XOR (30ns) plus inverter (10ns) = 40ns total creating a glitch window Fix: Add a D flip-flop to latch the final output, clocked after inputs have settled. This eliminates transient glitch propagation.
Frequently asked questions
What is the truth table for an XNOR gate circuit diagram?
XNOR outputs 1 when both inputs are equal (00→1 and 11→1) and 0 when inputs differ (01→0 and 10→0). It is the complement of the XOR truth table.
How is XNOR different from XOR in circuit diagrams?
XNOR is the inverted output of XOR. XOR outputs 1 when inputs differ; XNOR outputs 1 when inputs are the same. Their truth tables are complementary.
Which IC is used for an XNOR gate?
There is no standard quad XNOR 74xx standalone IC. XNOR is typically implemented with a 7486 XOR gate and a 7404 inverter, or using five NAND gates from a 7400.
What is the Boolean expression for an XNOR gate?
Y = (A ⊕ B)' = AB + A'B'. The output is 1 when A and B are both 0 (A'B') or both 1 (AB).
Why is XNOR called an equality detector?
Because XNOR outputs 1 only when its two inputs have the same logic value (both 0 or both 1). This property directly detects whether two single-bit signals are equal.
How do you use XNOR gates to compare two numbers?
Compare each bit pair with an XNOR gate, then AND all XNOR outputs. If the AND output is 1, all bit pairs are equal and the two numbers are identical. This is the core of binary magnitude comparators.
What is an XNOR LFSR?
A linear feedback shift register (LFSR) that uses XNOR instead of XOR for the feedback taps. The XNOR-LFSR includes the all-ones state in its maximal-length sequence instead of the all-zeros state found in XOR-LFSRs.