;D.... Surprisingly, a comparator compares voltage between two points. It is mostly realized by an operational amplifier because of its high amplifying coefficient (10^4 and more). As a result of this, when the voltage of inverting input of the amplifier is higher, the voltage on output is -supply voltage. Otherwise +supply voltage. But be carefull of the connection! (sorry for my english :P)