繁体   English   中英

VHDL IF语句不起作用

[英]VHDL IF statement does not work

我对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行。解析错误,意外的过程

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

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

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

第26行。解析错误,意外结束,期望使用SEMICOLON

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

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

好的,我找到了。

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM