




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡介
1、EDA設(shè)計(jì)實(shí)驗(yàn)報(bào)告學(xué)校:鄭州大學(xué)專業(yè):測控技術(shù)與儀器班級(jí):一班姓名:史占東輔導(dǎo)老師:郭敏一、設(shè)計(jì)要求:(1)、能夠顯示年、月、日、時(shí)、分、秒、星期;并具有閏年判斷補(bǔ)償功能;(2)、具有整點(diǎn)報(bào)時(shí)及定時(shí)功能;二、實(shí)用方法:設(shè)計(jì)中用到了6個(gè)按鍵,在模式5下,K1,K2,K3,K4,ZHENG,NAO;其中K1用于切換顯示模式,剛開始時(shí)顯示時(shí)間,按兩次K1顯示定時(shí)時(shí)間,再按兩次K1顯示日期,再按兩次重新顯示時(shí)間;K2用于控制中間信號(hào)W,每按下兩下中間信號(hào)加一,加至8時(shí)清零,W=1時(shí),每按兩下K3鍵分鐘加一;W=2時(shí),每按兩下K3鍵小時(shí)加一;W=3時(shí),每按兩下K3鍵星期加一;W=4時(shí),每按兩下K3鍵日期
2、加一;W=5時(shí),每按兩下K3鍵月份加一;W=6時(shí),每按兩下K3鍵年低兩位加一;W=7時(shí),每按兩下K3鍵年高兩位加一;W=8時(shí),當(dāng)K4=0時(shí),每按兩下K3鍵定時(shí)分鐘加一;當(dāng)K4=1時(shí),每按兩下K3鍵定時(shí)小時(shí)加一;按鍵ZHENG為整點(diǎn)報(bào)時(shí)的使能端;按鍵NAO為定時(shí)鬧鐘的使能端。 三、程序及仿真:(1)24進(jìn)制計(jì)數(shù)器程序及仿真圖如下:library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity cnt24 isport(clk:in std_logic;q1,q2:out std_logic_vecto
3、r(3 downto 0);cout:out std_logic);end cnt24;architecture one of cnt24 issignal q11,q22:std_logic_vector(3 downto 0);beginprocess(clk)beginif clkevent and clk=1 thenq11=q11+1;if q11=9 then q110);q22=q22+1;end if;if q22=2 and q11=3 then q22=0000;q11=0000;cout=1;else cout=0;end if;end if;end process;q1
4、=q11;q2=q22;end;(2)60進(jìn)制計(jì)數(shù)器程序及仿真圖如下:library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity cnt60 isport(clk:in std_logic;q1,q2:out std_logic_vector(3 downto 0);cout:out std_logic);end cnt60;architecture one of cnt60 issignal q11,q22:std_logic_vector(3 downto 0);beginprocess(c
5、lk)beginif clkevent and clk=1 thenq11=q11+1;if q11=9 then q110);q22=q22+1;end if;if q22=5 and q11=9 then q22=0000;q11=0000;cout=1;else cout=0;end if;end if;end process;q1=q11;q2=q22;end;(3)天計(jì)數(shù)器程序及仿真圖如下:library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity day isport(clk,s1,
6、s2:in std_logic;d1,d2:out std_logic_vector(3 downto 0);cout:out std_logic);end day;architecture one of day issignal q11,q22:std_logic_vector(3 downto 0);signal s1s2:std_logic_vector(1 downto 0);beginprocess(clk,s1,s2)beginif clkevent and clk=1 thenq11=q11+1;if q11=9 then q110);q22=q22+1;end if;s1s2i
7、f q22=3 and q11=1 then q22=0000;q11=0001;cout=1;else coutif q22=3 and q11=0 then q22=0000;q11=0001;cout=1;else coutif q22=2 and q11=8 then q22=0000;q11=0001;cout=1;else coutif q22=2 and q11=9 then q22=0000;q11=0001;cout=1;else coutnull;end case;end if;end process;d1=q11;d2=q22;end;(4)月計(jì)數(shù)器程序及仿真圖如下:li
8、brary ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity month isport(clk,run:in std_logic;m1,m2:out std_logic_vector(3 downto 0);a,b,cout:out std_logic);end month;architecture one of month issignal q1,q2:std_logic_vector(3 downto 0);signal q2q1:std_logic_vector(7 downto 0);begi
9、nprocess(clk)beginif clkevent and clk=1 thenq1=q1+1;if q1=9 then q10);q2=q2+1;end if;if q2=1 and q1=2 then q2=0000;q1=0001;cout=1;else cout=0;end if;end if;q2q1a=0;bif run=1 then a=1;b=1;else a=1;ba=0;ba=0;ba=0;ba=0;ba=0;ba=0;ba=0;ba=0;ba=0;ba=0;bnull;end case;end process;m1=q1;m2=q2;end;(5)年低兩位計(jì)數(shù)器程
10、序及仿真圖如下:library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity year isport(clk:in std_logic;y1,y2:out std_logic_vector(3 downto 0);run,cout:out std_logic);end year;architecture one of year issignal q1,q2,q3:std_logic_vector(3 downto 0);beginprocess(clk)beginif clkevent and c
11、lk=1 thenq1=q1+1;if q1=9 then q10);q2=q2+1;end if;if q2=9 and q1=9 then q2=0000;q1=0000;cout=1;else cout=0;end if;end if;end process;process(clk)beginif clkevent and clk=1 thenq3=q3+1;if q3=3 then q30);run=1;else run =0;end if;end if;y1=q1;y2=q2;end process;end;(6)年高兩位計(jì)數(shù)器程序及仿真圖如下:library ieee;use ie
12、ee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity year1 isport(clk:in std_logic;y3,y4:out std_logic_vector(3 downto 0);run,cout:out std_logic);end year1;architecture one of year1 issignal q1,q2:std_logic_vector(3 downto 0);beginprocess(clk)beginif clkevent and clk=1 thenq1=q1+1;if q1=9 th
13、en q10);q2=q2+1;end if;if q2=9 and q1=9 then q2=0000;q1=0000;cout=1;else cout=0;end if;end if;end process;process(q1)beginif q1(1 downto 0)/=00 thenrun=1;else run =0;end if;y3=q1;y4=q2;end process;end;(7)星期計(jì)數(shù)器程序及仿真圖如下:library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity cn
14、t7 isport(clk:in std_logic;q1,q2:out std_logic_vector(3 downto 0);end cnt7;architecture one of cnt7 issignal q11,q22:std_logic_vector(3 downto 0);beginprocess(clk)beginif clkevent and clk=1 thenq11=q11+1;if q11=7 then q11=0001;end if;end if;q22=0000;end process;q1=q11;q2=q22;end;(8)調(diào)節(jié)時(shí)間及實(shí)現(xiàn)定時(shí)程序如下:lib
15、rary ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity tiaoshi isport(sout,fout,hout,dout,mout,yout0:in std_logic;k2,k3:in std_logic;fin,hin,din,min,yin0,yin1,dingshi,win:out std_logic;q:out std_logic_vector(3 downto 0);end tiaoshi;architecture one of tiaoshi issignal w:std_log
16、ic_vector(3 downto 0);beginprocess(k2,k3)beginif k2event and k2=1 then w=w+1;if w=8 then wfin=sout;hin=fout;din=hout;min=dout;yin0=mout;yin1=yout0;dingshi=0;win=hout; qfin=k3;hin=0;din=0;min=0;yin0=0;yin1=0;dingshi=0;win=0; qfin=0;hin=k3;din=0;min=0;yin0=0;yin1=0;dingshi=0;win=0; qfin=0;hin=0;din=0;
17、min=0;yin0=0;yin1=0;dingshi=0;win=k3; qfin=0;hin=0;din=k3;min=0;yin0=0;yin1=0;dingshi=0;win=0; qfin=0;hin=0;din=0;min=k3;yin0=0;yin1=0;dingshi=0;win=0; qfin=0;hin=0;din=0;min=0;yin0=k3;yin1=0;dingshi=0;win=0; qfin=0;hin=0;din=0;min=0;yin0=0;yin1=k3;dingshi=0;win=0; qfin=0;hin=0;din=0;min=0;yin0=0;yi
18、n1=0;dingshi=k3; qnull;end case;end process;end;(9)切換顯示狀態(tài)程序如下:library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity control isport(fld,fhd,hld,hhd,sl,sh,fl,fh,hl,hh,dl,dh,ml,mh,yl,yh,yl1,yh1,wl,wh:in std_logic_vector(3 downto 0);k1:in std_logic;q1,q2,q3,q4,q5,q6,q7,q8:out s
19、td_logic_vector(3 downto 0);l1:out std_logic_vector(3 downto 0);end control;architecture one of control issignal w:std_logic_vector(1 downto 0);beginprocess(k1)begin if k1event and k1=1 then w=w+1;if w=2 then wq8=yh1;q7=yl1;q6=yh;q5=yl;q4=mh;q3=ml;q2=dh;q1=dl;l1q8=wh;q7=wl;q6=hh;q5=hl;q4=fh;q3=fl;q2=sh;q1=sl;l1q8=0000;q7=0000;q6=0000;q5=0000;q4=hhd;q3=hld;q2=fhd;q1=fld;l1null;end case;end process;end;(10)鬧鐘控制程序如下:library ieee;use ieee.std_l
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 廣告效果評(píng)估監(jiān)測協(xié)議3篇
- 小賣部承包合同范例3篇
- 入伙協(xié)議書格式合同3篇
- 年薪制勞動(dòng)合同范本3篇
- 保溫板施工監(jiān)控3篇
- 綠色I(xiàn)T與計(jì)算機(jī)硬件的環(huán)保設(shè)計(jì)考核試卷
- 紙質(zhì)寵物用品市場趨勢與消費(fèi)行為研究分析考核試卷
- 服務(wù)標(biāo)準(zhǔn)化與醫(yī)藥研發(fā)服務(wù)考核試卷
- 真空泵在石油化工中的應(yīng)用考核試卷
- 2025年:勞動(dòng)合同終止的多樣情形解析
- 2024華能四川能源開發(fā)有限公司下屬單位招聘筆試參考題庫附帶答案詳解
- 2025怎樣正確理解全過程人民民主的歷史邏輯、實(shí)踐邏輯與理論邏輯?(答案3份)
- 鋼結(jié)構(gòu)高處作業(yè)安全管理
- JJF 2221-2025導(dǎo)熱系數(shù)瞬態(tài)測定儀校準(zhǔn)規(guī)范
- 華為手機(jī)協(xié)議合同
- 甘肅省隴南市禮縣第六中學(xué)2024-2025學(xué)年八年級(jí)下學(xué)期第一次月考數(shù)學(xué)試卷(無答案)
- 公司兩班倒管理制度
- 完整版高中古詩文必背72篇【原文+注音+翻譯】
- 2025年武漢數(shù)學(xué)四調(diào)試題及答案
- 人教版小學(xué)四年級(jí)語文下冊(cè)2024-2025學(xué)年度第二學(xué)期期中質(zhì)量檢測試卷
- 七年級(jí)下冊(cè)道德與法治(2025年春)教材變化詳細(xì)解讀
評(píng)論
0/150
提交評(píng)論