An XNOR gate is an XOR with a bubble on its output. For two inputs, Y = , which also equals . Its output is 1 when the inputs are equal, both 0 or both 1, so it is also called the equivalence gate.
Truth table, rows 00 to 11: 1 0 0 1. That is XOR's column with every bit flipped.
XNOR is the hardware equality test. To check whether two binary numbers are the same, compare each pair of bits with an XNOR, then AND all the XNOR outputs. The result is 1 only if every pair matched. Equality comparators work exactly this way.
Some handy facts:
- Inverting either input of an XOR gives an XNOR: = .
- With one input held at 1, XNOR passes the other through: = A. With it held at 0, XNOR inverts.
- Both inputs tied to the same signal always give 1.
With three or more inputs, an XNOR gate (a multi-input XOR plus one output bubble) is 1 when an even number of inputs are 1. That is the even function.