We propose a directed optical comparator, which is composed of two microring resonators (MRRs) and a
optical combiner. The two MRRs are modulated by two electrical signals, which represent the two binary numbers to be compared. Three optical signals are output by the device, which represent the comparison results. As a proof of concept, a directed optical comparator based on thermo-optic effect is fabricated and the device can perform the comparison function of two binary numbers at the speed of 10 kb/s.