VHDL IF语句不起作用

时间:2016-05-08 09:53:41

标签: if-statement process vhdl

我对VHDL的if语法有疑问。 代码如下:

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;

entity Shifting_zero is
    port (clk : in STD_LOGIC;
            zeros : buffer STD_LOGIC_VECTOR (3 downto 0));
end Shifting_zero;

architecture Behavioral of Shifting_zero is
begin

process
    begin
        if (clk'event and clk='1') then
            if (zeros='0111') then 
                zeros <= '1011';
            elsif (zeros='1011') then
                zeros <= '1101';
            elsif (zeros-'1101') then
                zeros <= '1110';
            else
                zeros <= '0111';
            end if;
        end if;
end process;

end Behavioral;

我收到以下错误:

  

第15行。解析错误,意外的PROCESS

     

第18行。解析错误,意外TICK

     

第20行。解析错误,意外TICK

     

第23行。解析错误,意外TICK

     

第26行。解析错误,意外结束,期待SEMICOLON

     

第12行。没有敏感列表,也没有等待(警告)

我是VHDL的新手并且对这些错误感到很困惑。

1 个答案:

答案 0 :(得分:-1)

好的,我找到了。

我不得不在信号中使用“而不是”。

相关问题