Altera_Forum
Honored Contributor
13 years agosimulate a vhdl code of a function with ISE
I've started to learn vhdl recently.i write a vhdl code to detemine the arith
statement,but it dosen't work.actually when i simulate it;the output dose not change and it remains 0.0; i don't know where is my mistake.Do I need to use a external clock??i do it but it dose not change :-( please help me library IEEE; use IEEE.STD_LOGIC_1164.ALL; package mypack is type real_vector is array (integer range <>) of real; end mypack; library IEEE; use IEEE.STD_LOGIC_1164.ALL; --use IEEE.STD_LOGIC_UNSIGNED.ALL; use work.mypack.all; entity convolution is port (x:in real_vector(0 to 3); y:in real_vector(0 to 1); f:out real_vector (0 to 4)); end convolution; architecture Behavioral of convolution is --signal temp : real_vector (0 to 4):= (others => 0.0); --signal enable : std_logic :='0'; begin process (x,y) variable sum :real; begin for n in f'range loop enable <= '0'; for k in y'range loop sum:=sum + x(k)*y(n-k); end loop; -- temp(n) <= sum; f(n) <= sum ; sum:=0.0; end loop; enable <= '1'; --if (enable'event and enable='1') then -- f <= temp; --end if; end process; end Behavioral;