?? count10.vhd
字號:
--------------------10進制計數器
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
use ieee.std_logic_arith.all;
entity count10 is
port(clk1 : in std_logic;
clr1 : in std_logic;
carry1 : out std_logic;
value1 : out std_logic_vector(3 downto 0));
end entity;
-------------------------------------
architecture behave of count10 is
begin
process(clk1,clr1)
variable temp : std_logic_vector(3 downto 0);
begin
if clr1='1' then temp :=(others => '0');
elsif clk1'event and clk1='1' then
if temp < 9 then temp := temp + 1;
carry1 <= '0';
else temp :=(others => '0');
carry1 <= '1';
end if;
end if;
value1 <= temp;
end process;
end architecture behave;
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -