PURPOSE: To prevent misjudgement even in case of pulse cracking by generating a two-phase pulse signal outputted by a two-phase pulse generator coupled with a rotary body so that different logic signals are outputted in forward rotation and backward rotation.
CONSTITUTION: A 1st latch circuit 3 latches the edges of a 1st pulse signal A and a 2nd pulse signal B from the two-phase pulse generator 2 and the output of this circuit 3 is inputted to a pulse edge generating circuit 5. Here, a 1st pulse edge signal D is generated and outputted corresponding to the pulse edge of the signal A and a 2nd pulse edge signal E is generated and outputted corresponding to the pulse edge of the signal B. An FF element 6 is set with the signal D and reset with the signal E. The output signal F of this element 6 and the output signal C of a 2nd exclusive OR element 4 are ORed exclusively by a 2nd exclusive OR element 7, which outputs a signal G. A 2nd latch circuit 8 inputs the signal G and a clock signal J outputted by a clock oscillation circuit 9 and delays the signal G by a specific time to output a signal K.