count60.vhd
来自「这是一个自动售货机的vhdl源码」· VHDL 代码 · 共 31 行
VHD
31 行
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
use ieee.std_logic_arith.all;
entity count60 is
port( cp:in std_logic;
en3:in std_logic;
times:out integer range 0 to 59;
full:out std_logic
);
end count60;
architecture c60 of count60 is
signal time:integer range 0 to 59;
begin
process(cp,en3)
begin
if(en3='0')then time<=0;full<='0';
elsif rising_edge(cp) then
if
time=59 then time<=0;
full<='1';
else
time<=time+1;
full<='0';
end if;
end if;
end process;
times<=time;
end;
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?