If negative input ==> 0 V Otherwise, input voltage
What you are looking for is a rectifier, if the voltage drop of the diode is of no importance ,then this circuit will do the trick.







simulate this circuit &ndash; Schematic created using CircuitLab

But, if you want to compensate for the voltage loss over the diode you'll need an Opamp .







simulate this circuit