harian
Junior Member level 1
- Joined
- Jan 13, 2015
- Messages
- 16
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1
- Activity points
- 137
hi. i have question regarding using variable or signal--
i have given a list of std vectors , i want these as input to my ports say to Op_1 and op_2. i have alittle bit doubt wheather to use signal or variable..
using variable
using signals
what is the difference between these two codes,,
i have given a list of std vectors , i want these as input to my ports say to Op_1 and op_2. i have alittle bit doubt wheather to use signal or variable..
using variable
Code:
type bit_vector_0 is array(1 to 10) of std_logic_vector(3 downto 0);
type bit_vector_1 is array(1 to 10) of std_logic_vector(3 downto 0);
process
variable b1 :bit_vector_0:=(others=>"0000");
variable b1 :bit_vector_1:=(others=>"0000");
begin
for i in 0 to 10 loop
op_:=b0;
op_1:=b1;
wait for 1 ns;
end loop;
end process
using signals
Code:
type bit_vector_0 is array(1 to 10) of std_logic_vector(3 downto 0);
type bit_vector_1 is array(1 to 10) of std_logic_vector(3 downto 0);
signal b1 :bit_vector_0:=(others=>"0000");
signal b1 :bit_vector_1:=(others=>"0000");
wait for 1 ns;
process
begin
for in 1 to 10 loop
op_:=b0;
op_1:=b1;
wait for 1 ns
end loop;
end process