Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

Use loop for with if

Altera_Forum
Honored Contributor II
1,124 Views

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;
0 Kudos
2 Replies
Altera_Forum
Honored Contributor II
434 Views

please be so kind to say something more about the error and what you intend to do...

0 Kudos
Altera_Forum
Honored Contributor II
434 Views

I didn't defined led as a signal but as a variable that's why it couldn't work :p  

thanks to have answered me
0 Kudos
Reply