The exclusive nor gate boolean expression defines a digital logic operation that outputs a HIGH (logic 1) state if and only if both of its inputs are identical (both HIGH or both LOW). Unlike standard gates that trigger on the presence of a signal, this gate triggers on equality, making it the fundamental building block for digital comparators and error-checking circuits.
The Core Logic: Decoding the Exclusive NOR Gate Boolean Expression
To understand the math, we start with the standard notation. The exclusive NOR (XNOR) operation is the logical complement of the exclusive OR (XOR). If XOR is denoted by the ⊕ symbol, the XNOR boolean expression is written as:
Y = ¬(A ⊕ B) or Y = (A ⊕ B)'
However, when you are designing a circuit using discrete NAND or NOR gates, or analyzing a sum-of-products (SOP) architecture, you need the expanded boolean expression. By applying De Morgan's laws and boolean algebra, the expression expands to:
Y = (A · B) + (¬A · ¬B)
This translates to plain English as: "Output Y is HIGH if (A AND B are HIGH) OR (NOT A AND NOT B are HIGH)."
| Input A | Input B | A · B | ¬A · ¬B | Output Y (XNOR) |
|---|---|---|---|---|
| 0 | 0 | 0 | 1 | 1 |
| 0 | 1 | 0 | 0 | 0 |
| 1 | 0 | 0 | 0 | 0 |
| 1 | 1 | 1 | 0 | 1 |
Worked Numeric Example: Evaluating the Expression on the Bench
Let’s move from abstract algebra to physical voltages. We will test a TI SN74HC266 chip powered at a strict 5.00V VCC. According to the datasheet, any input voltage above 3.15V is guaranteed as a logic HIGH (1), and anything below 1.35V is a logic LOW (0).
Test 1: Mismatched Inputs
We apply 4.20V to Input A (Logic 1) and 0.30V to Input B (Logic 0).
Evaluating the expression: Y = (1 · 0) + (0 · 1) → Y = 0 + 0 → Y = 0.
Bench Measurement: The multimeter reads 0.15V at the output pin. The internal MOSFETs have pulled the output firmly to ground.
Test 2: Matched HIGH Inputs
We raise Input B to 4.10V. Now both A and B are Logic 1.
Evaluating the expression: Y = (1 · 1) + (0 · 0) → Y = 1 + 0 → Y = 1.
Bench Measurement: The multimeter reads 4.88V. The output stage has switched, connecting the pin to the VCC rail.
Test 3: Matched LOW Inputs
We drop Input A to 0.20V and Input B to 0.40V. Both are Logic 0.
Evaluating the expression: Y = (0 · 0) + (1 · 1) → Y = 0 + 1 → Y = 1.
Bench Measurement: The multimeter again reads 4.85V. The gate recognizes that while the voltages aren't mathematically identical, they both fall within the valid logic LOW threshold, satisfying the equality condition.
Where You Meet This in Practice: Equality Detection and Parity
In a physical installation or PCB layout, the XNOR gate changes a multi-wire parallel comparison into a single-wire serial error flag. You will primarily encounter this boolean expression in two scenarios:
- Digital Magnitude Comparators: If you need to know if two 4-bit binary numbers are identical, you feed each corresponding bit pair (A0/B0, A1/B1, etc.) into four separate XNOR gates. You then wire the four outputs into a 4-input AND gate. The final AND gate only goes HIGH if every single XNOR gate detected equality.
- Parity Checkers in Communication: Protocols like UART, I2C, and RS-485 often append a parity bit to detect transmission errors. An XNOR tree is used to compare the received data bits against the received parity bit. If the XNOR network outputs a 0, the hardware triggers an interrupt to request a packet retransmission.
Real-World Scenario Walkthrough: Debugging a Failed RS-485 Parity Check
Theory is clean; the workbench is not. Here is a real-world debugging sequence involving the XNOR boolean expression in a noisy industrial environment.
The Setup:
We were building a custom 4-bit parity checker for a noisy RS-485 telemetry link using a CD4077B (CMOS Quad 2-input XNOR) powered at 12V. The four data bits and the parity bit were fed into a cascaded tree of XNOR gates. The final output was tied to a microcontroller interrupt pin, configured to trigger a retransmit request if the line went LOW.
The Numbers:
VCC = 12.0V. Logic HIGH threshold = 8.4V. Logic LOW threshold = 3.6V. The data payload was perfectly valid, meaning the final XNOR output should have remained steadily at ~11.8V (Logic 1).
The Outcome:
The microcontroller was randomly triggering false retransmits. Hooking up an oscilloscope to the final XNOR output pin revealed the voltage was periodically dipping from 11.8V down to 2.1V for roughly 40 microseconds before recovering.
What Went Wrong:
The CD4077B contains four independent XNOR gates in a single package; our design only used three. The inputs to the fourth, unused gate were left floating (unconnected). In CMOS logic, a floating input acts as a high-impedance antenna. It picked up 60Hz AC noise from a nearby variable frequency drive (VFD), causing the internal totem-pole output stage of the unused gate to rapidly oscillate between HIGH and LOW. This oscillation drew massive transient current spikes from the shared 12V VCC rail, causing localized brownouts that dragged the output voltage of our active gates down below the microcontroller's logic threshold. The fix: We tied the unused XNOR inputs directly to the 12V VCC rail, satisfying the boolean expression with a permanent (1 · 1) + (0 · 0) = 1 state, eliminating the oscillation.
Common Confusions: XNOR vs. NOR and the Floating Input Hazard
The most common mistake hobbyists make is confusing the XNOR gate with the standard NOR gate. A NOR gate (like the 74HC02) outputs HIGH only when both inputs are LOW. An XNOR outputs HIGH when both are LOW or both are HIGH.
To use a fluid analogy exactly once: Think of a NOR gate as a bypass pipe that only allows water to flow if neither of the two main shutoff valves is open. An XNOR gate, conversely, is like a differential pressure valve that only opens if both main valves are in the exact same physical position—either both fully open or both fully closed.
Another critical point of confusion is assuming the boolean expression behaves identically across logic families. In TTL (like the older 74LS series), a floating input naturally pulls HIGH due to internal biasing resistors. In CMOS (74HC or CD4000 series), a floating input is undefined and will destroy your circuit's noise margin. Always evaluate your physical hardware, not just the math.
Frequently Asked Questions
Can I build an XNOR gate using only NAND gates?
Yes. Because NAND gates are universal, you can construct the exclusive nor gate boolean expression using exactly four 2-input NAND gates (or five, depending on the specific topology and whether you need to invert the inputs). This is a common exercise in digital logic design when you want to minimize your Bill of Materials (BOM) to a single IC package like the 74HC00.
Why would I use an XNOR instead of an XOR for parity checking?
It depends on whether your protocol specifies Even or Odd parity. An XOR tree naturally outputs HIGH if there is an odd number of HIGH inputs. An XNOR tree naturally outputs HIGH if there is an even number of HIGH inputs. You choose the gate based on the mathematical requirement of your communication protocol, not personal preference.
Does the boolean expression change for 3-input XNOR gates?
Technically, standard logic families do not manufacture 3-input XNOR gates because the definition of "equality" breaks down with more than two variables. If you need to check if three bits are identical, you must cascade two standard 2-input XNOR gates and combine their outputs with an AND gate, or use a dedicated magnitude comparator IC like the 74HC85.






