A digital logic component that compares two binary numbers.

Equality Comparator
Outputs whether the two numbers are equal or not.
Magnitude Comparator
Outputs whether the two numbers are equal or less than or greater than.
1-bit Magnitude Comparator
Suppose the comparator takes in A and B. And the output G denotes whether
A is greater than B.
G=AB
E=AB+A⋅B
L=AB
n-bit Magnitude Comparator
Let
xi=AiBi+Ai⋅Bi=Ai⊕Bi.
xi denotes if Ai=Bi.
G=i=0∑n−1((j=i+1∏n−1xj)AiBi)
E=i=0∏n−1xi
L=i=0∑n−1((j=i+1∏n−1xj)AiBi)