⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 kcount.vhd

📁 Fire&password数字系统实验
💻 VHD
字号:

library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;

entity kcount is
        port (A,B  : in std_logic;
              C,D,E : out std_logic);
end kcount;

architecture kcount_arc of kcount is
begin
    process(A,B)
    variable counter : integer range 0 to 3;
    constant md : integer :=3;
    begin
         if(B='1')then
              counter := 0;
              E<='0';
         elsif(A'event and A ='1')then
              counter :=counter+1;
              if(counter = md)then
                  counter:=0;
                  E<='1';
              end if;
         end if;
         
         if(counter=0)then
             C<='0'; D<='0';
         elsif(counter=1)then
             C<='1'; D<='0';
         else
             C<='0'; D<='1';
         end if;
    end process;
end kcount_arc;


















      

⌨️ 快捷键说明

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