The XNOR gate (equality gate)
The XNOR gate is an XOR followed by a NOT. It gives 1 when its two inputs are the same (both 0 or both 1) and 0 when they differ. That is why it is also called the equality gate.
Formula Y = (A ⊕ B)‾
Truth table
| A | B | Y |
|---|---|---|
| 0 | 0 | 1 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
Try it Click the inputs to change them.
Y1
Where it is used
Whenever two values must be compared: one XNOR per bit tells whether that bit matches. Join the results with an AND and you know whether two whole numbers are equal. Try it in the equality comparator challenge.