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 P⊙Q=(P∧Q)∨(¬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 P↔QP \leftrightarrow Q.

Key Formula

P⊙Q=(P∧Q)∨(¬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.
T⊙T=(T∧T)∨(F∧F)=T∨F=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.
T⊙F=(T∧F)∨(F∧T)=F∨F=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.
F⊙T=(F∧T)∨(T∧F)=F∨F=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.
F⊙F=(F∧F)∨(T∧T)=F∨T=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.

Related Terms

  • Conjunction — AND operation used inside the XNOR formula
  • Disjunction — OR operation used inside the XNOR formula
  • Conditional — Related connective in propositional logic
  • Contrapositive — Logical equivalence used alongside biconditionals
  • Converse — Reversing a conditional, linked to biconditional