本人才学习VHDL语言,写了个查找最大值的程序,但编译总通不过,请教下哪出错?
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
use ieee.std_logic_unsigned.all;
type arr is array(35 downto 0) of std_logic_vector(8 downto 0);
entity findmax is
port (en:in std_logic;
ori-matrix:in arr;
maxut std_logic_vector(8 downto 0);
p,qut integer);
end findmax;
architecture behavioral of findmax is
signal a:std_logic_vector(8 downto 0);
begin
variable i:integer:=0;
if en='1' then
while i<35 loop
if i=0or7or14or21or28or35 then
i<=i+1;
elsif ori-matrix(i)(7 down to 0)>ori-matrix(i+1)(7 down to 0)
then a<=ori-matrix(i);
else a<=ori-matrix(i+1);
i<=i+1;
end if;
end if;
end loop;
p<=i/6+1;
q<=rem(i/6)+1;
end if;
max<=a;
end behavioral;
编译提示错误
** Error: D:/pca/findmax.vhd(5): near "type": expecting: ARCHITECTURE CONFIGURATION ENTITY LIBRARY PACKAGE USE
** Error: D:/pca/findmax.vhd(8): near "-": expecting: ':'
** Error: D:/pca/findmax.vhd(16): near "variable": expecting: END