Rotate_operator in VHDL

Status
Not open for further replies.

swapnil_vlsi

Full Member level 1
Joined
Jul 18, 2007
Messages
95
Helped
7
Reputation
14
Reaction score
5
Trophy points
1,288
Activity points
1,900
rol can not have such operands in this context

in my code i have to rotates the data left/right by a variable amount k.
but it shows me Error ...The error is ror and rol can not have such operands in this context............

Can any one do tell me how can i remove this error........

my code is..........


library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
use IEEE.NUMERIC_BIT.ALL;


entity rotate_operator is
generic(w: integer :=8; size: integer :=3);
port(A : in std_logic_vecor(w-1 downto 0);
k : in std_logic_vecor(size-1 downto 0);
o : out std_logic_vecor(w-1 downto 0));
end rotate_operator;






architecture arch_rotate_operator of rotate_operator is
begin
process(A , k)
begin
o <= ((A ror k) or (A rol k));


end arch_rotate_operator
 

rol can not have such operands in this context.

How did you define the ror & rol functions ?
 

ror can not have such operands in this context

Mate, I cannot help you with your code, nevertheless, I have written two functions i.e 'crr' and 'crl' which will do what you want. If you like, feel free to use them
And here they are:
http://www.vlsiip.com/vhdlf.html
Kr,
Avi
http://www.vlsiip.com
 

ror en vhdl

Hi,
- Check if you included the library wich contain the function rors and rols.
- How did you the rotating fucntions. Perhaps errors are there
 

ROtate separately ,assign to signal temp and then perform oring not simulatnously. plz try this.
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…