Altera_Forum
Honored Contributor
12 years agoUse loop for with if
In my architecture I put a loop for, and I want when my index = 1, switch on my led 1,
but for others switch them off, maybe this is a stupid error, but myfollowing code is wrong the error comes from line : if (i = 1) then, please anyone could help me ? gene_led: for i in 4 downto 1 generate process(init,opg_clk) begin if (i = 1) then led(i) <= '0'; else led(i) <= '1'; end if; end process; end gene_led;