The basic application of an Op-Amp is to use it as a voltage comparator. This is open loop operation of Op-Amp. The voltage at the Non-Inverting and Inverting terminals (pins) i.e., V+ and V- are compared, and if V+ > V- then output is +Vsat and if V+ < V- then output is –Vsat.
Op-Amp as a Comparator
The circuit above is a voltage comparator. The voltages across V+ and V- are controlled by potentiometers POT1 and POT2. +Vsat is 5V and –Vsat is GND in this circuit. When V+ > V- the output=1.49V which is Logic Low state. When V+ < V- the output=4V which is Logic High state.