📄 cnt10.vhd
字号:
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity cnt10 is
port(clk:in std_logic;
clr:in std_logic;
en:in std_logic;
count: out integer range 0 to 9;
cin:out std_logic);
end entity;
architecture art of cnt10 is
signal tem:integer range 0 to 10;
begin
count<=tem;
process(clk,clr,en)
begin
if (clr='1') then tem<=0;
elsif(rising_edge(clk)) then
if(en='1') then
if(tem=9) then
tem<=0;
cin<='1';
else
tem<=tem+1;
cin<='0';
end if;
end if;
end if;
end process;
end art;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -