eda多功能數(shù)字鐘 eda電子鐘(五篇)

格式:DOC 上傳日期:2023-01-11 17:20:49
eda多功能數(shù)字鐘 eda電子鐘(五篇)
時(shí)間:2023-01-11 17:20:49     小編:zdfb

在日常的學(xué)習(xí)、工作、生活中,肯定對(duì)各類(lèi)范文都很熟悉吧。那么我們?cè)撊绾螌?xiě)一篇較為完美的范文呢?下面我給大家整理了一些優(yōu)秀范文,希望能夠幫助到大家,我們一起來(lái)看一看吧。

eda多功能數(shù)字鐘 eda電子鐘篇一

設(shè)計(jì)題目:用vhdl語(yǔ)言實(shí)現(xiàn)數(shù)字鐘的設(shè)計(jì)

班 級(jí):電子1002班 學(xué) 號(hào):20102625 姓 名:于曉 指導(dǎo)教師:李世平、李寧 設(shè)計(jì)時(shí)間:2012年12月

摘要

數(shù)字鐘是一種用數(shù)字電路技術(shù)實(shí)現(xiàn)時(shí)、分、秒計(jì)時(shí)的鐘表。本設(shè)計(jì)主要是實(shí)現(xiàn)數(shù)字鐘的功能,程序用vhdl語(yǔ)言編寫(xiě),整體采用top-to-down設(shè)計(jì)思路,具有基本的顯示年月日時(shí)分秒和星期的功能,此外還有整點(diǎn)報(bào)時(shí)功能。該數(shù)字鐘的實(shí)現(xiàn)程序分為頂層模塊、年月模塊、日模塊、時(shí)分秒定時(shí)模塊、數(shù)碼管顯示模塊、分頻模塊、星期模塊,此外還有一個(gè)庫(kù)。該程序主要是用了元件例化的方法,此外還有進(jìn)程等重要語(yǔ)句。

沒(méi)有脈沖時(shí),顯示時(shí)分秒,set按鈕產(chǎn)生第一個(gè)脈沖時(shí),顯示年月日,第2個(gè)脈沖到來(lái)時(shí)可預(yù)置年份,第3個(gè)脈沖到來(lái)時(shí)可預(yù)置月份,依次第4、5、6、7、8個(gè)脈沖到來(lái)時(shí)分別可預(yù)置日期、時(shí)、分、秒、星期,第 9個(gè)脈沖到來(lái)時(shí)設(shè)置星期后預(yù)置結(jié)束,正常工作,顯示的是時(shí)分秒和星期。調(diào)整設(shè)置通過(guò)up來(lái)控制,up為高電平,upclk有脈沖到達(dá)時(shí),預(yù)置位加1,否則減1。當(dāng)整點(diǎn)到達(dá)時(shí),報(bào)時(shí)器會(huì)鳴響,然后手動(dòng)按鍵停止報(bào)時(shí)。

關(guān)鍵詞:數(shù)字鐘,vhdl,元件例化,數(shù)碼管

1、課程設(shè)計(jì)目的

掌握利用可編程邏輯器件和eda設(shè)計(jì)工具進(jìn)行電子系統(tǒng)設(shè)計(jì)的方法

2、課程設(shè)計(jì)內(nèi)容及要求

設(shè)計(jì)實(shí)現(xiàn)一個(gè)具有帶預(yù)置數(shù)的數(shù)字鐘,具有顯示年月日時(shí)分秒的功能。用6個(gè)數(shù)碼管顯示時(shí)分秒,set按鈕產(chǎn)生第一個(gè)脈沖時(shí),顯示切換年月日,第2個(gè)脈沖到來(lái)時(shí)可預(yù)置年份,第3個(gè)脈沖到來(lái)時(shí)可預(yù)置月份,依次第4、5、6、7個(gè)脈沖到來(lái)時(shí)分別可預(yù)置日期、時(shí)、分、秒,第 8個(gè)脈沖到來(lái)后預(yù)置結(jié)束,正常工作,顯示的是時(shí)分秒。up為高電平時(shí),upclk有脈沖到達(dá)時(shí),預(yù)置位加1.否則減1,還可以在此基礎(chǔ)上增加其它功能。

3、vhdl程序設(shè)計(jì)

3.1整體設(shè)計(jì)思路

本設(shè)計(jì)采用top-down 模式設(shè)計(jì),分模塊進(jìn)行,各功能都使用元件例化方式設(shè)計(jì),主要有l(wèi)ed顯示模塊、時(shí)分秒定時(shí)模塊、日期模塊、年月模塊、分頻模塊、星期模塊,此外還創(chuàng)建了一個(gè)程序包,用來(lái)實(shí)現(xiàn)年月日、時(shí)分秒的加減調(diào)整。主要運(yùn)用了過(guò)程語(yǔ)句、元件例化語(yǔ)句、信號(hào)賦值語(yǔ)句、和順序語(yǔ)句

圖3-1-1 整體結(jié)構(gòu)圖

圖3-1-2 頂層模塊引腳圖

3.2各模塊設(shè)計(jì)思路

3.2.1 普通計(jì)數(shù)器(時(shí)、分、秒、月、年計(jì)數(shù)器)設(shè)計(jì)

時(shí)鐘模塊通過(guò)調(diào)用程序包的時(shí)分秒加減過(guò)程語(yǔ)句實(shí)現(xiàn)兩個(gè)六十進(jìn)制,一個(gè)二十四進(jìn)制,秒的進(jìn)位信號(hào)作為分的計(jì)數(shù)時(shí)鐘信號(hào),分的進(jìn)位信號(hào)作為時(shí)的時(shí)鐘信號(hào)。時(shí)的進(jìn)位信號(hào)通過(guò)管腳映射到日期模塊的計(jì)數(shù)時(shí)鐘信號(hào)。

定時(shí)功能在時(shí)分秒模塊中,是由分計(jì)數(shù)器在到達(dá)59時(shí)產(chǎn)生一個(gè)脈沖,讓speaker產(chǎn)生高電位鳴響。

年月模塊主要實(shí)現(xiàn)月份的十二進(jìn)制計(jì)數(shù)器,和100進(jìn)制的年份計(jì)數(shù)器。月份的計(jì)數(shù)信號(hào)由日期模塊的進(jìn)位信號(hào)傳遞過(guò)來(lái),年份的時(shí)鐘信號(hào)由月份的進(jìn)位信號(hào)產(chǎn)生。

圖3-2-1 時(shí)分秒引腳圖 圖3-2-2 年月引腳圖 3.2.2 可變進(jìn)制計(jì)數(shù)器(天計(jì)數(shù)器)模塊設(shè)計(jì)

不同月中的天的數(shù)量是不同的,例如“大月”就有31“天”,“小月”有30“天”,平年“二月”有28“天”,而閏年“二月”有29“天”。所以天計(jì)數(shù)器應(yīng)該具備進(jìn)制可變的性能。日期模塊主要分為三個(gè)部分,預(yù)置日期加,預(yù)置日期減和產(chǎn)生進(jìn)位信號(hào),使月份增加。平閏年的判斷是通過(guò)年月模塊傳輸過(guò)來(lái)年份信號(hào)(兩個(gè)4位的bcd碼),如果高位的信號(hào)為“xxx0”且低位的信號(hào)為“xx00”(如20,84等),或高位為“xxx1”且低位為“xx10”(如32等)則判斷為閏年。這種方法的包含了一百年中的所有閏年的情況。然后判斷大月小月可以判斷月份來(lái)確定30進(jìn)制還是31進(jìn)制。進(jìn)位信號(hào)也是分為大月、小月、平年閏年來(lái)確定是否產(chǎn)生。

圖3-2-3 日模塊引腳圖

3.2.3 led顯示模塊

主要通過(guò)接受setpin的控制信號(hào)來(lái)選擇顯示的內(nèi)容,把不同的信號(hào)賦給輸出的端口,從而實(shí)現(xiàn)時(shí)分秒,年月日的切換。3.2.4 星期模塊

通過(guò)七進(jìn)制計(jì)數(shù)器實(shí)現(xiàn),同時(shí)帶有預(yù)置的功能,不能同年月調(diào)整聯(lián)動(dòng),但是能單獨(dú)調(diào)整。

圖3-2-4 星期模塊引腳圖

4、仿真與分析

4.1 日模塊

4.1.1 年份為2000年,月份為2月,有29天,初值設(shè)為2000年2月28日,仿真中日為:28、29、1、2、?

4.1.2 年份為1999年,月份為2月,有28天,初值設(shè)為1999年2月28日,仿真中日為:28、1、2、?

4.1.3 年份為2000年,月份為3月,有31天,初值設(shè)為2000年3月30日,仿真中日為:30、31、1、2、?

4.1.4 年份為2000年,月份為4月,有30天,初值設(shè)為2000年4月30日,仿真中日為:30、1、2、?

4.2 年月模塊

初值設(shè)為1999年12月,lock為1時(shí),顯示年月,lock為3時(shí),預(yù)置月,lock為2時(shí),預(yù)置年

4.3 時(shí)分秒定時(shí)模塊

lock為0時(shí),顯示時(shí)分秒,lock為5時(shí),預(yù)置時(shí),lock為6時(shí),預(yù)置分,lock為7時(shí),預(yù)置秒。當(dāng)分到達(dá)59時(shí),整點(diǎn)報(bào)時(shí)器響,speaker高電位,隨著手動(dòng)清零,恢復(fù)原位。

4.4 星期模塊

初值設(shè)為星期1,仿真中顯示為:1、2、3、4、5、6、7、1、?

4.5 分頻模塊

4.6 頂層設(shè)計(jì)模塊

5、課程設(shè)計(jì)總結(jié)

本次課程設(shè)計(jì)歷時(shí)兩天半,經(jīng)過(guò)自己不斷的努力完成了數(shù)字鐘的設(shè)計(jì),程序代碼的編寫(xiě)調(diào)試及仿真。以前只是看書(shū)或者編一些很小的程序用來(lái)仿真,覺(jué)得沒(méi)怎么難,但當(dāng)進(jìn)行此次課程設(shè)計(jì)真正處理一個(gè)較大程序時(shí),問(wèn)題便都顯現(xiàn)出來(lái)。雖然在這個(gè)過(guò)程中遇到了很多的問(wèn)題,但是最終都得到了很好的解決。

我此次設(shè)計(jì)的程序是在課本原有數(shù)字鐘程序的基礎(chǔ)上進(jìn)行添加更改得來(lái)的,最初在運(yùn)行原有程序時(shí)很順利,但是隨著加的東西越來(lái)越多,程序中出現(xiàn)的問(wèn)題也就越來(lái)越多。很多同學(xué)都覺(jué)得在已有程序上再添加?xùn)|西看似簡(jiǎn)單,實(shí)則很容易混亂,理不清頭緒,而且這個(gè)原有程序是用進(jìn)程所寫(xiě),比較麻煩。雖然這樣容易出現(xiàn)問(wèn)題,不過(guò)我覺(jué)得這是一個(gè)鍛煉的好機(jī)會(huì)。、在處理分頻模塊時(shí),最開(kāi)始按照老師的要求設(shè)置了頻率,但是當(dāng)運(yùn)行時(shí),發(fā)現(xiàn)根本出不來(lái),后來(lái)與同學(xué)討論后,發(fā)現(xiàn)頻率過(guò)大,后來(lái)改為八分頻,使得分頻

模塊能夠使用。在一開(kāi)始加星期模塊時(shí),沒(méi)怎么考慮,可是當(dāng)加進(jìn)去后才發(fā)現(xiàn),星期模塊不能與其他模塊很好的相連,不能很好的做到與“日模塊”相合,后來(lái)雖有改動(dòng),但最終沒(méi)能改成功。在加定時(shí)器功能時(shí),一開(kāi)始單獨(dú)為定時(shí)器列了一個(gè)模塊,所寫(xiě)的程序也很復(fù)雜,錯(cuò)誤百出,最后程序改好后,仿真卻出不來(lái)。后來(lái)經(jīng)過(guò)同學(xué)的提點(diǎn),就把程序改簡(jiǎn)單了,單純的來(lái)個(gè)脈沖就出現(xiàn)高電平,但后來(lái)仿真發(fā)現(xiàn)高電平一直在高位,沒(méi)法給脈沖,最后沒(méi)辦法便手動(dòng)脈沖。與頂層模塊連接后,又發(fā)現(xiàn)分滿(mǎn)59的脈沖沒(méi)給,因?yàn)槲业臅r(shí)分秒全都放在了一起,只能將定時(shí)模塊挪到時(shí)分秒模塊中,這樣反而使得整個(gè)工程簡(jiǎn)單了一些。

在各個(gè)模塊都能仿真成功后,頂層模塊的程序與仿真卻出現(xiàn)了很多問(wèn)題。首先是頂層模塊程序有很多警告,例如“second_waver”沒(méi)有用到之類(lèi)的,后來(lái)在改動(dòng)的過(guò)程中,便把內(nèi)變量換為了外變量,但是有些原來(lái)的警告沒(méi)有了,但是新的警告又出現(xiàn)了,原本能夠連好的u3與u4 模塊均不能正常連接,后來(lái)與同學(xué)自習(xí)查找,才終于將錯(cuò)誤找出,由于粗心大意誤動(dòng)了一些元件例化時(shí)的變量,使得時(shí)間拜拜浪費(fèi)。最后在仿真的時(shí)候,仿真結(jié)果出不來(lái),經(jīng)過(guò)與同學(xué)商量在每個(gè)程序中都給年月日等變量均付了初值,才讓仿真出來(lái)。

此次課程設(shè)計(jì)雖然只有短短的兩天半的時(shí)間,但是經(jīng)過(guò)前期的查找資料,后來(lái)的實(shí)驗(yàn)室實(shí)際操作,再到現(xiàn)在的報(bào)告總結(jié),我收獲了很多。其實(shí)完成一個(gè)設(shè)計(jì),編程只是很小的一部分,最主要的在于查找資料以及調(diào)試程序,此次設(shè)計(jì)我在查找資料方面做的不是很充分,以至于設(shè)計(jì)的面很小,而且在遇到問(wèn)題后不能很快的找出,以后一定要做好準(zhǔn)備工作。此次課程設(shè)計(jì)中遇到的問(wèn)題看似不大,但都是很好的問(wèn)題,對(duì)我以后的設(shè)計(jì)有很大的幫助,一定會(huì)牢牢記住。

最后,此次課程設(shè)計(jì)的完成很大程度上取決于老師和同學(xué)對(duì)我的指導(dǎo)與幫助,這更能說(shuō)明,一個(gè)較大設(shè)計(jì)的完成及實(shí)現(xiàn),不是僅限于自身,我們要學(xué)會(huì)與別人交流溝通,才能做到更好。

6、參考文獻(xiàn)

[1]李景華,杜玉遠(yuǎn).可編程邏輯器件與eda技術(shù).沈陽(yáng):東北大學(xué)出版社,2000 [2] 姜如東,vhdl語(yǔ)言程序設(shè)計(jì)及應(yīng)用,北京郵電大學(xué)出版社

[3] 康華光.電子技術(shù)基礎(chǔ)(數(shù)字部分)[m].北 京:高等教育出版社,2001.

[4] [5]

eda多功能數(shù)字鐘 eda電子鐘篇二

library ieee;use ;use ;use ;entity clock is port(en

:in std_logic;數(shù)碼管使能

clk

:in std_logic;時(shí)鐘信號(hào)

rst

:in std_logic;復(fù)位信號(hào)

sec_1

:out std_logic_vector(3 downto 0);秒高位

sec_01 :out std_logic_vector(3 downto 0);秒低位

min_1

:out std_logic_vector(3 downto 0);分高位

min_01 :out std_logic_vector(3 downto 0);分低位

hou_1

:out std_logic_vector(3 downto 0);時(shí)高位

hou_01 :out std_logic_vector(3 downto 0);時(shí)低位

bee

:out std_logic);end clock;

architecture behovior of clock is signal sec_high:std_logic_vector(3 downto 0);

signal sec_low

:std_logic_vector(3 downto 0);signal min_high:std_logic_vector(3 downto 0);

signal min_low:std_logic_vector(3 downto 0);signal hou_high:std_logic_vector(3 downto 0);

signal hou_low

:std_logic_vector(3 downto 0);

signal cy_min

:std_logic;分進(jìn)位

signal cy_hou

:std_logic;時(shí)進(jìn)位

signal logo_1

:std_logic;標(biāo)志

signal logo_2

:std_logic;

signal logo_3

:std_logic;

begin miaolow:process(clk,rst,en)

begin

if(rst = '0')

then

sec_low <= “1000”;附給秒低位為8

elsif(clk'event and clk = '1' and en = '1')then 檢測(cè)時(shí)鐘上升沿及數(shù)碼管使能端

if(sec_low = “1001”)then

sec_low <= “0000”;

else

sec_low <= sec_low + “0001”;加一

end if;

end if;

end process miaolow;

logo_1 <= sec_low(3)and sec_low(0);

sec_01<= sec_low;秒個(gè)位放8

miaohigh:process(clk,rst)

begin

if(rst = '0')

then

sec_high <= “0101”;

elsif(clk'event and clk = '1')then檢測(cè)時(shí)鐘上升沿

if(logo_1 = '1')then

if(sec_high = “0101”)then

sec_high <= “0000”;

cy_min <= '1';

else

sec_high <= sec_high + “0001”;加一

cy_min <= '0';

end if;

end if;

end if;

end process miaohigh;

sec_1 <= sec_high;秒十位放5

fenlow:process(cy_min,rst,en)

begin

if(rst = '0')

then 若復(fù)位位為0

min_low <= “1000”;則分個(gè)位為8

elsif(cy_min'event and cy_min = '1' and en = '1')then檢測(cè)時(shí)鐘上升沿及數(shù)碼管使能端

if(min_low = “1001”)then

min_low <= “0000”;

else

min_low <= min_low + “0001”;加一

end if;

end if;

end process fenlow;

logo_2 <= min_low(3)and min_low(0);

min_01 <= min_low;分個(gè)位放8

fenhigh:process(cy_min,rst)

begin

if(rst = '0')

then

min_high <= “0101”;

elsif(cy_min'event and cy_min = '1')then檢測(cè)分進(jìn)位上升沿

if(logo_2 = '1')then

if(min_high = “0101”)then若分十位為5

min_high <= “0000”;

cy_hou <= '1';時(shí)進(jìn)位為1

else

min_high <= min_high + “0001”;加一

cy_hou <= '0';

end if;

end if;

end if;

end process fenhigh;

min_1 <= min_high;分十位放5

shilow:process(cy_hou,rst,en)

begin

if(rst = '0')

then

hou_low <= “1001”;

elsif(cy_hou'event and cy_hou = '1'

and en = '1')then檢測(cè)時(shí)進(jìn)位上升沿及數(shù)碼管使能端

if(hou_low = “1001”)then若時(shí)低位為9

hou_low <= “0000”;

elsif(hou_high = “0010” and hou_low = “0011”)then若時(shí)十位為2,個(gè)位為3

hou_low <= “0000”;

else

hou_low <= hou_low + “0001”;加一

end if;

end if;

end process shilow;

logo_3 <= hou_low(3)and hou_low(0);

hou_01 <= hou_low;時(shí)個(gè)位放3

shihigh:process(cy_hou,rst)

begin

if(rst = '0')

then

hou_high <= “0001”;

elsif(cy_hou'event and cy_hou = '1')then檢測(cè)時(shí)進(jìn)位上升沿

if(hou_high = “0010” and hou_low = “0011”)then若時(shí)十位為2,時(shí)個(gè)位為3

hou_high <= “0000”;

elsif(logo_3 = '1')then

hou_high <= hou_high + “0001”;加一

end if;

end if;

end process shihigh;

bee_clock:process(clk)

begin

if(clk'event and clk = '1')then檢測(cè)時(shí)鐘上升沿

if(sec_high = “0101” and sec_low = “1001”

and min_high = “0101” and min_low = “1001”)then

bee <= '1';

else

bee <= '0';

end if;

end if;

end process bee_clock;

hou_1 <= hou_high;時(shí)十位放2

end behovior;

library ieee;use ;use ;use ;entity clock1 is port(en

:in std_logic;

clk

:in std_logic;

rst

:in std_logic;sec_1

:out std_logic_vector(3 downto 0);

sec_01 :out std_logic_vector(3 downto 0);min_1

:out std_logic_vector(3 downto 0);

min_01 :out std_logic_vector(3 downto 0);hou_1

:out std_logic_vector(3 downto 0);

hou_01 :out std_logic_vector(3 downto 0);

bee

:out std_logic);end clock1;

architecture behovior of clock1 is signal sec_high:std_logic_vector(3 downto 0);

signal sec_low

:std_logic_vector(3 downto 0);signal min_high:std_logic_vector(3 downto 0);

signal min_low:std_logic_vector(3 downto 0);signal hou_high:std_logic_vector(3 downto 0);

signal hou_low

:std_logic_vector(3 downto 0);

signal cy_min

:std_logic;

signal cy_hou

:std_logic;signal logo_1

:std_logic;

signal logo_2

:std_logic;

signal logo_3

:std_logic;

begin miaolow:process(clk,rst,en)

begin

if(rst = '0')

then

sec_low <= “1000”;

elsif(clk'event and clk = '1' and en = '1')then

if(sec_low = “1001”)then

sec_low <= “0000”;

else

sec_low <= sec_low + “0001”;

end if;

end if;

end process miaolow;

logo_1 <= sec_low(3)and sec_low(0);

sec_01<= sec_low;

miaohigh:process(clk,rst)

begin

if(rst = '0')

then

sec_high <= “0101”;

elsif(clk'event and clk = '1')then

if(logo_1 = '1')then

if(sec_high = “0101”)then

sec_high <= “0000”;

cy_min <= '1';

else

sec_high <= sec_high + “0001”;

cy_min <= '0';

end if;

end if;

end if;

end process miaohigh;

sec_1 <= sec_high;fenlow:process(cy_min,rst,en)

begin

if(rst = '0')

then

min_low <= “1000”;

elsif(cy_min'event and cy_min = '1' and en = '1')then

if(min_low = “1001”)then

min_low <= “0000”;

else

min_low <= min_low + “0001”;

end if;

end if;

end process fenlow;

logo_2 <= min_low(3)and min_low(0);

min_01 <= min_low;

fenhigh:process(cy_min,rst)

begin

if(rst = '0')

then

min_high <= “0101”;

elsif(cy_min'event and cy_min = '1')then

if(logo_2 = '1')then

if(min_high = “0101”)then

min_high <= “0000”;

cy_hou <= '1';

else

min_high <= min_high + “0001”;

cy_hou <= '0';

end if;

end if;

end if;

end process fenhigh;

min_1 <= min_high;shilow:process(cy_hou,rst,en)

begin

if(rst = '0')

then

hou_low <= “1001”;

elsif(cy_hou'event and cy_hou = '1' and en = '1')then

if(hou_low = “1001”)then

hou_low <= “0000”;

elsif(hou_high = “0010” and hou_low = “0011”)then

hou_low <= “0000”;

else

hou_low <= hou_low + “0001”;

end if;

end if;

end process shilow;

logo_3 <= hou_low(3)and hou_low(0);

hou_01 <= hou_low;

shihigh:process(cy_hou,rst)

begin

if(rst = '0')

then

hou_high <= “0001”;

elsif(cy_hou'event and cy_hou = '1')then

if(hou_high = “0010” and hou_low = “0011”)then

hou_high <= “0000”;

elsif(logo_3 = '1')then

hou_high <= hou_high + “0001”;

end if;

end if;

end process shihigh;

bee_clock:process(clk)

begin

if(clk'event and clk = '1')then

if(sec_high = “0101” and sec_low = “1001”

and min_high = “0101” and min_low = “1001”)then

bee <= '1';

else

bee <= '0';

end if;

end if;

end process bee_clock;

hou_1 <= hou_high;

end behovior;

eda多功能數(shù)字鐘 eda電子鐘篇三

[ 標(biāo)簽:數(shù)字鐘, eda ]

1、設(shè)計(jì)一個(gè)能顯示1/10秒、秒、分、時(shí)的12小時(shí)數(shù)字鐘。

2、時(shí)鐘源使用頻率為0.1hz的連續(xù)脈沖。

3、設(shè)置兩個(gè)按鈕,一個(gè)供“開(kāi)始”及“停止”用,一個(gè)供系統(tǒng)“復(fù)位”用。

4、時(shí)鐘顯示使用數(shù)碼管顯示。

基于vhdl的多功能數(shù)字鐘的設(shè)計(jì) eda課程設(shè)計(jì) 資料類(lèi)別課程(專(zhuān)業(yè))eda 適用年級(jí)大學(xué)文件格式word+dls 文件大小1725k 上傳時(shí)間2008-10-10 20:57:00 預(yù)覽文件無(wú)(只能預(yù)覽文件中的部分內(nèi)容)下載次數(shù)0內(nèi)容簡(jiǎn)介:eda課程設(shè)計(jì) 基于vhdl的多功能數(shù)字鐘的設(shè)計(jì),共11頁(yè),6086字,附源程序。摘要:介紹了利用vhdl硬件描述語(yǔ)言設(shè)計(jì)的多功能數(shù)字鐘的思路和技巧。在max+plusii開(kāi)發(fā)環(huán)境中編譯和仿真了所設(shè)計(jì)的程序,并在可編程邏輯器件上下栽驗(yàn)證。仿真和驗(yàn)證結(jié)果表明,該設(shè)計(jì)方法切實(shí)可行。

eda-時(shí)鐘設(shè)計(jì)-基于altera數(shù)字鐘的實(shí)

現(xiàn):eda課程設(shè)計(jì) 基于vhdl的多功能數(shù)字鐘的設(shè)計(jì):eda數(shù)字鐘設(shè)計(jì)報(bào)告:資料包括: 論文(12頁(yè)2036字)圖紙說(shuō)明:中文摘要:數(shù)字鐘學(xué)習(xí)的目的是掌握各類(lèi)計(jì)數(shù)器及它們相連的設(shè)計(jì)方法;掌握多個(gè)數(shù)碼管顯示的原理與方法;掌握f(shuō)pga技術(shù)的層次化設(shè)計(jì)方法;掌握用vhdl語(yǔ)言的設(shè)計(jì)思想以及整個(gè)數(shù)字系統(tǒng)的設(shè)計(jì)。此數(shù)字鐘設(shè)計(jì)具有時(shí),分,秒計(jì)數(shù)顯示功能,以24小時(shí)為計(jì)數(shù)循環(huán);能實(shí)現(xiàn)清零,調(diào)節(jié)小時(shí),分鐘以及整點(diǎn)報(bào)時(shí)的功能。

eda多功能數(shù)字鐘 eda電子鐘篇四

eda實(shí)現(xiàn)多功能數(shù)字鐘

實(shí)

驗(yàn) 報(bào) 告

專(zhuān)業(yè)班級(jí):

學(xué)生姓名:

學(xué)生學(xué)號(hào):

目錄

一、內(nèi)容摘要

二、實(shí)驗(yàn)要求

三、各底層模塊設(shè)計(jì)

四、總體方案

五、心得體會(huì)

一、實(shí)驗(yàn)內(nèi)容

利用 quartusii 軟件,結(jié)合所學(xué)的數(shù)字電路的知識(shí)設(shè)計(jì)一個(gè) 24 時(shí)多功能數(shù) 字鐘,具有正常分、秒計(jì)時(shí),動(dòng)態(tài)顯示的功能。分析整個(gè)電路的工作原理,分別說(shuō)明各子模塊的設(shè)計(jì)原理和調(diào)試、仿真、編 程的過(guò)程。

二、實(shí)驗(yàn)任務(wù):

用 fpga 器件和 eda 技術(shù)實(shí)現(xiàn)多功能數(shù)字鐘的設(shè)計(jì)

已知條件:

1、max+plus 軟件

2、fpga 實(shí)驗(yàn)開(kāi)發(fā)裝置

基本功能:

1、以數(shù)字形式顯示時(shí)、分、秒的時(shí)間;

2、小時(shí)計(jì)數(shù)器為 24 進(jìn)制;

3、分、秒計(jì)數(shù)器為 60 進(jìn)制。

三、底層模塊設(shè)計(jì)(電路原理圖及仿真)

1、小時(shí)計(jì)數(shù)器為24進(jìn)制 電路原理圖

仿真圖

封裝圖

2、分、秒計(jì)時(shí)器都為60進(jìn)制 電路原理圖

仿真圖

封裝圖

四、總體方案

按照上述實(shí)驗(yàn)要求,本次電子數(shù)字時(shí)鐘實(shí)驗(yàn),通過(guò)兩個(gè)模 60 計(jì)數(shù)器及一個(gè)模 24 計(jì)數(shù)器級(jí)聯(lián)既可以實(shí)現(xiàn)計(jì)時(shí)模塊。多功能數(shù)字鐘的主體部分 電路原理圖

仿真圖

封裝圖

五、心得體會(huì)

剛剛開(kāi)始覺(jué)得做這個(gè)電子實(shí)驗(yàn)報(bào)告挺難的,因?yàn)閷?duì)軟件的不熟悉和對(duì)這個(gè)實(shí)驗(yàn)操作的也不熟悉,對(duì)著老師給的資料也做了很長(zhǎng)時(shí)間,就是仿真的時(shí)候有些該注意的沒(méi)有注意,導(dǎo)致仿真失敗,但是后來(lái)還是自己慢慢拿的請(qǐng)教同學(xué)、老師哪里出了問(wèn)題,后來(lái)才做出來(lái)了,把60進(jìn)制的做出來(lái)了,后來(lái)的24進(jìn)制按照老師給的電路原理圖也成功了仿真出來(lái),我用了很長(zhǎng)時(shí)間才編寫(xiě)出來(lái),現(xiàn)在看看,也沒(méi)有那么難了。同時(shí)請(qǐng)教老師,和同學(xué)、通過(guò)實(shí)驗(yàn)掌握一些邏輯組合器件的基本功能和用法??傊液芨兄x這次實(shí)驗(yàn)可以給我這樣的機(jī)會(huì),這個(gè)實(shí)驗(yàn)給了我很對(duì)的收獲,我相信這會(huì)對(duì)我以后的學(xué)習(xí)很有幫助。

eda多功能數(shù)字鐘 eda電子鐘篇五

數(shù)字鐘

一、實(shí)驗(yàn)?zāi)康?/p>

1、掌握多位計(jì)數(shù)器相連的設(shè)計(jì)方法。

2、掌握十進(jìn)制,六進(jìn)制,二十四進(jìn)制計(jì)數(shù)器的設(shè)計(jì)方法。

3、掌握揚(yáng)聲器的驅(qū)動(dòng)及報(bào)時(shí)的設(shè)計(jì)。

4、led燈的花樣顯示。

5、掌握cpld技術(shù)的層次化設(shè)計(jì)方法。

二、實(shí)驗(yàn)器材

1、主芯片altera epf10k10lc84-4。2、8個(gè)led燈。

3、揚(yáng)聲器。4、4位數(shù)碼顯示管。5、8個(gè)按鍵開(kāi)關(guān)(清零,調(diào)小時(shí),調(diào)分鐘)。

三、實(shí)驗(yàn)內(nèi)容

根據(jù)電路特點(diǎn),運(yùn)用層次設(shè)計(jì)概念設(shè)計(jì)。將此設(shè)計(jì)任務(wù)分成若干模塊,規(guī)定每一模塊的功能和各模塊之間的接口。

1、時(shí)計(jì)時(shí)程序: library ieee;use ;use ;

entity hour is

port(reset,clk : in std_logic;

daout : out std_logic_vector(7 downto 0));end hour;

architecture behav of hour is

signal count : std_logic_vector(3 downto 0);signal counter : std_logic_vector(3 downto 0);begin

p1: process(reset,clk)

begin

if reset='0' then

count<=“0000”;

counter<=“0000”;

elsif(clk'event and clk='1')then

if(counter<2)then

if(count=9)then

count<=“0000”;

counter<=counter + 1;

else

count<=count+1;

end if;

else

if(count=3)

then

counter<=“0000”;

else

count<=count+1;

count<=“0000”;

end if;

end if;

end if;

end process;

daout(7 downto 4)<=counter;daout(3 downto 0)<=count;

end behav;

2、分計(jì)時(shí)程序: library ieee;

use ;use ;

entity minute is

port(reset,clk,sethour: in std_logic;

daout : out std_logic_vector(7 downto 0);

enhour : out std_logic);end minute;

architecture behav of minute is

signal count : std_logic_vector(3 downto 0);signal counter : std_logic_vector(3 downto 0);signal carry_out1 : std_logic;signal carry_out2 : std_logic;begin

p1: process(reset,clk)begin

if reset='0' then

count<=“0000”;

counter<=“0000”;

elsif(clk'event and clk='1')then

if(counter<5)then

if(count=9)then

count<=“0000”;

counter<=counter + 1;

else

count<=count+1;

end if;

carry_out1<='0';

else

if(count=9)then

count<=“0000”;

counter<=“0000”;

carry_out1<='1';

else

count<=count+1;

carry_out1<='0';

end if;

end if;end if;end process;

p2: process(clk)begin

if(clk'event and clk='0')then

if(counter=0)then

if(count=0)then

carry_out2<='0';

end if;

else

carry_out2<='1';

end if;end if;end process;

daout(7 downto 4)<=counter;daout(3 downto 0)<=count;enhour<=(carry_out1 and carry_out2)or sethour;end behav;

3、秒計(jì)時(shí)程序: library ieee;

use ;use ;

entity second is

port(reset,clk,setmin : in std_logic;

daout : out std_logic_vector(7 downto 0);

enmin : out std_logic);end second;

architecture behav of second is

signal count : std_logic_vector(3 downto 0);signal counter : std_logic_vector(3 downto 0);signal carry_out1 : std_logic;signal carry_out2 : std_logic;begin

p1: process(reset,clk)begin

if reset='0' then

count<=“0000”;

counter<=“0000”;

elsif(clk'event and clk='1')then

if(counter<5)

then

if

(count=9)

then

count<=“0000”;

counter<=counter + 1;

else

count<=count+1;

end if;

carry_out1<='0';

else

if(count=9)

then

count<=“0000”;

counter<=“0000”;

carry_out1<='1';

else

count<=count+1;

carry_out1<='0';

end if;

end if;end if;end process;daout(7 downto

4)<=counter;

daout(3

downto

0)<=count;enmin<=carry_out1 or setmin;end behav;6

4、alert程序: library ieee;

use ;use ;

entity alert is port(clkspk : in std_logic;

second : in std_logic_vector(7 downto 0);

minute : in std_logic_vector(7 downto 0);

speak : out std_logic;

lamp : out std_logic_vector(8 downto 0));end alert;

architecture behav of alert is signal spanclkspk2 : std_logic;begin p1: process(clkspk)begin

if(clkspk'event and clkspk='1')then

spanclkspk2<=not spanclkspk2;

end if;end process;p2: process(second,minute)begin if(minute=“01011001”)then case second is

when “01010001”=>lamp<=“000000001”;speak<=spanclkspk2;when “01010010”=>lamp<=“000000010”;speak<='0';when “01010011”=>lamp<=“000000100”;speak<=spanclkspk2;when “01010100”=>lamp<=“000001000”;speak<='0';when “01010101”=>lamp<=“000010000”;speak<=spanclkspk2;when “01010110”=>lamp<=“000100000”;speak<='0';when “01010111”=>lamp<=“001000000”;speak<=spanclkspk2;when “01011000”=>lamp<=“010000000”;speak<='0';when “01011001”=>lamp<=“100000000”;speak<=clkspk;when others=>lamp<=“000000000”;end case;end if;end process;end behav;8

5、seltime程序 library ieee;

use ;use ;

entity seltime is port(ckdsp : in std_logic;

reset : in std_logic;

second : in std_logic_vector(7 downto 0);

minute : in std_logic_vector(7 downto 0);

hour : in std_logic_vector(7 downto 0);

daout : out std_logic_vector(3 downto 0);

sel : out std_logic_vector(2 downto 0));end seltime;

architecture behav of seltime is signal sec : std_logic_vector(2 downto 0);begin

process(reset,ckdsp)begin

if(reset='0')then sec<=“000”;

elsif(ckdsp'event and ckdsp='1')then

sec<=“000”;else

sec<=sec+1;end if;end if;end process;

process(sec,second,minute,hour)begin case sec is

when “000”=>daout<=second(3 downto 0);when “001”=>daout<=second(7 downto 4);when “011”=>daout<=minute(3 downto 0);when “100”=>daout<=minute(7 downto 4);when “110”=>daout<=hour(3 downto 0);when “111”=>daout<=hour(7 downto 4);when others=>daout<=“1111”;end case;end process;

if(sec=“111”)then

sel<=sec;end behav;

6、deled程序: library ieee;

use ;use ;

entity deled is port(s: in std_logic_vector(3 downto 0);

a,b,c,d,e,f,g,h: out std_logic);end deled;

architecture behav of deled is

signal data:std_logic_vector(3 downto 0);signal dout:std_logic_vector(7 downto 0);begin data<=s;process(data)begin

case data is

when “0000”=>dout<=“00111111”;when “0001”=>dout<=“00000110”;when “0010”=>dout<=“01011011”;when “0011”=>dout<=“01001111”;when “0100”=>dout<=“01100110”;when “0101”=>dout<=“01101101”;when “0110”=>dout<=“01111101”;when “0111”=>dout<=“00000111”;when “1000”=>dout<=“01111111”;when “1001”=>dout<=“01101111”;when “1010”=>dout<=“01110111”;when “1011”=>dout<=“01111100”;when “1100”=>dout<=“00111001”;when “1101”=>dout<=“01011110”;when “1110”=>dout<=“01111001”;when “1111”=>dout<=“01000000”;when others=>dout<=“00000000”;end case;end process;h<=dout(7);

g<=dout(6);

f<=dout(5);

e<=dout(4);d<=dout(3);c<=dout(2);b<=dout(1);a<=dout(0);end behav;

7、頂層原理圖:

四、實(shí)驗(yàn)結(jié)果 頂層原理圖仿真波形:

五、心得體會(huì)

1、系統(tǒng)設(shè)計(jì)進(jìn)要行充分的方案論證,不可盲目就動(dòng)手去做;

2、實(shí)驗(yàn)中對(duì)每一個(gè)細(xì)節(jié)部分都要全面思考,要對(duì)特殊情況進(jìn)行處理;

3、對(duì)于數(shù)字系統(tǒng),要考慮同步、異步問(wèn)題;

4、數(shù)字電路的理論分析要結(jié)合時(shí)序圖;

5、遇到問(wèn)題,要順藤摸瓜,分析清楚,不可胡亂改動(dòng),每做一次改變都要有充分的理由;

6、模塊化設(shè)計(jì)方法的優(yōu)點(diǎn)在于其簡(jiǎn)潔性,但是在實(shí)驗(yàn)設(shè)計(jì)中也發(fā)現(xiàn),在實(shí)驗(yàn)最終電路確定之前,要盡量減少模塊重疊嵌套,因?yàn)樵诳偟碾娐非枚ㄖ埃娐愤€不成熟,很多地方需要改進(jìn),如果在開(kāi)始時(shí)就進(jìn)行多層模塊化,里層模塊電路的修改將影響其外層的全部電路,這樣就是牽一發(fā)動(dòng)全身,很顯然,這樣將導(dǎo)致電 數(shù)字鐘課程設(shè)計(jì) 電路設(shè)計(jì)的低效,所以在設(shè)計(jì)過(guò)程中,一定要盡量減少超過(guò)兩層的模塊;

7、遇到問(wèn)題花了很長(zhǎng)時(shí)間沒(méi)有解決掉,要學(xué)會(huì)想他人請(qǐng)教,別人的不經(jīng)意一點(diǎn),可能就能把自己帶出思維死區(qū)。

【本文地址:http://mlvmservice.com/zuowen/1086906.html】

全文閱讀已結(jié)束,如果需要下載本文請(qǐng)點(diǎn)擊

下載此文檔