even or odd

Discussion in 'VHDL' started by crazyrdx, Aug 31, 2005.

  1. crazyrdx

    crazyrdx Guest

    If I need to check whether I have an even clock cycle or odd, how can I
    do it? should I use a counter? If using a counter, do I %2 it to check
    if it returns 0 or 1? Is there an easier way to check for even or odd
    clock cycles?

    thanks
     
    crazyrdx, Aug 31, 2005
    #1
    1. Advertising

  2. crazyrdx

    Zara Guest

    crazyrdx wrote:
    > If I need to check whether I have an even clock cycle or odd, how can I
    > do it? should I use a counter? If using a counter, do I %2 it to check
    > if it returns 0 or 1? Is there an easier way to check for even or odd
    > clock cycles?
    >
    > thanks
    >

    Yes, use a T type flip flop. Thjis is a flip flop that toggles every
    clock cycle, and may be created with any primitive flip flop type.

    And, in a HW independent manner:

    process(reset,clock)
    begin
    if reset='1' then
    state<='0';
    elsif rising_edge(clock) then
    state<=not state;
    end if;
    end process;
    output<=state;

    If you fill in the holes left, you will have a full functioning, optimal
    "odd-even" cycle detector.

    Regards
     
    Zara, Aug 31, 2005
    #2
    1. Advertising

  3. crazyrdx

    crazyrdx Guest

    THANKS!
     
    crazyrdx, Aug 31, 2005
    #3
  4. crazyrdx

    viku Guest

    plz write ur question in more details.what do u mean by even and odd
    clocks??
     
    viku, Sep 1, 2005
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Patrick

    odd and even signals

    Patrick, Dec 21, 2004, in forum: VHDL
    Replies:
    1
    Views:
    2,790
    Jonathan Bromley
    Dec 21, 2004
  2. Stan Goodman

    Even older fart, even newer newbie

    Stan Goodman, Jul 3, 2003, in forum: Java
    Replies:
    11
    Views:
    696
    Stan Goodman
    Jul 4, 2003
  3. Lin
    Replies:
    25
    Views:
    39,125
    taraval
    Feb 4, 2011
  4. Nathan
    Replies:
    0
    Views:
    912
    Nathan
    Aug 30, 2005
  5. Serve Laurijssen

    odd/even bitwise and

    Serve Laurijssen, Apr 6, 2004, in forum: C Programming
    Replies:
    27
    Views:
    1,223
    Michael Wojcik
    Apr 13, 2004
Loading...

Share This Page