- UID
- 1029342
- 性别
- 男
|
我的程序出现了这句错误:Error (10500): VHDL syntax error at counter.vhd(80) near text "PROCESS"; expecting "if"。该如何改???急!!!
源程序:
LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.ALL;
USE IEEE.STD_LOGIC_UNSIGNED.ALL;
ENTITY counter IS
PORT(rst:in std_logic;
ADD: IN STD_LOGIC;
CHOS:IN STD_LOGIC_VECTOR(3 DOWNTO 0);
A2,A1,A0:OUT STD_LOGIC_VECTOR(3 DOWNTO 0);
B2,B1,B0:OUT STD_LOGIC_VECTOR(3 DOWNTO 0);
C2,C1,C0:OUT STD_LOGIC_VECTOR(3 DOWNTO 0);
D2,D1,D0:OUT STD_LOGIC_VECTOR(3 DOWNTO 0));
END counter;
ARCHITECTURE rtl OF counter IS
BEGIN
PROCESS(rst,ADD,CHOS)
VARIABLE POINTS_A2:STD_LOGIC_VECTOR(3 DOWNTO 0);
VARIABLE POINTS_A1:STD_LOGIC_VECTOR(3 DOWNTO 0);
VARIABLE POINTS_B2:STD_LOGIC_VECTOR(3 DOWNTO 0);
VARIABLE POINTS_B1:STD_LOGIC_VECTOR(3 DOWNTO 0);
VARIABLE POINTS_C2:STD_LOGIC_VECTOR(3 DOWNTO 0);
VARIABLE POINTS_C1:STD_LOGIC_VECTOR(3 DOWNTO 0);
VARIABLE POINTS_D2:STD_LOGIC_VECTOR(3 DOWNTO 0);
VARIABLE POINTS_D1:STD_LOGIC_VECTOR(3 DOWNTO 0);
BEGIN
IF rst='0' then ---加分信号上升沿有效
points_a2:="0001";points_a1:="0000";
points_b2:="0001";points_b1:="0000";
points_c2:="0001";points_c1:="0000";
points_d2:="0001";points_d1:="0000";
elsif (ADD'EVENT AND ADD='1') THEN
if chos="0001" then ---A组答对,加10分
IF POINTS_A1= "1001" then --十位为9
POINTS_A1:="0000";
else POINTS_A2:=POINTS_A2+"0001"; ----十位清零
IF points_a2="1001" then ----百位为9
POINTS_A2:="0000";
else POINTS_A1:=(POINTS_A1)+"0001";
end if; ----百位清零
END IF;
IF (CHOS="0010") THEN
IF POINTS_B1="1001" THEN
else POINTS_B1:="0000";
POINTS_B2:=POINTS_B2+"0001";
IF POINTS_B2="1001" THEN
POINTS_B2:="0000";
else POINTS_B1:=POINTS_B1+"0001";
END IF;
end if;
IF CHOS="0010" THEN
IF POINTS_C1="1001" THEN
POINTS_C1:="0000";
else POINTS_C2:=POINTS_C2+"0001";
IF POINTS_C2="1001" THEN
POINTS_C2:="0000";
else POINTS_C1:=POINTS_C1+"0001";
END IF;
end if;
IF CHOS="0010" THEN
IF POINTS_D1="1001" THEN
POINTS_D1:="0000";
else POINTS_D2:=POINTS_D2+"0001";
IF POINTS_D2="1001" THEN
POINTS_D2:="0000";
else POINTS_D1:=POINTS_D1+"0001";
END IF;
END IF;
END IF;
A2<=POINTS_A2; -------将各组得分赋给输出信号
A1<=POINTS_A1;
A0<="0000";
B2<=POINTS_B2;
B1<=POINTS_B1;
B0<="0000";
C2<=POINTS_C2;
C1<=POINTS_C1;
C0<="0000";
D2<=POINTS_D2;
D1<=POINTS_D1;
D0<="0000";
end if;
end process;
END rtl; |
|