The circuit below shows how to configure 3 gates of a 7400 to obtain a rectangular signal from a sinusoidal. The circuit must be powered by 5V.