資源描述:
《eda南華大學(xué)版》由會員上傳分享,免費在線閱讀,更多相關(guān)內(nèi)容在教育資源-天天文庫。
1、Eda設(shè)計報告南華大學(xué)版:--*******************************************************--------******Thiscomponentofthekeystable***************--------*****Function:scanthekeysandfilterthenosiy***-------------------------------------------------------------------------------20104470338electronicimformationengi
2、neer----------LIBRARYIEEE;USEIEEE.STD_LOGIC_1164.ALL;USEIEEE.STD_LOGIC_UNSIGNED.ALL;ENTITYkeystableIS--theentityofkeystablePORT(clk1,keyin:INSTD_LOGIC;--clk11024Hzkeyout:OUTSTD_LOGIC);--theportofkeyoutENDENTITYkeystable;ARCHITECTUREbehvofkeystableisSIGNALKH,KL:STD_LOGIC_VECTOR(3downto0);BEGINP
3、ROCESS(clk1,keyin)BEGINifclk1'eventandclk1='1'thenifkeyin='0'thenKL<=KL+1;elseKL<="0000";--lowENDIF;ENDIF;ENDPROCESS;PROCESS(clk1,keyin)BEGINifclk1'eventandclk1='1'thenifkeyin='1'thenKH<=KH+1;elseKH<="0000";--highENDIF;ENDIF;ENDPROCESS;PROCESS(clk1,KH,KL)BEGINifclk1'eventandclk1='1'thenif(KH>"
4、0011")thenkeyout<='1';--putouthighelsif(KL>"0010")THENkeyout<='0';--putoutlowENDIF;ENDIF;ENDPROCESS;ENDARCHITECTURE;--*******************************************************--------******Thiscomponentofthecounter***************--------*****Function:contertheclk***************------------------
5、-------------------------------------------------------------20104470338electronicimformationengineer----------LIBRARYIEEE;USEIEEE.STD_LOGIC_1164.ALL;USEIEEE.STD_LOGIC_UNSIGNED.ALL;USEIEEE.STD_LOGIC_ARITH.ALL;ENTITYcounterISGENERIC(n:INTEGER);PORT(clk,reset,direction,just,en:INSTD_LOGIC;COUT:O
6、UTSTD_LOGIC;daout:OUTSTD_LOGIC_VECTOR(3DOWNTO0));ENDENTITYcounter;ARCHITECTUREfunOFcounterISSIGNALC:STD_LOGIC;SIGNALQ,Q1,Q2,Q3:STD_LOGIC_VECTOR(3DOWNTO0);BEGINCOUT<=C;daout<=Q;PROCESS(clk,reset,en,Q,Q1,Q2)VARIABLEQTemp:STD_LOGIC_VECTOR(3DOWNTO0);BEGINIF(reset='0')THENQ1<="0000";C<='0';ELSIFEN=
7、'1'THENIF(clk'eventandclk='1')THENIF(Q1