Comparing two input signals (A and B). A is top, B is bottom.
Output:
top AND : TRUE if A is larger
middle NOT: TRUE if A is not equal to B
bottom AND : TRUE if B is larger
How does it work?
XOR gates return TRUE iff both inputs are different. so by feeding it into AND, it will return TRUE iff both inputs are the same.
if A and B is different and A is one, it must be the case that A is greater than B.
This is the building block for making binary comparator in higher digits.