Connect with us

Comparing the frequencies of two slow reference clocks

Discussion in 'Electronic Basics' started by arant, Aug 14, 2006.

Scroll to continue with content
  1. arant

    arant Guest

    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
     
  2. Bob Masta

    Bob Masta Guest

    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
    www.daqarta.com
    Home of DaqGen, the FREEWARE signal generator
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-