Question about shifting

J

jahaya

Hello Folks,

I would like to shift some set of bits in a std_logic_vector array

CALC:pROCESS(CLK)
signal REG_S: std_logic_vector (15 downto 0);

begin

if (CLK = '1' and CLK'event) then
REG_S(15 to 13) <= REG_S(14 to 12);
REG_S(11 to 6) <= REG_S(10 to 5);
REG_S(4 to 1) <= REG_S(3 to 0);
end if;
end process CALC;

I am getting an warning message as "The range is "null range" and error
message as "Direction of the discrete range must be the same as that of
the prefix of the slice name"

I didnt understand the error ? Can anyone explain this prob ?

Thanks in advance,
ALI
 
J

jahaya

I guess I should use as below :

REG_S(15 downto 13) <= REG_S(14 downto 12);
REG_S(11 downto 6) <= REG_S(10 downto 5);
REG_S(4 downto 1) <= REG_S(3 downto 0);

ALI
 

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

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top