4、定时启动定时没到图1设计框图用两位数码管预置洗涤时间(分钟数),洗涤过程在送入预置时间后开始运转,洗涤中按倒计时方式对洗涤过程作计时显示,用LED表示电动机的正、反转,如果定时时间到,则停机并发出音响信号。二、设计步骤和调试过程..1、模块设计和相应模块代码洗衣机控制器电路主要有五大部分组成,包括:减法计数器、时序控制电路、预置时间和编码电路、数码管显示、译码器组成。(1)预设时间和编码电路:本模块将输入的四位时间信号编码成八位二进制数输出到减法计数器电路。library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigne
5、d.all; entity settime is port ( load: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(load'
6、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<="00000101";when "0110"=>p1<="00000110";when "0111"
7、=>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; 图2预设时间和编码仿真..用K1、K2、K3、K4给time_input输入一个二进