欢迎来到天天文库
浏览记录
ID:35628690
大小:569.35 KB
页数:13页
时间:2019-04-03
《EDA洗衣机控制器课程设计》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库。
1、一、程序如下:LIBRARYIEEE;USEIEEE.STD_LOGIC_1164.ALL;USEIEEE.STD_LOGIC_UNSIGNED.ALL;ENTITYstudentISPORT(COUNT_N,COUNT_M,START,COOK,CLK:INSTD_LOGIC;LOOK:OUTSTD_LOGIC;DOUT:OUTSTD_LOGIC_VECTOR(1DOWNTO0));ENDSTUDENT;ARCHITECTUREBEHAVOFstudentISSIGNALDT1,DT2:STD_LOGIC_VECTOR(1DOWNTO0);SIGNALDICSOUNT,TEM:STD_LOG
2、IC_VECTOR(3DOWNTO0);SIGNALDCP:STD_LOGIC_VECTOR(3DOWNTO0);SIGNALCT:STD_LOGIC_VECTOR(5DOWNTO0);SIGNALCT1,CT2:STD_LOGIC_VECTOR(3DOWNTO0);SIGNALSG,CMKS:STD_LOGIC;BEGINPROCESS(COUNT_N,SG)BEGINIFSG='1'THENDT1<="00";ELSIFCOUNT_N'EVENTANDCOUNT_N='1'THENIFDT1=3THENDT1<="01";ELSEDT1<=DT1+1;ENDIF;ENDIF;ENDPROC
3、ESS;PROCESS(COUNT_M,SG)BEGINIFSG='1'THENDT2<="00";ELSIFCOUNT_M'EVENTANDCOUNT_M='1'THENIFDT2=3THENDT2<="01";ELSEDT2<=DT2+1;ENDIF;ENDIF;ENDPROCESS;PROCESS(START)12BEGINIFSG='1'THENCMKS<='0';ELSIFSTART'EVENTANDSTART='1'THENDICSOUNT<=DT1&DT2;CMKS<=CMKSXOR'1';ENDIF;ENDPROCESS;PROCESS(CLK,START,COOK)BEGIN
4、IFSTART='1'ANDDCP="0000"THENDCP<=DICSOUNT;ELSIFCLK'EVENTANDCLK='1'THENIFCOOK='1'THENDOUT<="00";ELSIFSTART='1'ANDDCP>"0000"THENDOUT<="00";ELSIFSG='1'THENIFCT1<"0001"THENCT1<="0000";SG<='0';ENDIF;ELSIFCMKS='1'THENCASEDCPISWHEN"0101"=>IFCT<35THENCT<=CT+1;IFCT1<8THENDOUT<="01";CT1<=CT1+1;ELSIFCT1=8THEND
5、OUT<="00";CT1<=CT1+1;ELSIFCT2<8THENDOUT<="10";CT2<=CT2+1;ELSIFCT2=8THENDOUT<="00";CT1<="0000";CT2<="0000";ENDIF;ELSEDCP<="0110";CT<="000000";CT1<="0000";CT2<="0000";DOUT<="00";ENDIF;WHEN"0110"=>IFCT<27THENCT<=CT+1;IFCT1<6THENDOUT<="01";CT1<=CT1+1;ELSIFCT1=6THENDOUT<="00";CT1<=CT1+1;ELSIFCT2<6THEN12D
6、OUT<="10";CT2<=CT2+1;ELSIFCT2=6THENDOUT<="00";CT1<="0000";CT2<="0000";ENDIF;ELSEDCP<="0111";CT<="000000";CT1<="0000";CT2<="0000";DOUT<="00";ENDIF;WHEN"0111"=>IFCT<8THENCT<=CT+1;IFCT1<3THENDOUT<="01";CT1<=CT1+1;ELSIFCT1=3THENDOUT<="00";CT1<=CT1+1;ELSIFCT2<3THENDOUT<="10";CT2<=CT2+1;ELSIFCT2=3THENDOUT
7、<="00";CT1<="0000";CT2<="0000";ENDIF;ELSEDCP<="0000";CT<="000000";CT1<="0000";CT2<="0000";SG<='1';ENDIF;WHEN"1001"=>IFCT<27THENCT<=CT+1;IFCT1<6THENDOUT<="01";CT1<=CT1+1;ELSIFCT1=6THENDOUT<="00";CT1<=C
此文档下载收益归作者所有