A CPLD-based Photoelectric encoder that measures angle and angular velocity was designed aiming at precise requirements on angle and angular velocity measures in photo-electric servo system. Based on the work principle of photoelectric encoder, a segmented velocity-measure algorithm based on different measure time intervals was presented, and the concrete process in the environment of Isplever Project Navigator was detailed described. Finally, DSP processor TMS320F2812 and CPLD chip LC4512V-75T176 were used for verification. The result showed that this circuit has the features of realization-simple, high measure precision and reliability as well as good commonality. It will lay a solid foundation for the realization of photoelectric servo system’s digital control.