Figure 7.13 shows a better version of the H circuit in which logic gates are used to control inputs A and B to achieve the above conditions with now one input supplied with a signal to switch the motor into forward or reverse and the other input the PWM signal. Such a circuit is better suited to microprocessor control for d.c. motors. A high input to the forward/reverse input means that when there is a high PWM signal the AND gate 1 puts transistor 1 on because the two inputs to it are high and so its output is high. The inverter means that AND gate 2 receives a low pulse when the forward/reverse input is high. As a result, transistor 3 is switched off. Because the AND gates 3 and 4 receive the same inputs, transistor 4 is on and transistor 2 is off. The situations arc reversed when the signal to the forward/reverse input goes low.