[英]VHDL IF statement does not work
I've got a problem with VHDL's if
syntax. 我对VHDL的
if
语法有疑问。 The code looks as follows: 该代码如下所示:
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;
I receive the following errors: 我收到以下错误:
Line 15. parse error, unexpected PROCESS
第15行。解析错误,意外的过程
Line 18. parse error, unexpected TICK
第18行,解析错误,意外的TICK
Line 20. parse error, unexpected TICK
第20行,解析错误,意外的TICK
Line 23. parse error, unexpected TICK
第23行。解析错误,出现意外的TICK
Line 26. parse error, unexpected END, expecting SEMICOLON
第26行。解析错误,意外结束,期望使用SEMICOLON
Line 12. No sensitivity list and no wait in the process (warning)
第12行,没有敏感度列表,也没有等待过程(警告)
I'm new to VHDL and pretty confused by those errors. 我是VHDL的新手,并对这些错误感到困惑。
OK, I found it. 好的,我找到了。
I had to use " instead of ' in signals. 我必须在信号中使用“而不是”。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.