Hallo zusammen,
ich würde in VHDL Signale gern in einer for-loop einander zuweisen.
Allerdings bekomme ich "Syntax error near loop". Hoffe hier kann mir
jemand helfen, den Fehler zu finden.
1 | entity subproduct_comp is
|
2 | Port ( a : in STD_LOGIC;
|
3 | factor : in STD_LOGIC_VECTOR (23 downto 0);
|
4 | subproduct : out STD_LOGIC_VECTOR (23 downto 0));
|
5 | end subproduct_comp;
|
6 |
|
7 | architecture Behavioral of subproduct_comp is
|
8 |
|
9 | begin
|
10 | make_subproduct : for i in 0 to 23 loop
|
11 | subproduct(i) <= a AND factor(i);
|
12 | end loop make_subproduct;
|
13 |
|
14 | end Behavioral;
|
Die Fehlermeldung ist folgende:
ERROR:HDLCompiler:806 - "K:/subproduct.vhd" Line 41: Syntax error near
"loop".
ERROR:HDLCompiler:806 - "K:/subproduct.vhd" Line 43: Syntax error near
"loop".
ERROR:HDLCompiler:841 - "K:/subproduct.vhd" Line 43: Expecting type
void for <make_subproduct>.
ERROR:HDLCompiler:854 - "K:/subproduct.vhd" Line 38: Unit <behavioral>
ignored due to previous errors.
VHDL file K:/subproduct.vhd ignored due to errors