library ieee:use ieee.std_logic_1164.all;entity air_conditioner is port(clk:in std_ulogic; temp_high:in std_ulogic; temp_low:in std_ulogic; heat:out std_ulogic; cool:out std_ulogic); end air_conditioner;achitecture style_b of air_conditioner istype state_type is (just_right,too_cold,too_hot);attribute sequential_encoding of state_type:type is \"00 01 10\";signal stvar:state_type;attribute state_vector:string;arrribute state_vector of style_b:architecture is \"stvar\";begincontrollerl:processbeginwait until clk=\'1\';if(temp_low=\'1\')then stvar<=too_cold;elsif(temp_high=\'1\')then stvar<=too_hot;else stvar<=just_right;end if;case stvar is when just_right=>heat<=\'0\'; cool<=\'0\';when too_cold=>heat<=\'1\'; cool<=\'0\';when too_hot=>heat<=\'0\'; cool<=\'1\';end case;end process controllerl;end style_b;
You Might Like
Recommended ContentMore
Open source project More
Popular Components
Searched by Users
Just Take a LookMore
Trending Downloads
Trending ArticlesMore