XNOR count for equality comparison — 8-bit comparator In a typical equality comparator built from basic gates, how many exclusive-NOR (XNOR) gates are required to compare two 8-bit words for equality?

Difficulty: Easy

Correct Answer: 8

Explanation:


Introduction / Context:
An equality comparator outputs HIGH when two multi-bit inputs are identical. A common logic-level implementation uses one XNOR per bit to test equality, followed by an AND that combines all bitwise equal signals. Knowing the gate count supports quick resource estimation in discrete logic designs and FPGA LUT budgeting.


Given Data / Assumptions:

  • Two 8-bit inputs: A7..A0 and B7..B0.
  • Use XNOR per bit: A_i XNOR B_i = 1 when bits match.
  • Combine via multi-input AND to form overall EQ.


Concept / Approach:

For n-bit equality, use n XNOR gates to produce n equality flags, then an n-input AND (or a tree of AND gates). Thus, for 8 bits, exactly 8 XNORs are needed for the bitwise comparisons.


Step-by-Step Solution:

Per bit i: E_i = XNOR(A_i, B_i).Overall equality: EQ = AND(E_7, E_6, …, E_0).Count XNORs: one per bit → 8 total.


Verification / Alternative check:

Check standard 74xx series comparators: internal structures mirror bitwise equality checks aggregated by AND/OR logic; discrete implementations follow the same pattern.


Why Other Options Are Wrong:

4 or 6 XNORs leave some bits untested; 10 exceeds the requirement.


Common Pitfalls:

Using XOR instead of XNOR; XOR must be inverted for equality, which implicitly recreates XNOR behavior.


Final Answer:

8

More Questions from Code Converters and Multiplexers

Discussion & Comments

No comments yet. Be the first to comment!
Join Discussion