tracy的样子 tracy的样子
关注数: 6 粉丝数: 17 发帖数: 879 关注贴吧数: 6
听说学校EDA大神很多哦,能证明你是么? 求解答疑问 VHDL编写的 library ieee; use ieee.std_logic_arith.all; use ieee.std_logic_1164.all; entity filter is port( clk,reset :in std_logic; sample_in :in signed (7 downto 0); result_out :out signed(20 downto 0)); end filter; architecture behave of filter is type coef_arr is array(0 to 18) of signed (7 downto 0); constant coefs: coef_arr:=coef_arr'("10000101","00000100","10000101","10001001","10000001","00000000","10001111","10001101","00011000","00110000","00011000",10001101","10001111","00000000","10000001","10001001","10000101","00000100","10000101"); begin process(clk,reset) type shift_register is array (17 downto 0) of signed (7 downto 0); variable shift : shift_register; variable temp : signed(7 downto 0); variable mul_value :signed(15 downto 0); variable acc_value : signed (20 downto 0); begin if(reset='0')then for i in 0 to 17 loop shift(i):=(others=>'0'); end loop; result_out<=(others=>'0'); elsif (clk'event and clk='1')then temp:=sample_in; mul_value:=temp*coefs(0); acc_value:=conv_signed(mul_value,20); for i in 17 downto 0 loop mul_value:=shift(i)*coefs(i+1); acc_value:=acc_value+conv_signed(mul_value,20); shift(i+1):=shift(i); end loop; shift(0):=temp; result_out<=acc_value; ——————报错在此 end if; end process; end behave; 报错类型Error (10500): VHDL syntax error at cou.vhd(39) near text "process"; expecting ";", or an identifier ("process" is a reserved keyword), or "architecture"
听说学校EDA大神很多饿,敢不敢冒个泡 求解答疑问 VHDL写的一段程序 library ieee; use ieee.std_logic_arith.all; use ieee.std_logic_1164.all; entity filter is port( clk,reset :in std_logic; sample_in :in signed (7 downto 0); result_out :out signed(20 downto 0)); end filter; architecture behave of filter is type coef_arr is array(0 to 18) of signed (7 downto 0); constant coefs: coef_arr:=coef_arr'("10000101","00000100","10000101","10001001","10000001","00000000","10001111","10001101","00011000","00110000","00011000",10001101","10001111","00000000","10000001","10001001","10000101","00000100","10000101"); begin process(clk,reset) type shift_register is array (17 downto 0) of signed (7 downto 0); variable shift : shift_register; variable temp : signed(7 downto 0); variable mul_value :signed(15 downto 0); variable acc_value : signed (20 downto 0); begin if(reset='0')then for i in 0 to 17 loop shift(i):=(others=>'0'); end loop; result_out<=(others=>'0'); elsif (clk'event and clk='1')then temp:=sample_in; mul_value:=temp*coefs(0); acc_value:=conv_signed(mul_value,20); for i in 17 downto 0 loop mul_value:=shift(i)*coefs(i+1); acc_value:=acc_value+conv_signed(mul_value,20); shift(i+1):=shift(i); end loop; shift(0):=temp; result_out<=acc_value; ——————报错在此 end if; end process; end behave; 报错类型Error (10500): VHDL syntax error at cou.vhd(39) near text "process"; expecting ";", or an identifier ("process" is a reserved keyword), or "architecture"
1 下一页