📄 count6.vhd
字号:
--------6进制计数器
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
use ieee.std_logic_arith.all;
entity count6 is
port(clk2 : in std_logic;
clr2 : in std_logic;
carry2 : out std_logic;
value2 : out std_logic_vector(3 downto 0));
end entity count6;
-------------------------------------
architecture behave of count6 is
begin
process(clk2,clr2)
variable temp : std_logic_vector(3 downto 0);
begin
if clr2='1' then temp :=(others => '0');
elsif clk2'event and clk2='1' then
if temp < 5 then temp := temp + 1;
carry2 <= '0';
else temp :=(others => '0');
carry2 <= '1';
end if;
end if;
value2 <= temp;
end process;
end architecture behave;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -