XNOR Gate
An XNOR gate is the complement of XOR: output is 1 when its inputs are the same value and 0 when they differ. The 74HC266 is the classic quad XNOR; XNOR is the building block of every digital comparator and equality test.
For a two-input XNOR, equal logic levels produce HIGH and different levels produce LOW. It is the logical inverse of XOR. Transistor count depends on the implementation and whether complementary inputs are already available; it is not a fixed property of the XNOR function.
In plain terms
Two synchronised metronomes: the indicator only lights when both ticks land at the same instant. Any drift between them, and the light goes out.
Why designers use it
- Build digital comparators that flag when two registers hold the same value.
- Detect bit-level matches in pattern-recognition logic, such as triggering a logic analyser when an address bus equals a target.
- Form the carry-detect logic in some ALU architectures where carry-less addition is wanted.
- Implement reversible logic gates in cryptographic primitives that need invertibility.
Best for
- Equality compare
- Address match
- Pattern detect
Key specifications
- Operating limits: Check the exact manufacturer's datasheet (A family name does not establish voltage, current, temperature or timing limits.)
- Pin assignment: Match the complete part and package code (A similar name or function does not guarantee the same wiring.)
- Mechanical fit: Use the exact package drawing (Check pad layout, dimensions and viewing direction before building.)
When not to use it
- For magnitude comparison (greater-than, less-than) — use a dedicated comparator like the 74HC85.
- For one-of-N decoding where only one match line should assert — a decoder IC is more efficient.
Common mistakes
- Building an n-bit equality comparator with n XNORs and an AND, but forgetting that the AND fan-in slows the result — use the 74HC85 cascadable comparator instead for wide busses.
- Using XNOR for a sign-flag arithmetic operation when the architecture actually wants XOR; the polarity error propagates silently into wrong condition codes.
Where you will find it
- A bench logic analyser's trigger word uses a 74HC266 XNOR array to detect when a 16-bit memory address equals a user-set value: the moment the device-under-test reads from the watch address, the array's combined output triggers acquisition — the same equality-tree design every modern protocol analyser still uses.
- A CD-ROM drive's sector-sync detector uses XNORs to match a 12-byte sync pattern against the incoming data stream: when the stream matches the expected preamble, the XNOR equality output starts the sector-data clock, decoupling read timing from disc-rotation jitter.
- A nuclear-plant rod-position sensor uses XNORs in its dual-redundant pattern matcher: two independent encoder readings must agree bit-for-bit before the position is reported to the control room, with any mismatch immediately flagging a sensor fault and pausing rod movement.
A short history
A two-input XNOR gate outputs HIGH when its inputs match and LOW when they differ. It is the logical complement of a two-input XOR gate. That makes it useful for checking whether two logic signals have the same value.