Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > MOD operator synthesis

Reply
Thread Tools

MOD operator synthesis

 
 
Basel Naamna
Guest
Posts: n/a
 
      05-08-2004
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?
 
Reply With Quote
 
 
 
 
Mike Treseler
Guest
Posts: n/a
 
      05-10-2004
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
 
Reply With Quote
 
 
 
 
Ken Smith
Guest
Posts: n/a
 
      05-10-2004
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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Why doesn't `from pkg import mod' work after `del pkg.mod'? ryles Python 3 07-26-2009 04:13 PM
difference between import from mod.func() and x=mod.func() Hari Sekhon Python 0 06-20-2006 08:07 AM
Query about MOD operator for synthesis jahaya@gmail.com VHDL 1 02-07-2005 08:42 AM
append_features(mod) -- mod.kind_of? makes absolutely no sense T. Onoma Ruby 9 12-15-2003 03:34 AM
MOD function synthesis praveen VHDL 1 09-24-2003 12:45 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57