资源描述:
《双进程单进程,三进程》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、星期三作业1.双进程LIBRARYIEEE;USEIEEE.STD_LOGIC_1164.ALL;ENTITYs_machineISPORT(clk:INSTD_LOGIC;reset:INSTD_LOGIC;ina:INSTD_LOGIC_VECTOR(0TO2);outa:OUTSTD_LOGIC_VECTOR(0TO3));ENDs_machine;ARCHITECTUREbehvOFs_machineISTYPEFSM_STIS(s0,s1,s2,s3);SIGNALcurrent_state,next_s
2、tate:FSM_ST;BEGINREG:PROCESS(reset,clk)BEGINIFreset='1'THENcurrent_state<=s0;ELSIFclk='1'ANDclk'EVENTTHENcurrent_state<=next_state;ENDIF;ENDPROCESS;COM:PROCESS(current_state,ina)-BEGINCASEcurrent_stateISWHENs0=>next_state<=s1;IFina="101"THENouta<="0010";ENDIF;
3、IFina="111"THENouta<="1100";ENDIF;WHENs1=>outa<="1001";IFina="000"THENnext_state<=s1;ENDIF;IFina="110"THENnext_state<=s2;ENDIF;WHENs2=>outa<="1111";IFina="110"THENnext_state<=s2;ENDIF;IFina="011"THENnext_state<=s1;ofwork,relationships,needandpossibility,putqua
4、lityfirst."Improvestructure",referspartycarefully".IsamustadheretotheindividualabsorptionTheprincipleofthedevelopmentofamatureone,andstrictlyperformintheadmissionprocedure,topreventthePartymemberENDIF;IFina/="001"THENnext_state<=s3;ENDIF;WHENs3=>next_state<=s0
5、;IFina="101"THENouta<="1101";ENDIF;IFina="011"THENouta<="1110";ENDIF;ENDcase;ENDPROCESS;ENDbehv;2.单进程LIBRARYIEEE;USEIEEE.STD_LOGIC_1164.ALL;ENTITYs_machineISPORT(clk,:INSTD_LOGIC;Reset:INSTD_LOGIC;ina:INSTD_LOGIC_VECTOR(0TO2);outa:OUTSTD_LOGIC_VECTOR(0TO3));EN
6、Ds_machine;ARCHITECTUREbehvOFs_machineISTYPEFSM_STIS(s0,s1,s2,s3);SIGNALcurrent_state:FSM_ST;BEGINREG:PROCESS(reset,clk)BEGINIFreset='1'THENcurrent_state<=s0;ELSIFclk='1'ANDclk'EVENTTHENCASEcurrent_stateISWHENs0=>current_state<=s1;IFina="101"THENouta<="0010";E
7、NDIF;IFina="111"THENouta<="1100";ENDIF;WHENs1=>outa<="1001";IFina="000"THENcurrent_state<=s1;ENDIF;IFina="110"THENcurrent_state<=s2;ENDIF;WHENs2=>outa<="1111";ofwork,relationships,needandpossibility,putqualityfirst."Improvestructure",referspartycarefully".Isam
8、ustadheretotheindividualabsorptionTheprincipleofthedevelopmentofamatureone,andstrictlyperformintheadmissionprocedure,topreventthePartymemberIFina="110"THENcurrent_state<=s2;ENDIF;I