Pulse width modulated signal can be generated by using a
simple circuit as seen at Figure 1 below. This circuit consist of two main
circuit blok, a triangle signal generator and a comparator. There is one
input (voltage that need to be converted to PWM) and one output (PWM
signal).

Figure 1. Pulse width modulated signal generator.
Figure 2 explains how pulse width modulated signal is
built. When V input is greater than the amplitude of the triangle wave then
comparator outputs is high, so do the opposite when V input is smaller then
the amplitude of the triangle wave.

Figure 2. Pulse width modulated signal simulation.
