state.vhd

来自「24秒倒计时系统(有跑马灯) 利用CPLD」· VHDL 代码 · 共 35 行

VHD
35
字号
library IEEE;
use IEEE.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
use ieee.std_logic_arith.all;

entity state is
	port(come:in std_logic;
		re:in std_logic;
		go:out std_logic
		);
end state;

architecture arc_state of state is
signal mode: std_logic;
begin
process(mode)
begin
case mode is
when '0' =>go<='1';
when others =>go<='0';
end case;
end process;

process(re,come)
begin
if re='0' then
mode<='0';
else
if come='1' and come'event then
	mode<=not mode;
end if;
end if;
end process;
end arc_state;

⌨️ 快捷键说明

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