Comparing the frequencies of two slow reference clocks

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 (count 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

Reply to
arant
Loading thread data ...

How about an up-down counter chip like a '193, with CLKA and CLKB going to the Up and Down inputs, respectively? Then you will either get a stream of Carry outputs if CLKA is faster, or Borrow if CLKB is faster.

Best regards,

Bob Masta dqatechATdaqartaDOTcom D A Q A R T A Data AcQuisition And Real-Time Analysis

formatting link
Home of DaqGen, the FREEWARE signal generator

Reply to
Bob Masta

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.