shaiko
Advanced Member level 5
Will both of the codes below create identical logic ?
Code:
process is
begin
if reset = '1' then
events <= ( others => '0' ) ;
elsif input ( 0 ) /= default ( 0 ) then
events ( 0 ) <= '1' ;
elsif input ( 1 ) /= default ( 1 ) then
events ( 1 ) <= '1' ;
elsif input ( 2 ) /= default ( 2 ) then
events ( 2 ) <= '1' ;
end if ;
end process ;
Code:
process is
begin
if reset = '1' then
events <= ( others => '0' ) ;
else
for i in 0 to 2
loop
if input ( i ) /= default ( i ) then
events ( i ) <= '1' ;
end if ;
end loop ;
end if ;
end process ;