indexing with an integer signal

  • Thread starter hessam.1983@gmail.com
  • Start date
H

hessam.1983@gmail.com

Guest
hi
i have a problem with indexing my bit_vector with an integer signal.
------------------------------------
entity testinteger is
end entity;
architecture test of testinteger is
signal int:integer;
signal bin1:bit_vector(5 downto 0);
signal bin2:bit_vector(2 downto 0);
begin
int<=2;
bin1<="110010";
bin2<=bin1(int*2 downto int*2-2);
end test;
------------------------------------

if you run this little program , you get an error!!this program
decrements "int" and i don't know why??!!it shouldn't do that.
i don't want to declare "int" as a const.
can anyone help me what should i do??
hess@m..
 
What error do you get? I ran it in VCS-MX, no error.
Ajeetha
www.noveldv.com
 
hessam.1983@gmail.com a écrit :

hi
i have a problem with indexing my bit_vector with an integer signal.
------------------------------------
entity testinteger is
end entity;
architecture test of testinteger is
signal int:integer;
signal bin1:bit_vector(5 downto 0);
signal bin2:bit_vector(2 downto 0);
begin
int<=2;
bin1<="110010";
bin2<=bin1(int*2 downto int*2-2);
end test;
------------------------------------

if you run this little program , you get an error!!this program
decrements "int" and i don't know why??!!it shouldn't do that.
i don't want to declare "int" as a const.
can anyone help me what should i do??
Just think about what happen at time=0.
Signal int is initialized with integer'left...

JD.
 

Welcome to EDABoard.com

Sponsor

Back
Top