EDA數(shù)字秒表的設(shè)計(jì)程序_第1頁(yè)
EDA數(shù)字秒表的設(shè)計(jì)程序_第2頁(yè)
EDA數(shù)字秒表的設(shè)計(jì)程序_第3頁(yè)
EDA數(shù)字秒表的設(shè)計(jì)程序_第4頁(yè)
EDA數(shù)字秒表的設(shè)計(jì)程序_第5頁(yè)
已閱讀5頁(yè),還剩1頁(yè)未讀 繼續(xù)免費(fèi)閱讀

下載本文檔

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

文檔簡(jiǎn)介

EDA數(shù)字秒表的設(shè)計(jì)程序2。開機(jī)顯示00。00。00,用戶課隨時(shí)計(jì)時(shí),暫停,清零,最大計(jì)時(shí)可到59分59。99秒。

3。技術(shù)時(shí)鐘為100HZ

4。采納時(shí)分復(fù)用的方法掌握4個(gè)數(shù)碼管的顯示,可節(jié)約資源。

程序如下:

Libraryieee;

Useieee.std_logic_1164.all;

Useieee.std_logic_arith.all;

Useieee.std_logic_unsigned.all;

Entitywatchis

Port(sel:outstd_logic_vector(6downto

1);

seg:outstd_logic_vector(7downto0);

Beginstop:instd_logic;

Reset:instd_logic;

Cp2:instd_logic);

Endwatch;

Architecturebehaveofwatchis

Signalnum1:std_logic_vector(3downto0);

Signalnum2:std_logic_vector(3downto0);

Signalnum3:std_logic_vector(3downto0);

Signalnum4:std_logic_vector(3downto0);

Signalnum5:std_logic_vector(3downto0);

Signalnum6:std_logic_vector(3downto0);

Signalnum:std_logic_vector(3downto0);

Signalnumlet:std_logic_vector(2downto0);

Signalcount:std_logic_vector(17downto

1);

Signalselsig:std_logic_vector(6downto

1);

Signalsegsig:std_logic_vector(7downto0);

Signalcp1:std_logic;

Signalcp3:std_logic;

Begin

Process(cp

2)----分頻。

Begin

If(cp2”eventandcp2=”1”)then

if(Count=“1100011010011111“)then

count=“00000000000000000“;cp1=notcp1;

elsecount=count1;

endif;

endif;

cp3=count

(10);

endprocess;

process(cp

1)

begin

ifreset=”1”thennum1(3downto0)=“0000“;

num2(3downto0)=“0000“;

num3(3downto0)=“0000“;

num4(3downto0)=“0000“;

num5(3downto0)=“0000“;

num6(3downto0)=“0000“;

elseifcp1”eventandcp1=”1”then

ifbeginstop=”1”thennum1=num11;

ifnum1(3downto0)=“1001“thenifnum2(3downto0)=“1001“then

num2(3downto0)=“0000“;num3=num31;

ifnum3(3downto0)=“1001“then

num3(3downto0)=“0000“;num4=num41;

ifnum4(3downto0)=“0101“then

num4(3downto0)=“0000“;num5=num51;

ifnum5(3downto0)=“1001“then

num5(3downto0)=“0000“;num6=num61;

ifnum6(3downto0)=“0101“then

num6(3downto0)=“0000“;

endif;endif;endif;endif;endif;endif;endif;

endif;endif;

endprocess;

process(cp

3)

begin

if(cp3”eventandcp3=”1”)then

if(numlet(2downto0)=“000“)then

num=num1;selsig(6downto

1)=“111110“;endif;

if(numlet(2downto0)=“001“)then

num=num2;selsig(6downto

1)=“111101“;endif;

if(numlet(2downto0)=“010“)then

num=num3;selsig(6downto

1)=“111011“;endif;

if(numlet(2downto0)=“011“)then

num=num4;selsig(6downto

1)=“110111“;endif;

if(numlet(2downto0)=“100“)then

num=num5;selsig(6downto

1)=“101111“;endif;

numlet(2downto0)=numlet(2downto0)1;

if(numlet(2downto0)=“101“)then

numlet(2downto0)=“011111“;endif;

endif;

if(num(3downto0)=“0000“)then

segsig(7downto0)=“01111111“;endif;

if(num(3downto0)=“0001“)then

segsig(7downto0)=“00001101“;endif;

if(num(3downto0)=“0010“)then

segsig(7downto0)=“10110111“;endif;

if(num(3downto0)=“0011“)then

segsig(7downto0)=“10011111“;endif;

if(num(3downto0)=“0100“)then

segsig(7downto0)=“11001101“;endif;

if(num(3downto0)=“0101“)then

segsig(7downto0)=“11011011“;endif;

if(num(3downto0)=“0110“)then

segsig(7downto0)=“11111011“;endif;

if(num(3downto0)=“0111“)then

segsig(7downto0)=“00001111“;endif;

if(num(3downto0)=“1000“)then

segsig(7downto0)=“11111111“;endif;

溫馨提示

  • 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)論