Syntax error VHDL代码第二进程中的语法错误

Syntax error VHDL代码第二进程中的语法错误,syntax-error,vhdl,Syntax Error,Vhdl,所以我正试图编写一个VHDL程序来运行一个简单的自动售货机。它以25美分、5美分和10美分为单位在各州之间移动,以5美分为增量移动到45美分。当达到25美分时,它分配一个产品,如果超过25美分,比如说前一个州是20美分,再加上四分之一,使其达到45美分,然后它会在各州之间级联,分配变化,直到达到25美分。我还设置了重置 现在我遇到的问题很简单,但令人沮丧的是含糊不清。有两个过程,第一个fsm1保存在不同变化状态等之间移动的所有代码。第二个过程基本上允许异步复位。这是第二个过程,fsm2,我遇到了

所以我正试图编写一个VHDL程序来运行一个简单的自动售货机。它以25美分、5美分和10美分为单位在各州之间移动,以5美分为增量移动到45美分。当达到25美分时,它分配一个产品,如果超过25美分,比如说前一个州是20美分,再加上四分之一,使其达到45美分,然后它会在各州之间级联,分配变化,直到达到25美分。我还设置了重置

现在我遇到的问题很简单,但令人沮丧的是含糊不清。有两个过程,第一个fsm1保存在不同变化状态等之间移动的所有代码。第二个过程基本上允许异步复位。这是第二个过程,fsm2,我遇到了问题。现在,我得到了一个语法错误,它只是说“AND”附近有问题。就这样。如果有人能澄清问题所在,我会非常感激。代码如下

提前谢谢

-- Vending Machine FSM from Lab 8
-- There are 10 States, 3 Inputs, and 2 Outputs
-- When State is Start, Product is 0, Change is 0
--      Start moves to Five when Nickle is Pushed
--      Start moves to Ten when Dime is Pushed
--      Start moves to Twentyfive when Quarter is Pushed
-- When State is Five, Product is 0, Change is 0
--      Five moves to Ten when Nickle is Pushed
--      Five moves to Fifteen when Dime is Pushed
--      Five moves to Thirty when Quarter is Pushed
-- When State is Ten, Product is 0, Change is 0
--      Ten moves to Fifteen when Nickle is Pushed
--      Ten moves to Twenty when Dime is Pushed
--      Ten moves to Thirtyfive when Quarter is Pushed
-- When State is Fifteen, Product is 0, Change is 0
--      Fifteen moves to Twenty when Nickle is Pushed
--      Fifteen moves to Twentyfive when Dime is Pushed
--      Fifteen moves to Fourty when Quarter is Pushed
-- When State is Twenty, Product is 0, Change is 0
--      Twenty moves to Twentyfive when Nickle is Pushed
--      Twenty moves to Thirty when Dime is Pushed
--      Twenty moves to Fourtyfive when Quarter is Pushed
-- When State is Twentyfive, Product is 1, Change is 0
--      Twentyfive moves to Start unconditionally
-- When State is Thirty, Product is 0, Change is 1
--      Thirty moves to Twentyfive unconditionally
-- When State is Thirtyfive, Product is 0, Change is 1
--      Thirtyfive moves to Thirty unconditionally
-- When State is Fourty, Product is 0, Change is 1
--      Fourty moves to Thirtyfive unconditionally
-- When State is Fourtyfive, Product is 0, Change is 1
--      Fourtyfive moves to Fourty unconditionally

LIBRARY ieee;
USE ieee.std_logic_1164.ALL;

ENTITY vending IS
    PORT (
        reset       : IN    std_logic;
        clock       : IN    std_logic;
        QDN         : IN    std_logic_vector(2 DOWNTO 0);
        PC          : OUT   std_logic_vector(1 DOWNTO 0)
    );
END vending;

ARCHITECTURE behavior OF vending IS
    TYPE        statetype IS (Start, Five, Ten, Fifteen, Twenty, Twentyfive, Thirty, Thirtyfive, Fourty, Fourtyfive);
    SIGNAL      currentstate, nextstate     : statetype;
BEGIN
    fsm1:   PROCESS (QDN, currentstate)
    BEGIN
        CASE currentstate IS
                WHEN Start =>
                        PC <= "00";
                        CASE QDN IS
                                WHEN "000" =>
                                        nextstate <= Start;
                                WHEN "001" =>
                                        nextstate <= Five;
                                WHEN "010" =>
                                        nextstate <= Ten;
                                WHEN "100" =>
                                        nextstate <= Twentyfive;
                                WHEN OTHERS =>
                                        nextstate <= Start;
                        END CASE;
                WHEN Five =>
                        PC <= "00";
                        CASE QDN IS
                                WHEN "000" =>
                                        nextstate <= Five;
                                WHEN "001" =>
                                        nextstate <= Ten;
                                WHEN "010" =>
                                        nextstate <= Fifteen;
                                WHEN "100" =>
                                        nextstate <= Thirty;
                                WHEN OTHERS =>
                                        nextstate <= Start;
                        END CASE;
                WHEN Ten =>
                        PC <= "00";
                        CASE QDN IS
                                WHEN "000" =>
                                        nextstate <= Ten;
                                WHEN "001" =>
                                        nextstate <= Fifteen;
                                WHEN "010" =>
                                        nextstate <= Twenty;
                                WHEN "100" =>
                                        nextstate <= Thirtyfive;
                                WHEN OTHERS =>
                                        nextstate <= Start;
                        END CASE;
                WHEN Fifteen =>
                        PC <= "00";
                        CASE QDN IS
                                WHEN "000" =>
                                        nextstate <=Fifteen;
                                WHEN "001" =>
                                        nextstate <= Twenty;
                                WHEN "010" =>
                                        nextstate <= Twentyfive;
                                WHEN "100" =>
                                        nextstate <= Fourty;
                                WHEN OTHERS =>
                                        nextstate <= Start;
                        END CASE;
                WHEN Twenty =>
                        PC <= "00";
                        CASE QDN IS
                                WHEN "000" =>
                                        nextstate <= Twenty;
                                WHEN "001" =>
                                        nextstate <= Twentyfive;
                                WHEN "010" =>
                                        nextstate <= Thirty;
                                WHEN "100" =>
                                        nextstate <= Fourtyfive;
                                WHEN OTHERS =>
                                        nextstate <= Start;
                        END CASE;
                WHEN Twentyfive =>
                        PC <= "10";
                        nextstate <= Start;
                WHEN Thirty =>
                        PC <= "01";
                        nextstate <= Twentyfive;
                WHEN Thirtyfive =>
                        PC <= "01";
                        nextstate <= Thirty;
                WHEN Fourty =>
                        PC <= "01";
                        nextstate <= Thirtyfive;
                WHEN Fourtyfive =>
                        PC <= "01";
                        nextstate <= Fourty;
        END CASE;
    END PROCESS;

    fsm2:   PROCESS (reset, clock)
    BEGIN
        IF (reset = '0') THEN
                currentstate <= Start;
        ELSEIF (clock'EVENT) AND (clock = '1') THEN
                currentstate <= nextstate;
        END IF;
    END PROCESS;
END behavior;
——实验室8的自动售货机FSM
--有10个状态、3个输入和2个输出
--状态为Start时,产品为0,更改为0
--按下Nickle时开始移动到5
--按下Dime时,“开始”移动到10
--按下四分之一时,开始移动到二十五
--当状态为5时,乘积为0,更改为0
--当按下Nickle时,五移动到十
--一角硬币按下时,五个移动到十五个
--按四分之一时,五位移动到三十位
--当状态为10时,乘积为0,更改为0
--当按下Nickle时,10移动到15
--当一角硬币被按下时,十移动到二十
--按四分之一时,移动十到三十五
--当状态为15时,乘积为0,变化为0
--按下Nickle时,15移动到20
--一角硬币按下时,15个移动到25个
--当按下四分之一时,十五移动到四十
--当状态为20时,乘积为0,变化为0
--推尼克时,20移动到25
--一角硬币一推,二十就变成三十
--当按下四分之一时,二十移动到四十五
--当状态为25时,乘积为1,更改为0
--第二十五步无条件开始
--状态为30时,乘积为0,更改为1
--三十步到二十五步
--当状态为三十五时,乘积为0,变化为1
--三十五移到三十
--当状态为40时,乘积为0,变化为1
--第四十步到第三十五步
--当状态为四十五时,乘积为0,变化为1
--四十五到四十
图书馆ieee;
使用ieee.std_logic_1164.ALL;
实体销售是
港口(
复位:在标准逻辑中;
时钟:标准逻辑;
QDN:标准逻辑向量(2到0);
PC:OUT标准逻辑向量(1到0)
);
结束自动售货;
自动售货机的架构行为是
类型statetype是(开始、五、十、十五、二十、二十五、三十、三十五、四十、四十五);
信号当前状态,下一状态:statetype;
开始
fsm1:进程(QDN,当前状态)
开始
当前状态为
何时开始=>
个人计算机
下一州
下一州
下一州
下一州
下一州
个人计算机
下一州
下一州
下一州
下一州
下一州
个人计算机
下一州
下一州
下一州
下一州
下一州
个人计算机
下一州
下一州
下一州
下一州
下一州
个人计算机
下一州
下一州
下一州
下一州
下一州
个人计算机
elseif
not
elseif


之后,您的代码将进行分析。

是的,这就是问题所在。谢谢,我不知道那里没有e。
ELSEIF (clock'EVENT) AND (clock = '1') THEN