Determining the direction of rotation value

The two pulses, A and B, are shifted by a quarter of a cycle with respect to each other. The shift between the two signals enables the controller or the simulation to determine the direction of rotation, according to whether pulse A leads pulse B, or vice versa.