Correct answer is (a) To provide direction of motion
The explanation: The rotary encoder has a CLK pin and a DATA pin. The DATA pin gives out pulses which vary in phase depending upon the direction of rotation of the rotary encoder which is determined by comparing it with the non-variable pulse train of the CLK pin.