Forum Discussion
Altera_Forum
Honored Contributor
13 years agomodulo on parameters
Hi all! I need to do operations on multiple elements of an input vector. The elements should be handled cyclic, so that the modulo operator % would come in handy. But it doesn't work (see below). ...
Altera_Forum
Honored Contributor
13 years agoAfaik, verilog's modulo works on powers of two. This limitation makes sense because it can merely select the bit indexes of the modulo argument.
I'd imagine that with that limitation, the synthesis algorithms probably just don't bother handling anything other than a power of two. You should write an iterative function which performs the modulo.