Mathwords logoMathwords

XNOR — Definition, Formula & Examples

XNOR is a logic operation that returns true when both inputs have the same value — both true or both false. It is the negation of the XOR (exclusive or) gate.

The XNOR operation on two propositions PP and QQ is defined as PQ=(PQ)(¬P¬Q)P \odot Q = (P \land Q) \lor (\lnot P \land \lnot Q). It yields true if and only if PP and QQ share the same truth value, making it logically equivalent to the biconditional PQP \leftrightarrow Q.

Key Formula

PQ=(PQ)(¬P¬Q)P \odot Q = (P \land Q) \lor (\lnot P \land \lnot Q)
Where:
  • PP = First Boolean input (true or false)
  • QQ = Second Boolean input (true or false)
  • \odot = XNOR operator
  • \land = Logical AND (conjunction)
  • \lor = Logical OR (disjunction)
  • ¬\lnot = Logical NOT (negation)

How It Works

XNOR checks whether two inputs agree. If both are true or both are false, the output is true; if the inputs differ, the output is false. You can think of it as an "equality detector" for truth values. In circuit diagrams, XNOR is drawn as an XOR gate with a small circle (bubble) on the output, representing negation.

Worked Example

Problem: Evaluate P XNOR Q for all combinations of truth values of P and Q.
Case 1: P = T, Q = T. Both inputs match, so the output is true.
TT=(TT)(FF)=TF=TT \odot T = (T \land T) \lor (F \land F) = T \lor F = T
Case 2: P = T, Q = F. The inputs differ, so the output is false.
TF=(TF)(FT)=FF=FT \odot F = (T \land F) \lor (F \land T) = F \lor F = F
Case 3: P = F, Q = T. The inputs differ again, so the output is false.
FT=(FT)(TF)=FF=FF \odot T = (F \land T) \lor (T \land F) = F \lor F = F
Case 4: P = F, Q = F. Both inputs match, so the output is true.
FF=(FF)(TT)=FT=TF \odot F = (F \land F) \lor (T \land T) = F \lor T = T
Answer: The XNOR truth table: TT→T, TF→F, FT→F, FF→T.

Why It Matters

XNOR gates are used in digital circuits to test whether two signals are equal, which is essential in error-detection systems and comparators. In discrete math and proof-writing courses, recognizing that XNOR is equivalent to the biconditional helps you simplify logical expressions and construct truth tables more efficiently.

Common Mistakes

Mistake: Confusing XNOR with XOR by thinking "both true" gives false.
Correction: XNOR is the opposite of XOR. XNOR outputs true when both inputs match (both true or both false) and false when they differ.