cnt10.vhd

来自「一个简单的交通灯程序(包括验证,主程序,和译码程序),在ALTER DE2板上实」· VHDL 代码 · 共 21 行

VHD
21
字号
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity cnt10 is
port(clk: in std_logic;
    cout: out std_logic);
end cnt10;
architecture behav of cnt10 is
begin 
process(clk)
variable q: std_logic_vector(3 downto 0);
     begin
       if clk'event and clk='1' then
            q:=q+1;
end if;
if q="1010" then cout<='1';
   q:="0000";
else cout<='0';
end if;
end process;
end behav;

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?