MOD operator synthesis

B

Basel Naamna

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?
 
M

Mike Treseler

Basel said:
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
 
K

Ken Smith

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.
 

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. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,071
Latest member
MetabolicSolutionsKeto

Latest Threads

Top