Hi Everyone,
Does anyone have any idea of how to compare two reference clock frequencies using digital logic only .
The problem is something like this .There are two slow ref clocks Khz range CLKA (RC oscillator clock) CLKB (crystal oscillator clock) and a fast sys_clk (pll clock) Mhz range
If freq CLKA > freq CLKB then op1 = 1 elsif freq CLKA < freq CLKB op2 = 1 else op3 = 1 end if
One solution that I can think of is running two parallel counters on the sys_clk for one period of the CLKA (count a) and CLKB 9ount b) and comparing the count values
if count a = count b then op3 = 1 elsif count a > count b then op2 = 1 -- freq CLKB > freq CLKA else -- freq CLKB < freq CLKA op1 = 1 end if
Is there a better way of doing this instead of using teo parallely running counters An optimum solution in terms of area will be highly appreciated
Eagerly awaiting some solutions