R
ramy
Hi, What is the difference between the two assignments?
signal s1 : std_logic_vector(3 downto 0);
signal s2 : std_logic_vector(3 downto 0);
begin
main : process (clock, reset_n)
variable v1 : std_logic_vector(3 downto 0) := (others => '0');
variable v2 : std_logic_vector(3 downto 0) := (others => '0');
begin
if (reset_n = '0') then
s1 <= (others => '0');
s2 <= (others => '0');
elsif (clock'event and clock = '1' ) then
-- ASSIGNMENT 1
v1 := '1' + s1;
s1 <= v1;
-- ASSIGNMENT 2
s2 <= v2;
v2 := '1' + s2;
end if;
end process main;
signal s1 : std_logic_vector(3 downto 0);
signal s2 : std_logic_vector(3 downto 0);
begin
main : process (clock, reset_n)
variable v1 : std_logic_vector(3 downto 0) := (others => '0');
variable v2 : std_logic_vector(3 downto 0) := (others => '0');
begin
if (reset_n = '0') then
s1 <= (others => '0');
s2 <= (others => '0');
elsif (clock'event and clock = '1' ) then
-- ASSIGNMENT 1
v1 := '1' + s1;
s1 <= v1;
-- ASSIGNMENT 2
s2 <= v2;
v2 := '1' + s2;
end if;
end process main;