资源描述:
《带有高阻态选通和复位控制的四选一多路选择器.doc》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、带有高阻态选通和复位控制的四选一多路选择器LIBRARYIEEE;USEIEEE.STD_LOGIC_1164.ALL;ENTITYMUX41AISPORT(A,B,C,D,RST,EN:INSTD_LOGIC;S1,S0:INSTD_LOGIC;Y:OUTSTD_LOGIC);ENDENTITYMUX41A;ARCHITECTUREONEOFMUX41AISSIGNALS1S0:STD_LOGIC_VECTOR(1DOWNTO0);BEGINS1S0<=S1&S0;PROCESS(RST,EN,S1S0)BEGINIFRS
2、T='1'THENY<='0';ELSIFEN='1'THENCASES1S0ISWHEN"00"=>Y<=A;WHEN"01"=>Y<=B;WHEN"10"=>Y<=C;WHEN"11"=>Y<=D;WHENOTHERS=>Y<=NULL;ENDCASE;ELSEY<='Z';ENDIF;ENDPROCESS;ENDARCHITECTUREONE;带有复位和时钟使能的4位加法二进制的计数器libraryieee;USEIEEE.STD_LOGIC_1164.ALL;USEIEEE.STD_LOGIC_UNSIGNED.AL
3、L;ENTITYCNT4jISPORT(RST,CLK,EN:INSTD_LOGIC;Q:OUTSTD_LOGIC_VECTOR(3DOWNTO0);COUT:OUTSTD_LOGIC);END;ARCHITECTUREONEOFCNT4jISBEGINPROCESS(RST,CLK,EN)VARIABLEQQ:STD_LOGIC_VECTOR(3DOWNTO0);BEGINIFRST='1'THENQQ:=(OTHERS=>'0');ELSIFCLK'EVENTANDCLK='1'THENIFEN='1'THENQQ:=Q
4、Q+1;IFQQ="1111"THENCOUT<='1';ELSECOUT<='0';ENDIF;ENDIF;ENDIF;Q<=QQ;ENDPROCESS;END;带有复位和时钟使能的4位减法二进制的计数器LIBRARYIEEE;USEIEEE.STD_LOGIC_1164.ALL;USEIEEE.STD_LOGIC_UNSIGNED.ALL;ENTITYCNT4jianISPORT(RST,CLK,EN:INSTD_LOGIC;Q:OUTSTD_LOGIC_VECTOR(3DOWNTO0);COUT:OUTSTD_LOGI
5、C);END;ARCHITECTUREONEOFCNT4jianISBEGINPROCESS(RST,CLK,EN)VARIABLEQQ:STD_LOGIC_VECTOR(3DOWNTO0);BEGINIFRST='1'THENQQ:=(OTHERS=>'0');ELSIFCLK'EVENTANDCLK='1'THENIFEN='1'THENQQ:=QQ-1;IFQQ="0000"THENCOUT<='1';ELSECOUT<='0';ENDIF;ENDIF;ENDIF;Q<=QQ;ENDPROCESS;END;带有复位和时
6、钟使能的4位加减可控二进制的计数器LIBRARYIEEE;USEIEEE.STD_LOGIC_1164.ALL;USEIEEE.STD_LOGIC_UNSIGNED.ALL;ENTITYCNT4ISPORT(RST,CLK,EN,UPDOWN:INSTD_LOGIC;Q:OUTSTD_LOGIC_VECTOR(3DOWNTO0);COUT:OUTSTD_LOGIC);END;ARCHITECTUREONEOFCNT4ISBEGINPROCESS(RST,CLK,EN,UPDOWN)VARIABLEQQ:STD_LOGIC_V
7、ECTOR(3DOWNTO0);BEGINIFRST='1'THENQQ:=(OTHERS=>'0');ELSIFCLK'EVENTANDCLK='1'THENIFEN='1'THENIFUPDOWN='1'THENQQ:=QQ+1;IFQQ="1111"THENCOUT<='1';ELSECOUT<='0';ENDIF;ELSEQQ:=QQ-1;IFQQ="0000"THENCOUT<='1';ELSECOUT<='0';ENDIF;ENDIF;ENDIF;ENDIF;Q<=QQ;ENDPROCESS;END;带有并行置位
8、的左移的八位寄存器LIBRARYIEEE;USEIEEE.STD_LOGIC_1164.ALL;ENTITYSHIFT_LISPORT(CLK,LOAD:INSTD_LOGIC;DIN:INSTD_LOGIC_VECTOR(7DOWNTO0);QB:OUTSTD_LOGIC);END;AR