Gate Simulator

XNOR Gate Simulator

Simulate the XNOR gate online. Learn how it functions as a digital equality detector. Free tool with truth table, boolean expression, and circuit examples.

Overview

The XNOR (Exclusive NOR) gate outputs HIGH (1) when both inputs are the same — both 0 or both 1. When the inputs differ, the output is LOW. XNOR is the complement of XOR and is sometimes called an "equality gate" or "coincidence gate" because it detects when inputs agree.

The boolean expression for XNOR is Y = (A ⊕ B)' = AB + A'B'. In circuit diagrams, XNOR is shown as an XOR gate with an inversion bubble at the output. Like XOR, XNOR requires more transistors than basic gates — typically 8 in CMOS.

XNOR gates are essential in digital comparators, parity checkers, error-detection circuits, and fault-detection logic. A multi-bit equality comparator is built by XNORing corresponding bits of two numbers and then ANDing all XNOR outputs — if all bit pairs match, all XNOR outputs are 1, and the AND confirms equality.

Truth Table

Y = (A ⊕ B)' = AB + A'B'
ABOutput (Y)
001
010
100
111

How It Works

XNOR is constructed by inverting the output of an XOR gate. At the transistor level, efficient XNOR implementations use transmission gate structures that reduce transistor count compared to the naive NOT(XOR) approach.

The self-inverse property of XOR transfers to XNOR: A XNOR A = 1 (a signal compared with itself is always equal). A XNOR 0 = A' (XNOR with 0 inverts the signal). A XNOR 1 = A (XNOR with 1 preserves the signal). These identities are useful in simplifying larger boolean expressions.

In digital comparators, a cascade of XNOR gates checks bit-by-bit equality between two binary numbers. The 74HC85 4-bit magnitude comparator IC uses XNOR-based equality logic internally.

Real-World Applications

Digital Equality Comparators

Multi-bit XNOR chains check whether two binary numbers are identical — used in address comparators and conditional branch hardware.

Even Parity Checkers

XNORing all bits of a codeword checks even parity: the result is 1 if the number of 1-bits is even, indicating no single-bit error.

Fault Detection Logic

XNOR circuits compare expected vs actual outputs in redundant systems, raising an alarm when they disagree.

Cryptographic Hash Mixing

XNOR operations appear in lightweight cryptographic primitives and block cipher round functions for mixing and diffusion.

Coincidence Detection

XNOR detects when two asynchronous signals are in phase or share the same logic level at a given moment.

Try It in the Interactive Simulator

Build XNOR Gate circuits in real time — drag gates, connect wires, toggle inputs, and see outputs update instantly.

Frequently Asked Questions

  • What is an XNOR gate?

    An XNOR gate outputs 1 when both inputs are the same (both 0 or both 1). It is the complement of XOR: Y = (A ⊕ B)'. It is also called an equivalence gate or coincidence gate.

  • What is the truth table for XNOR?

    Two-input XNOR: (0,0)→1, (0,1)→0, (1,0)→0, (1,1)→1. Outputs 1 only when A equals B.

  • How does XNOR differ from XNOR?

    XNOR (Exclusive NOR) is the complement of XOR (Exclusive OR). XOR outputs 1 when inputs differ; XNOR outputs 1 when inputs are the same.

  • How is XNOR used in comparators?

    To compare two N-bit numbers, XNOR each pair of corresponding bits. Then AND all N XNOR outputs. If all bits match, all XNORs output 1, and the final AND confirms equality.

  • What is the IC number for XNOR gate?

    The 74HC266 provides four 2-input XNOR gates in a CMOS package.