How is a square wave generated?

That is just used as a comparator. The sine wave is either above or below the reference and that is the result of the comparison.


If you consider the inverting mode amplifier with which you are familiar you should be able to spot:

schematic

simulate this circuit – Schematic created using CircuitLab

Figure 1. An inverting amplifier. If Rf is omitted, then Rf = ∞ and the gain becomes the open-loop gain of the op-amp.

  1. The signal is applied to the inverting input so it's an inverting amplifier.
  2. R2 and R3 provide a reference voltage for the non-inverting input. R2 should, presumably, be connected to +VS.
  3. There is no negative feedback resistor or, to put it another way, Rf = ∞ so the gain is "infinite".

As soon as VIN- exceeds VIN+ the output will swing to the negative rail. When the situation is reversed the output will swing to the positive rail.