EDA數(shù)字秒表的設(shè)計(jì)程序_第1頁(yè)
EDA數(shù)字秒表的設(shè)計(jì)程序_第2頁(yè)
EDA數(shù)字秒表的設(shè)計(jì)程序_第3頁(yè)
全文預(yù)覽已結(jié)束

下載本文檔

版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

1、EDA數(shù)字秒表的設(shè)計(jì)程序     程序說(shuō)明:1。此程序包括分頻,計(jì)數(shù)控制,顯示控制部分。2。開機(jī)顯示00。00。00,用戶課隨時(shí)計(jì)時(shí),暫停,清零,最大計(jì)時(shí)可到59 分59。99秒。3。技術(shù)時(shí)鐘為100HZ4。采用時(shí)分復(fù)用的方法控制4個(gè)數(shù)碼管的顯示,可節(jié)省資源。程序如下:Library ieee;Use ieee.std_logic_1164.all;Use ieee.std_logic_arith.all; Use ieee.std_logic_unsigned.all;Entity watch isPort(sel: out std_logi

2、c_vector(6 downto 1) ;seg:out std_logic_vector(7 downto 0);Beginstop:in std_logic;Reset:in std_logic;Cp2:in std_logic);End watch;Architecture behave of watch isSignal num1: std_logic_vector(3 downto 0);Signal num2: std_logic_vector(3 downto 0);Signal num3: std_logic_vector(3 downto 0);Signal num4: s

3、td_logic_vector(3 downto 0);Signal num5: std_logic_vector(3 downto 0);Signal num6: std_logic_vector(3 downto 0);Signal num: std_logic_vector(3 downto 0);Signal numlet: std_logic_vector(2 downto 0);Signal count: std_logic_vector(17 downto 1);Signal selsig: std_logic_vector(6 downto 1);Signal segsig:

4、std_logic_vector(7 downto 0 );Signal cp1: std_logic;Signal cp3: std_logic;BeginProcess(cp2) - 分頻。Begin If (cp2' event and cp2='1') then if (Count="1100011010011111")thencount<="00000000000000000" cp1<=not cp1;else count<=count 1;end if;end if;cp3<=count(10

5、);end process;process(cp1)begin if reset ='1' then num1(3 downto 0) <="0000"num2(3 downto 0) <="0000"num3(3 downto 0) <="0000"num4(3 downto 0) <="0000"num5(3 downto 0) <="0000"num6(3 downto 0) <="0000"else if cp1&#

6、39; event and cp1='1' then if beginstop='1' then num1<=num1 1;if num1 (3 downto 0)="1001" then num1 (3 downto 0)<="0000" num2<= num2 1;if num2 (3 downto 0)="1001" then num2 (3 downto 0)<="0000" num3<= num3 1;if num3 (3 downto 0)=

7、"1001" then num3 (3 downto 0)<="0000" num4<= num4 1;if num4 (3 downto 0)="0101" then num4 (3 downto 0)<="0000" num5<= num5 1;if num5 (3 downto 0)="1001" then num5 (3 downto 0)<="0000" num6<= num6 1;if num6 (3 downto 0)=&qu

8、ot;0101" then num6(3 downto 0)<="0000"end if; end if; end if; end if; end if; end if; end if;end if; end if;end process;process (cp3) begin if (cp3' event and cp3='1')then if(numlet(2 downto 0)="000") thennum<=num1;selsig(6 downto 1)<="111110"

9、end if;if(numlet(2 downto 0)="001") thennum<=num2;selsig(6 downto 1)<="111101" end if;if(numlet(2 downto 0)="010") thennum<=num3;selsig(6 downto 1)<="111011" end if;if(numlet(2 downto 0)="011") thennum<=num4;selsig(6 downto 1)<=&quo

10、t;110111" end if;if(numlet(2 downto 0)="100") thennum<=num5;selsig(6 downto 1)<="101111" end if;numlet(2 downto 0)<=numlet(2 downto 0) 1;if(numlet(2 downto 0)="101") thennumlet(2 downto 0)<="011111" end if;end if;if (num (3 downto 0)="000

11、0")then segsig(7 downto 0)<="01111111" end if;if (num (3 downto 0)="0001")then segsig(7 downto 0)<="00001101" end if;if (num (3 downto 0)="0010")then segsig(7 downto 0)<="10110111" end if;if (num (3 downto 0)="0011")then segsi

12、g(7 downto 0)<="10011111" end if;if (num (3 downto 0)="0100")then segsig(7 downto 0)<="11001101" end if;if (num (3 downto 0)="0101")then segsig(7 downto 0)<="11011011" end if;if (num (3 downto 0)="0110")then segsig(7 downto 0)<="11111011" end if;if (num (3 downto 0)="0111")then segsig(7 downto 0)<="00001111" end if;if (num (3 downto 0)="1000")then segsig(7 downto 0)<="11111111" end if;if (num (3 downto 0)="1001")then segsig(7 downto 0)<="1101111

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(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)論

0/150

提交評(píng)論