An identity comparator compares two 2-bit numbers by checking each digit individually using a XNOR gate. From the truth table you can see that this is not enough. Only if x0 is identical with y0 AND x1 is identical with y1, are the two numbers identical. You need an extra AND gate.
Truth table of a 2-bit identity comparator. |
![]() Circuit diagram of a 2-bit identity comparator. ![]() Circuit of a 2-bit identity comparator. (Enlarge) |
This concept can be extended to arbitrarily large numbers...