我想写一个一个模块,功能是这样的:sp2是由闹钟模块输出的闹钟信号,pass和stop是两个按键,stop按下蜂鸣器停止,pass按下后蜂鸣器停止。但是3分钟后会再响,响5次之后就不会再响了。我自己写了个模块,老是报错,报错信息:can't determine definition of operator ""+"" -- found 0 possible definitions。求高手帮忙解决。程序如下
LIBRARY ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity lanren is
port(clk,sp2,pass,stop: in std_logic;
sp :out std_logic );
end entity lanren;
ARCHITECTURE art OF lanren IS
signal a: std_logic;
begin
process(clk,sp2,pass,stop)
begin
if (clk'event and clk='1')then
if(sp2='1') then
if(stop='0' and pass='1')then
sp<='0';
elsif(stop='1' and (pass'event and pass='0'))then
sp<='0';
a<=a+1;
sp<='1' after 180 sec;
end if;
if(a>='4') then
a<='0';
sp<='0';
end if;
end if;
sp<=sp2;
end if;
end process;
end ARCHITECTURE art;