The circuit consists of 4 photo detectors, 2 current comparators and 2 latches. The 4 photo detectors are spaced in fixed distance such that they can be controlled to a light period or dark period. The photo detectors transfer light into current, then the current comparators generate the results to the latches. If the comparator output is “larger than”, the latch output is in set state. Otherwise the latch output is in reset state.