how to make circuit to output high(1) or low(0) for microcontroller depending upon whether there is ac signal or not. the ac signal amplitude is between 0 to 5V. it is not AC main line signal.
In comments you specified
frequency is around 15hz. ... it is ac signal with one peak at around 4.5V and 0.1V in negative cycle
For this scenario, there's no external circuit needed except maybe a digital buffer (with a few mV hysteresis, maybe). If your micro runs on 3.3 V, use a buffer with 5 V tolerant inputs.
Detect the signal presence using a timer in the micro. Each time the input transitions low-high, reset the timer and consider that "signal present". If the timer ever reaches slightly longer than the maximum signal period, consider that "signal absent".