Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unable to carry out mod function.

Status
Not open for further replies.

yongsong

Programmer
Mar 12, 2003
2
0
0
SG
Hi,
whenever i include a 'mod' function in my code, an error will occur during synthesis where it state that a modular function of 2 must be carry out.
May i know why is this so and is there any way to carry out a "mod" function? (wat i'm doing now is to loop a subtract for a number of times till i got the intended result.) thanks.

Best Regards,
Yong Song.
 
I have had the same problem, and determined that it was impossible to accomplish what I wanted in Xilinx. I coded a mod component that was a state machine implementing Booth's algorithm.
 
I generated core from core generator for single port block RAM and I dont know how to instantiate it from a VHDL program. I generated a file with extension .xco. could u help me how to instatiate it.

 
Most of the synthesis tools do not support any of the division operations, including the mod operations for when the right side operator (... the divisor) is not a value equal to some power of 2. That is, if your expression is
a mod b,
then b has to be a value which is a power of 2. If you want to implement this operation for all values of b, then you have to write your own code using some division algorithmns to implement such a function.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top