fangdou.vhd

来自「VHDL语言开发的全自动洗衣机的源程序 可以通过一个按键的复用实现5种功能的选」· VHDL 代码 · 共 37 行

VHD
37
字号
library ieee;
use ieee.std_logic_1164.all;
entity fangdou is 
port (clk,key:in std_logic;
      keyout:out std_logic);
end;
architecture a  of fangdou is
signal cp:std_logic;
signal jsq:integer range 0 to 4;
begin
d: process(clk)
begin 
if (clk'event and clk='1') then 
if key='1' then
if jsq=4  then
 jsq<=jsq;
else
 jsq<=jsq+1;
end if;
else
jsq<=0;
end if;
end if;
end process;

process(jsq)
begin
if jsq=3 then 
cp<='1';
else   
cp<='0';
end if;
keyout<=cp;
end process;
end; 

⌨️ 快捷键说明

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