MOD operator synthesis

Discussion in 'VHDL' started by Basel Naamna, May 8, 2004.

  1. Basel Naamna

    Basel Naamna Guest

    i'v coded gcd algorithm in vhdl, and i'v used the MOD operator, but i
    got problems in synthesis, synthesis is ready to accept power of two
    right operand with MOD operator.
    any one have idea how to get over this problem?
    Basel Naamna, May 8, 2004
    #1
    1. Advertising

  2. Basel Naamna wrote:
    > i'v coded gcd algorithm in vhdl, and i'v used the MOD operator, but i
    > got problems in synthesis, synthesis is ready to accept power of two
    > right operand with MOD operator.


    That's the way it is. Mod does work for constants.
    Hmm...Maybe a counter that rolls over at your
    special number will do what you want.

    -- Mike Treseler
    Mike Treseler, May 10, 2004
    #2
    1. Advertising

  3. Basel Naamna

    Ken Smith Guest

    In article <>,
    Basel Naamna <> wrote:
    >i'v coded gcd algorithm in vhdl, and i'v used the MOD operator, but i
    >got problems in synthesis, synthesis is ready to accept power of two
    >right operand with MOD operator.
    >any one have idea how to get over this problem?


    Divide and Mod operators take up all the gates in the world if you do them
    all in one clock. If you can take several clock cycles for each, life
    will be a lot easier.

    For a mod, you slide the bigger number in from the LSB and compare after
    each shift. If the contents of the shift register are >= the smaller
    number, you subtract. It takes as many shifts as the number of bits you
    can handle.

    --
    --
    forging knowledge
    Ken Smith, May 10, 2004
    #3
    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. praveen

    MOD function synthesis

    praveen, Sep 23, 2003, in forum: VHDL
    Replies:
    1
    Views:
    831
    Allan Herriman
    Sep 24, 2003
  2. Replies:
    1
    Views:
    530
    Allan Herriman
    Feb 7, 2005
  3. Hari Sekhon
    Replies:
    0
    Views:
    494
    Hari Sekhon
    Jun 20, 2006
  4. ryles
    Replies:
    3
    Views:
    516
    Piet van Oostrum
    Jul 26, 2009
  5. T. Onoma
    Replies:
    9
    Views:
    341
    Dave Thomas
    Dec 15, 2003
Loading...

Share This Page