Detection of shaft direction is very useful and even critical to some applications. In a radio, the rotational direction of the volume knob tells the receiving circuit whether to increase or decrease the volume with each square wave. In automation equipment, the rotational direction is detected and other operations are initiated when a pre-set number of pulses for that direction has been achieved. An elaborate and sophisticated set of movements can be executed automatically to perform tasks like placing components on a pc board, welding seams in an automobile body, moving the flaps of a jumbo jet or just about anything that involves a set of precise motions. In the first illustration here, signal A leads B, i.e., signal A outputs a rising edge before signal B. This indicates the shaft is rotating counter-clockwise. In the second illustration, signal B leads A. This indicates the shaft is rotating clockwise.