If the phase difference is lessthan 180° we can measure it by using a simple xor gate....
but it doesnt work if the phase difference is more than 180°.
Prehaps, u would need to use another faster clock to sample the data. implement an xor gate and count the number of "H" and "L". Then, based on the frequency of the sampling clock and the frequency of the two signals, you should be able to calculate the phrase difference.
Use a faster clock to sample these 2 clocks.
For ex: if you use an 8x faster clock, you can detect the 180o/8 phase different between these 2 clocks.
Rgrds,
ami