MODULUS operator

P

priya

hi all
i m using integer data type in VHDL .i have to perform modulo
operation.
but the problem i m facing is that the operand must be a constant
like
A<= (A+1) MOD X
where X is not a constant.
during synthesis i m facing this problem
plz help out soon
one more thing
in case of for loop
for i in 0 to N loop
end loop
again N is sppsed to be fixed

best regards
priya
 
V

Ved

You can use Fixed package availabe at www.eda.org/fphdl , written by
David Bishop.
Its very easy to use and synthesise well with synplify-pro. I havn't
used it on ISE or QUARTUS.

Regards
Ved
 
A

Andy

Modulo by a non-integer power of two is not supported by most synthesis
tools.

You could say:

if a + 1 > x then
a <= a + 1 - x;
else
a <= a + 1;
end if;

Which will synthesize for any value of x.

Andy
 
P

priya

hi
i m using Xilinx ISE 7.01.04i
best regards
priya said:
You can use Fixed package availabe at www.eda.org/fphdl , written by
David Bishop.
Its very easy to use and synthesise well with synplify-pro. I havn't
used it on ISE or QUARTUS.

Regards
Ved
 

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,754
Messages
2,569,528
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top