📄 counter4.vhd
字号:
--counter4
library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.std_logic_arith.all;
use IEEE.std_logic_unsigned.all;
entity counter4 is
port(clk,clr:in std_logic;
bcd:out std_logic_vector(1 downto 0));
end counter4;
architecture rtl of counter4 is
signal bcdn:std_logic_vector(1 downto 0):="00";--the initial value
begin
bcd<=bcdn;
process(clk)
begin
if(clr='0') then
bcdn<="00";
else
if(clk'event and clk='0') then
if(bcdn="11") then
bcdn<="00";
else
bcdn<=bcdn+1;
end if;
end if;
end if;
end process;
end rtl;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -