Speed Calculation From HallCodes

Hi:

How do we generate positive speed if ramp is going from 0 to 360 degree(Hal sequence 645132) and negative speed if ramp is going from 360 to 0 degree. Can you please suggest on this.

Regards, MALA