XNOR Logic Gate Simulator – Free

This XNOR gate simulator compares two bits. The result is 1 when the inputs match and 0 when they differ, which is why XNOR is also called the equivalence gate.

How to use the XNOR Gate Simulator tool

  1. Choose the first bit in the Input A list.
  2. Choose the second bit in the Input B list.
  3. Select Calculate to evaluate A XNOR B.
  4. Read the result: 1 means the two inputs are equal, 0 means they are different.
  5. Select Copy to copy the output, or Clear to go back to the default inputs.

XNOR gate truth table

XNOR stands for exclusive NOR. It is the inverse of XOR: where XOR reports a difference, XNOR reports agreement. Two of the four input pairs, 0 with 0 and 1 with 1, give an output of 1.

On a fresh page Input A is 1 and Input B is 0. Those values differ, so the first calculation returns 0.

A  B  A XNOR B
0  0     1
0  1     0
1  0     0
1  1     1

The logic behind the XNOR gate simulator

As a Boolean expression, XNOR is (A AND B) OR (NOT A AND NOT B): true when both inputs are high or both are low. The simulator computes it the short way, by XOR-ing the two one-bit values, inverting the result and keeping one bit.

For one-bit signals XNOR is the equality test, the same as A == B on Booleans in code. For whole words, the Bitwise XNOR Calculator marks every bit position where two operands agree.

What XNOR is used for

The gate is a one-bit comparator, and most of its applications build on that.

  • Equality comparators. XNOR each pair of bits, then AND the results to learn if two words are identical.
  • Binarized neural networks, where weights and activations are single bits and multiplication is replaced by XNOR followed by a population count.
  • Parity checking, since a two-input XNOR is 1 exactly when the number of high inputs is even.
  • Content-addressable memory, where each cell compares a stored bit with a search bit.

Chaining XNOR gates

XNOR does not extend to more inputs the way AND and OR do. Feeding the output of one XNOR into another with a third signal does not test whether all three are equal. The two inversions cancel, and the chain outputs 1 when an odd number of the three inputs are high. To test three signals for equality, compare them pairwise and AND the comparisons.

XNOR is also not a universal gate. Circuits made only of XOR and XNOR gates can compute parity-style functions but cannot produce AND or OR.

Frequently asked questions

When does an XNOR gate output 1?

When its two inputs are the same: both 0 or both 1. If one input is 0 and the other is 1, the output is 0.

What is the difference between XOR and XNOR?

They are complements. XOR outputs 1 when the inputs differ, and XNOR outputs 1 when they match. Inverting the output of either gate gives the other.

Is XNOR the same as an equality check?

For two single bits, yes. A XNOR B is 1 exactly when A equals B. For multi-bit values you need one XNOR per bit position and an AND across all the results.

How do I build XNOR from other gates?

Put an inverter after an XOR gate, or invert one input of an XOR gate. From basic gates, AND the two inputs, AND their inverses, and OR those two terms together.

Which chips provide XNOR gates?

The CMOS 4077 contains four two-input XNOR gates, and the 74266 offers the function in the 7400 series. In programmable logic and HDL code you simply write the operator and the tools pick the cells.

Related tools