freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

基于vhdl的數(shù)字鬧鐘設(shè)計(jì)-資料下載頁(yè)

2025-06-26 12:29本頁(yè)面
  

【正文】 鍵按下的信號(hào)。該模塊有一個(gè)時(shí)鐘輸入端口,輸入時(shí)鐘信號(hào)是分頻出來(lái)的 1KHZ 的時(shí)鐘;有一個(gè)輸入端口與行線相連,用于輸入行線狀態(tài);一個(gè)輸出端口,用于輸出有按鍵按下的信號(hào)。該模塊的邏輯框圖如圖 46 所示。圖 46 去抖邏輯框圖該電路的 VHDL 程序如下:library ieee。use 。use 。use 。entity qudou is port(clk1:in std_logic。 row:in std_logic_vector(3 downto 0)。 key_pre:out std_logic)。end qudou。architecture behav of qudou is signal sig1,counter:std_logic_vector(3 downto 0)。 signal tmp1,sig2:std_logic。begin sig1=row。 tmp1=sig1(0)and sig1(1)and sig1(2)and sig1(3)。 key_pre=counter(0)and counter(1)and counter(2)and counter(3)。process(clk1)begin if(clk139。event and clk1=39。139。)then if(tmp1=39。039。)then if(sig2=39。039。)then附錄25 sig2=39。139。 end if。 end if。if(sig2=39。139。)then if(counter=1111)then sig2=39。039。 counter=0000。 else counter=counter+39。139。 end if。 end if。end if。end process。end behav。(5) 鍵掃描模塊鍵掃描模塊的框圖如圖 47 所示。圖 47 按鍵掃描模塊CLKY 為輸入時(shí)鐘,該時(shí)鐘是分頻模塊分出的 4MHZ 的時(shí)鐘信號(hào),之所以在這里采用頻率高的時(shí)鐘信號(hào)就是因?yàn)殒I掃描是一個(gè)快過(guò)程,不需要太慢的時(shí)鐘。Key_pre 是由去抖模塊輸出的有鍵按下的信號(hào),這個(gè)信號(hào)引發(fā)按鍵掃描模塊內(nèi)部信號(hào)的變化,在該狀態(tài)信號(hào)的作用下,模塊可以鍵盤掃描。ROW[3..0]是行輸入信號(hào),與鍵盤的行線相連,COM[3..0]是列輸出信號(hào),與鍵盤的列線相連。SCAN_CODE[7..0]是掃描的鍵碼輸出端口。鍵掃描的基本方法是將列線逐一置成低電平,然后讀行線輸入端口,如果行線中有低電平出現(xiàn),說(shuō)明按鍵已經(jīng)確定,將行向量和列向量讀入鍵碼中即可。鍵盤掃描程序如下:library ieee。use 。use 。use 。entity ajsm isport(clky,key_pre:in std_logic。 row:in std_logic_vector(3 downto 0)。 :out std_logic_vector(3 downto 0)。 scan_code:out std_logic_vector(7 downto 0))。end ajsm。architecture behav of ajsm issignal sig_:std_logic_vector(3 downto 0)。附 錄26signal counter:std_logic_vector(1 downto 0)。signal tmp,sig1,sig2:std_logic。begin sig2=key_pre。 tmp=row(0) and row(1) and row(2) and row(3)。process(clky)beginif(clky39。event and clky=39。139。)then 計(jì)數(shù)進(jìn)程 if(sig2=39。139。)then if(counter=11)then sig1=39。039。 counter=00。 else sig1=39。139。 counter=counter+39。139。 end if。 else sig1=’0’。 counter=”00”。 end if。end if。end process。process(clky) 列線逐位輸出低電平variable jt :std_logic。beginif(clky39。event and clky=39。139。)then if(sig1=39。139。)then jt:=sig_(3)。 for i in 3 downto 1 loop sig_(i)=sig_(i1)。 end loop。 sig_(0)=jt。 else sig_=1110。 end if。end if。end process。process(clky)beginif(clky39。event and clky=39。139。)then if(sig1=39。139。)then =sig_。 else =0000。 end if。end if。end process。process(clky) 鍵碼信號(hào)賦值beginif(clky39。event and clky=39。139。)then 附錄27 if(sig1=39。139。)then if(tmp=39。039。)then scan_code=row amp。 sig_。 else scan_code=11111111。 end if。 else scan_code=11111111。 end if。end if。end process。end behav。(6)頂層電路設(shè)計(jì)LIBRARY IEEE。 USE 。ENTITY clock IS PORT ( CLK12MHZ : IN STD_LOGIC。 CLK8HZ : IN STD_LOGIC。 SPKOUT : OUT STD_LOGIC。 CLK : IN STD_LOGIC。 KEY1 : IN STD_LOGIC。 KEY2 : IN STD_LOGIC_VECTOR(1 DOWNTO 0)。 H1,H2,M1,M2,S1,S2: OUT STD_LOGIC_VECTOR(3 DOWNTO 0))。 END。ARCHITECTURE one OF clock IS COMPONENT shizhong PORT (clk : in std_logic。 md1 : in std_logic。 md2 : in std_logic_vector(1 downto 0)。 clken : out std_logic。 h1,h2,m1,m2,s1,s2: out std_logic_vector(3 downto 0))。 END COMPONENT。 COMPONENT NoteTabs PORT ( clk : IN STD_LOGIC。 ToneIndex : OUT STD_LOGIC_VECTOR (3 DOWNTO 0) )。 END COMPONENT。 COMPONENT ToneTaba PORT ( Index : IN STD_LOGIC_VECTOR (3 DOWNTO 0) 。 Tone : OUT STD_LOGIC_VECTOR (10 DOWNTO 0)。 en : in std_logic)。 END COMPONENT。 COMPONENT Speakera PORT ( clk : IN STD_LOGIC。 Tone : IN STD_LOGIC_VECTOR (10 DOWNTO 0)。 SpkS : OUT STD_LOGIC )。 END COMPONENT。 SIGNAL Tone :STD_LOGIC_VECTOR (10 DOWNTO 0)。 SIGNAL ToneIndex :STD_LOGIC_VECTOR (3 DOWNTO 0)。 SIGNAL clken :STD_LOGIC。附 錄28 SIGNAL en :STD_LOGIC。 BEGINu1 : Shizhong PORT MAP (clk=CLK,md1=KEY1,md2=KEY2,clken=en, h1=h1,h2=h2,m1=m1,m2=m2,s1=s1,s2=s2)。u2 : NoteTabs PORT MAP (clk=CLK8HZ, ToneIndex=ToneIndex)。u3 : ToneTaba PORT MAP (Index=ToneIndex,Tone=Tone,en=en)。u4 : Speakera PORT MAP (clk=CLK12MHZ,Tone=Tone, SpkS=SPKOUT )。END。附錄 2 動(dòng)態(tài)掃描模塊程序library ieee。use 。use 。use 。entity seltime is port(disclk,conv:in std_logic。 m0,m1,f0,f1,s0,s1,r0,r1,y0,y1,n0,n1,n2,n3:in std_logic_vector(3 downto 0)。 dataout:out std_logic_vector(3 downto 0)。 wsel:out std_logic_vector(3 downto 0))。end seltime。architecture st of seltime issignal count:std_logic_vector(3 downto 0)。beginwsel=count。process(disclk,conv) beginif disclk39。event and disclk=39。139。 then if count=1010 then count=0000。 else count=count+1。 end if。 end if。if conv=39。139。 then case count is when1010=dataout=s1。 when1001=dataout=s0。 when0110=dataout=f1。 when0101=dataout=f0。 when0100=dataout=m1。 when0011=dataout=m0。 when others =dataout=0000。 end case。else case count is when1010=dataout=n3。 when1001=dataout=n2。附錄29 when1000=dataout=n1。 when0111=dataout=n0。 when0110=dataout=y1。 when0101=dataout=y0。 when0100=dataout=r1。 when0011=dataout=r0。 when others =dataout=0000。 end case。 end if。end process。end st
點(diǎn)擊復(fù)制文檔內(nèi)容
環(huán)評(píng)公示相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1