When the applied input is of positive polarity (say +V), diode D1 is forward-biased and diode D2 is reverse-biased. Assuming ideal diodes, the equivalent circuit in this case is shown below. The output (Vo) in this case is equal to +V.
Equivalent absolute value circuit with positive input
When the applied input is of negative polarity (say –V), diode D1 is reverse-biased and diode D2 is forward-biased. Assuming ideal diodes, the equivalent circuit in this case is shown in figure below. By applying Kirchhoff’s current law (KCL) at the inverting terminal of the first opamp, we can determine voltage (Vx) to be equal to (2/3)V. Also, Vx = (2/3)Vo. Therefore, Vo = V. Thus, the output always equals the absolute value of the input.
Equivalent absolute value circuit for negative input