5、则停机并发出音响信号。二、设计步骤和调试过程1、模块设计和相应模块代码10洗衣机控制器电路主要有五大部分组成,包括:减法计数器、时序控制电路、预置时间和编码电路、数码管显示、译码器组成。(1)预设时间和编码电路:本模块将输入的四位时间信号编码成八位二进制数输出到减法计数器电路。library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; entity settime is port ( load
6、:in std_logic; time_input:in std_logic_vector(3 downto 0); time_set:out std_logic_vector(7 downto 0) ); end settime; architecture settime of settime is signal p1:std_logic_vector(7 downto 0); begin process(load) begin if(l
7、oad'event and load='1') then case time_input is when "0000"=>p1<="00000000"; when "0001"=>p1<="00000001"; when "0010"=>p1<="00000010"; when "0011"=>p1<="00000011"; when "0100"=>p1<="00000100";when "0101"=>p1<=
8、"00000101";when "0110"=>p1<="00000110";when "0111"=>p1<="00000111"; when "1000"=>p1<="00001000";when "1001"=>p1<="00001001";when others=>p1<="00000000";end case; end if;end process time_set<=p1; end settime; 10图2预设时间和编码仿真用K1、K2、K3、K4给ti