📄 cnt10.vhd
字号:
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity cnt10 is
port(clk,ena,clr:in std_logic;
cq:out std_logic_vector(3 downto 0);
carry_out:out std_logic);
end cnt10;
architecture be_cnt10 of cnt10 is
signal cq1:std_logic_vector(3 downto 0);
begin
process(clk,clr,ena)
begin
if clr='1' then
cq1<="0000";
elsif clk'event and clk='1' then
if ena='1' then
if cq1="1001" then
cq1<="0000";
carry_out<='1';
else cq1<=cq1+1;
carry_out<='0';
end if;
end if;
end if;
end process;
cq<=cq1;
end be_cnt10;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -