Go Back   Velocity Reviews > Newsgroups > VHDL
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

VHDL - MODULUS operator

 
Thread Tools Search this Thread
Old 11-15-2006, 07:39 AM   #1
Default MODULUS operator


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



priya
  Reply With Quote
Old 11-15-2006, 08:29 AM   #2
Ved
 
Posts: n/a
Default Re: MODULUS operator

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

priya wrote:
> 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


  Reply With Quote
Old 11-15-2006, 01:42 PM   #3
Andy
 
Posts: n/a
Default Re: MODULUS operator

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

priya wrote:
> 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


  Reply With Quote
Old 11-16-2006, 03:54 AM   #4
priya
 
Posts: n/a
Default Re: MODULUS operator

hi
i m using Xilinx ISE 7.01.04i
best regards
priya
Ved wrote:
> 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
>
> priya wrote:
> > 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


  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump