Comparators

Like Grumpy_Mike said. The digital type and the analogue type. I don't know what type you want to know, but if you mean analogue... Well it basically two Voltage divider and one op-amp.

Here is example: +5 V -- 10 K ---to "plus" side of op-amp ---- 10 K -- GND <--- V1 is 2.5 V
+5 V -- 47 K --- to "minus" side of op-amp --- 10 K --- GND <--- V2 is 0.877 V
The op-amp output will be a HIGH or + 5 V <--- hope I am right.

Use a LM339 <----- It will work. BUT do not use the following... LM741, LF071, LF072, LM1458 ... they did not works. I try. My raison is they need dual power ( plus / GND / minus ). The LM339 do not need dual power only one. ( plus / GND )

Analogue comparator are usefull if you need two state ( HIGH or LOW )