Forum Discussion
Altera_Forum
Honored Contributor
14 years agoVHDL advice needed - multiplicating combinational logic.
I have a piece of code that I want implemented as combinational logic, but I want 16 identical modules of it.
Currently I'm doing something like
for i in 0 to OUTPUTNO-1 loop
outputs(i) <= outputsignal(i) and not outputban(i);
end loop;
But afaik, that kind of loop is only allowed inside a process, which I have to declare as sensitive to outputsignal and outputban (which are of type array of std_logic). Is there any more generic way of duplicating code in VHDL, that works outside of a process also?1 Reply
- Altera_Forum
Honored Contributor
--- Quote Start --- Is there any more generic way of duplicating code in VHDL, that works outside of a process also? --- Quote End --- Yes, its called a generation loop. Your code just needed a label and a slight change in syntax:
Cheers, Daveg1: for i in 0 to OUTPUTNO-1 generate outputs(i) <= outputsignal(i) and not outputban(i); end generate;