Hello Ashwin,
You have not explained the exact nature of your problem, and it would be a good idea to post the relevant portion of your code here, so as to avoid any ambiguity.
I assume you wish to compare the light intensity from two different sources, to determine which is the stronger source. Do you have one LDR circuit connected to one input of the comparator, and the second LDR connected to the other input? Do you bias each LDR with a resistor connected to Vdd?
Since the LDR devices may have a wide unit-to-unit tolerance, you will likely need to provide adjustment of the bias current to compensate for this tolerance. You will also need to check that the resistor values you have chosen provide sufficient dynamic range over the range of lignt levels of interest. The comparison is unlikely to be satisfactory if the voltage levels applied to the comparator inputs are quite close to zero or to Vdd, since a large change of light level would produce a very small change of voltage.
A final thought - you might also consider the use of the ATD module for this application. Simply measure the output from each LDR circuit, and compare the values in firmware. This has the advantage that you can apply a calibration factor to each reading, before making a comparison. You can also check the dynamic range within the firmware.
Regards,
Mac