Comparator: A comparator is a combinational circuit that gives the output in terms of input signals.
It is used to compare numbers and represent their relationship with each other.
It compares the signals as A > B, A < B, and A = B.
1-bit comparator:A 1-bit comparator circuit is shown below.

In this circuit, we can compare two input signals
The truth table for the 1-bit comparator is

The expression for A = B: A ⊙ B
The expression for A > B: A B̅
The expression for A < B: A̅ B