This circuit generates the square wave .
You can adjust the amplitude of this wave by adjusting the dc voltage across diode and time period by afjusting the frequency of input sine voltage.
In this example
Amplitude = 1.02 Volts
Time period = 1ms
i.e, frequency = 1KHz