警报器alert.txt
来自「具有多种功能的电子钟:闹钟」· 文本 代码 · 共 26 行
TXT
26 行
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity alert is
port(
clk :in std_logic;
dain :in std_logic_vector(6 downto 0);
speak :out std_logic);
end alert;
architecture fun of alert is
signal count : std_logic_vector(1 downto 0);
signal count1 : std_logic_vector(1 downto 0);
begin
speaker : process(clk)
begin
speak<=count(1);
if(clk'event and clk ='1' )then
if( dain = "0000000")then
if(count1>="10" )then
count1<="00";
else
count1<= count1+1;
end if;
end if;
end if;
end process speaker;
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?