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

📄 air_controller.vhd

📁 此为一个空调控制器
💻 VHD
字号:
library ieee;
use ieee.std_logic_1164.all;
entity air_controller is
port(clk:in std_ulogic;
t_high:in std_ulogic;
t_low:in std_ulogic;
heat:out std_ulogic;
cool: out std_ulogic);
end air_controller;
architecture bhv of air_controller is
type state_type is(j_right,t_cold,t_hot);
signal stvar:state_type;
begin
process(clk)
begin
if clk'event and clk='1'then
 if t_low='1'then
stvar<=t_cold;
elsif t_high='1'then
stvar<=t_hot;
else
stvar<=j_right;
end if;
case stvar is
when j_right=>heat<='0';cool<='0';
when t_cold=>heat<='1';cool<='0';
when t_hot=>heat<='0';cool<='1';
end case;
end if;
end process;
end bhv;

⌨️ 快捷键说明

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