A comparator is a combinational logic circuit that compares input bits and gives an output that indicates the equality/inequality.