Learn about Digital Comparators with interactive circuit diagrams, truth tables, Boolean expressions, comparison logic, logic gate implementation, and digital logic examples.
A magnitude comparator decides whether A is greater than, less than, or equal to B. EQ = A XNOR B (the bits match), GT = A·B′ (A is a 1 where B is a 0), and LT = A′·B (A is a 0 where B is a 1). Exactly one of the three outputs is ever high — chaining these stages (with priority logic on the equal output) lets you compare multi-bit numbers MSB to LSB.
| A | B | GT | LT | EQ |
|---|