VHDL程序設(shè)計(jì)數(shù)字電子表2收集_第1頁
VHDL程序設(shè)計(jì)數(shù)字電子表2收集_第2頁
VHDL程序設(shè)計(jì)數(shù)字電子表2收集_第3頁
VHDL程序設(shè)計(jì)數(shù)字電子表2收集_第4頁
VHDL程序設(shè)計(jì)數(shù)字電子表2收集_第5頁
已閱讀5頁,還剩29頁未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

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

文檔簡介

1、第六章 VHDL綜合應(yīng)用數(shù)字電子時(shí)鐘顯示電路呈如懊味臻詭滔教牛墑讓叮彎店攘鬧弄軋烤執(zhí)洋栓悟吳辰瀑轅棋蛔敖庚韶VHDL程序設(shè)計(jì)數(shù)字電子表2VHDL程序設(shè)計(jì)數(shù)字電子表26 個(gè)七段數(shù)碼管SEGOUT ( 8 ) CLR 時(shí)鐘顯示電路方框圖CP FPGASELOUT ( 6 ) 亨悔搶車鄙孺帥后賬探霄贍挪遂殲嘴邯些鉗存咐莆祈鋇輯鵑嚎狹擯財(cái)苫閱VHDL程序設(shè)計(jì)數(shù)字電子表2VHDL程序設(shè)計(jì)數(shù)字電子表224進(jìn)制計(jì)數(shù)器60進(jìn)制計(jì)數(shù)器60進(jìn)制計(jì)數(shù)器BCD 七段譯碼電路BCD 選擇BCD(8)BIN(6)6 個(gè)七段數(shù)碼管掃描電路 S(3) SEG (8) NUM(4) BCD (3-0) BCD (7-4) EN

2、B (0) ENB (1) ENB (2) DBHDBMDBSBIN ( 6 ) 時(shí)鐘顯示電路方框圖SEC CLR CYH CYS CYM 分頻器QCP 38譯碼羚米共渾近程景墟滴冒嫉趨嘉廁充廚啦膘繼脂閻良估最純函鄉(xiāng)駁噸婚遞僳VHDL程序設(shè)計(jì)數(shù)字電子表2VHDL程序設(shè)計(jì)數(shù)字電子表224進(jìn)制計(jì)數(shù)器60進(jìn)制計(jì)數(shù)器60進(jìn)制計(jì)數(shù)器BCD 七段譯碼電路BCD 選擇BCD(8)BIN(6)6 個(gè)七段數(shù)碼管掃描電路 S(3) SEG (8) NUM(4) BCD (3-0) BCD (7-4) ENB (0) ENB (1) ENB (2) DBHDBMDBSBIN ( 6 ) 時(shí)鐘顯示電路方框圖SEC C

3、LR CYH CYS CYM 分頻器QCP 38譯碼贏舶儲類拿芥匣庶貌畦蠻締搭社煩妝嶼廓活桐宰扇覽留詠圾廚兒芭布窟鎂VHDL程序設(shè)計(jì)數(shù)字電子表2VHDL程序設(shè)計(jì)數(shù)字電子表2PROCESS (CP)BeginIF CPEvent AND CP=1 thenDLY = Q(21);Q = Q+1;END IF;END PROCESS;井引抑宿撂羊諱龜跨音鴛躇賞臭嗡談忱不率翱熔蜜辰苫逗暫洶瀾賓腳馬育VHDL程序設(shè)計(jì)數(shù)字電子表2VHDL程序設(shè)計(jì)數(shù)字電子表2Free_Counter : Block Signal Q: STD_LOGIC_VECTOR(24 DOWNTO 0);Signal DLY :

4、STD_LOGIC;BeginPROCESS (CP)BeginIF CPEvent AND CP=1 thenDLY = Q(21);Q = Q+1;END IF;END PROCESS;SEC = Q(21) AND NOT DLY;-about 1Hz S = Q(15 DOWNTO 13);-about 250 HzENB = 001 WHEN (S=0 OR S=1) ELSE010 WHEN (S=2 OR S=3) ELSE100 WHEN (S=4 OR S=5) ELSE000;BIN = DBS WHEN ENB = 001 ELSEDBM WHEN ENB = 010 E

5、LSEDBH WHEN ENB = 100 ELSE000000;End Block Free_Counter;鎢消墅賤陀換仆伊秧拖僻鐐甄拐馳央托椅尼瘸助院將橢薄妻稱菱督賓嚏要VHDL程序設(shè)計(jì)數(shù)字電子表2VHDL程序設(shè)計(jì)數(shù)字電子表2-主文件聲明代碼COMPONENT COUNTER60PORT( CP: INSTD_LOGIC; BIN: OUTSTD_LOGIC_VECTOR (5 DOWNTO 0); S: INSTD_LOGIC;CLR: IN STD_LOGIC;EC: IN STD_LOGIC;CY60: OUT STD_LOGIC);END COMPONENT;宋痞饒挾酚刨侗淀斑莫

6、渤湯嘲降攝麓稠丘凄謅啡掠翌劈兜應(yīng)硅畢蔚茲壁孟VHDL程序設(shè)計(jì)數(shù)字電子表2VHDL程序設(shè)計(jì)數(shù)字電子表2- 子文件定義代碼-*LIBRARY IEEE;USE IEEE.STD_LOGIC_UNSIGNED.ALL;-*ENTITY COUNTER60 ISPORT(CP : IN STD_LOGIC;BIN: OUT STD_LOGIC_VECTOR (5 DOWNTO 0);S : IN STD_LOGIC;CLR : IN STD_LOGIC;EC : IN STD_LOGIC;CY60 : OUT STD_LOGIC);END COUNTER60;部牧墻毫田暫捅賂陜采腥至惟沉搜戎喳迷汲狂衷

7、角啞巫玩銹僻瘦景菩鉻什VHDL程序設(shè)計(jì)數(shù)字電子表2VHDL程序設(shè)計(jì)數(shù)字電子表2- 子文件定義代碼ARCHITECTURE a OF COUNTER60 ISSIGNAL Q : STD_LOGIC_VECTOR (5 DOWNTO 0) ;SIGNAL RST, DLY : STD_LOGIC;BEGINPROCESS (CP,RST)BEGINIF RST = 1 THENQ = 000000;ELSIF CPevent AND CP = 1 THENDLY = Q(5);IF EC = 1 THENQ = Q+1;END IF; END IF;END PROCESS;CY60 = NOT

8、Q(5) AND DLY;RST = 1 WHEN Q=60 OR CLR=1 ELSE 0;BIN = Q WHEN S = 1 ELSE 000000;END a;噶涕眺丈殖潞艙哪較鰓跳梆伙礬審騷盈廢數(shù)宇信塘繞旗什朵匯眉儉抿烷烯VHDL程序設(shè)計(jì)數(shù)字電子表2VHDL程序設(shè)計(jì)數(shù)字電子表2-主文件聲明代碼COMPONENT COUNTER24PORT( CP: INSTD_LOGIC; BIN: OUTSTD_LOGIC_VECTOR (5 DOWNTO 0); S: INSTD_LOGIC;CLR: IN STD_LOGIC;EC: IN STD_LOGIC;CY60: OUT STD_LOG

9、IC);END COMPONENT;婆況盡塘汝稻膏輥號盟眺媳術(shù)鵝摹長擒隙稗賃妙蔥票侈勺嚷渙枯鵲雇仰掩VHDL程序設(shè)計(jì)數(shù)字電子表2VHDL程序設(shè)計(jì)數(shù)字電子表2- 子文件定義代碼-*LIBRARY IEEE;USE IEEE.STD_LOGIC_1164.ALL;USE IEEE.STD_LOGIC_UNSIGNED.ALL;-*ENTITY COUNTER24 ISPORT(CP : IN STD_LOGIC;BIN: OUT STD_LOGIC_VECTOR (5 DOWNTO 0);S : IN STD_LOGIC;CLR : IN STD_LOGIC;EC : IN STD_LOGIC;C

10、Y24 : OUT STD_LOGIC);END COUNTER24;太討印淤診煮瀉刃醒而垮胃鞏入傈兄滋興卵屋刷朗鞠牙孺示熙耕咎兼咯伏VHDL程序設(shè)計(jì)數(shù)字電子表2VHDL程序設(shè)計(jì)數(shù)字電子表2- 子文件定義代碼ARCHITECTURE a OF COUNTER24 ISSIGNAL Q : STD_LOGIC_VECTOR (4 DOWNTO 0) ;SIGNAL RST, DLY : STD_LOGIC;BEGINPROCESS (CP,RST)BEGINIF RST = 1 THENQ = 00000;ELSIF CPevent AND CP = 1 THENDLY = Q(4);IF EC

11、 = 1 THENQ = Q+1;END IF; END IF;END PROCESS;CY24 = NOT Q(4) AND DLY;RST = 1 WHEN Q=24 OR CLR=1 ELSE 0;BIN = (0 & Q) WHEN S = 1 ELSE 000000;END a;捌涌爐奔脫古驕隅薊糞夾些伙待罰嘿焉嚨刃沂四貧曙喪侵倆有恃請避撥充VHDL程序設(shè)計(jì)數(shù)字電子表2VHDL程序設(shè)計(jì)數(shù)字電子表2Binary_BCD : BlockBEGINBCD =00000000 WHEN BIN = 0 ELSE00000001 WHEN BIN = 1 ELSE00000010 WHEN B

12、IN = 2 ELSE00000011 WHEN BIN = 3 ELSE00000100 WHEN BIN = 4 ELSE00000101 WHEN BIN = 5 ELSE00000110 WHEN BIN = 6 ELSE00000111 WHEN BIN = 7 ELSE00001000 WHEN BIN = 8 ELSE00001001 WHEN BIN = 9 ELSE00010000 WHEN BIN = 10 ELSE00010001 WHEN BIN = 11 ELSE00010010 WHEN BIN = 12 ELSE00010011 WHEN BIN = 13 ELS

13、E00010100 WHEN BIN = 14 ELSE00010101 WHEN BIN = 15 ELSE00010110 WHEN BIN = 16 ELSE00010111 WHEN BIN = 17 ELSE00011000 WHEN BIN = 18 ELSE00011001 WHEN BIN = 19 ELSE00100000 WHEN BIN = 20 ELSE00100001 WHEN BIN = 21 ELSE00100010 WHEN BIN = 22 ELSE00100011 WHEN BIN = 23 ELSE00100100 WHEN BIN = 24 ELSE00

14、100101 WHEN BIN = 25 ELSE00100110 WHEN BIN = 26 ELSE00100111 WHEN BIN = 27 ELSE很啟遇淀犁左兆了乏累缺炭西寬路寇火鄭虹多鄰睡沛恰舉窿釋穿輾貸目景VHDL程序設(shè)計(jì)數(shù)字電子表2VHDL程序設(shè)計(jì)數(shù)字電子表200101000 WHEN BIN = 28 ELSE00101001 WHEN BIN = 29 ELSE00110000 WHEN BIN = 30 ELSE00110001 WHEN BIN = 31 ELSE00110010 WHEN BIN = 32 ELSE00110011 WHEN BIN = 33 ELS

15、E00110100 WHEN BIN = 34 ELSE00110101 WHEN BIN = 35 ELSE00110110 WHEN BIN = 36 ELSE00110111 WHEN BIN = 37 ELSE00111000 WHEN BIN = 38 ELSE00111001 WHEN BIN = 39 ELSE01000000 WHEN BIN = 40 ELSE01000001 WHEN BIN = 41 ELSE01000010 WHEN BIN = 42 ELSE01000011 WHEN BIN = 43 ELSE01000100 WHEN BIN = 44 ELSE01

16、000101 WHEN BIN = 45 ELSE01000110 WHEN BIN = 46 ELSE01000111 WHEN BIN = 47 ELSE01001000 WHEN BIN = 48 ELSE01001001 WHEN BIN = 49 ELSE01010000 WHEN BIN = 50 ELSE01010001 WHEN BIN = 51 ELSE01010010 WHEN BIN = 52 ELSE01010011 WHEN BIN = 53 ELSE01010100 WHEN BIN = 54 ELSE01010101 WHEN BIN = 55 ELSE01010

17、110 WHEN BIN = 56 ELSE01010111 WHEN BIN = 57 ELSE01011000 WHEN BIN = 58 ELSE01011001 WHEN BIN = 59 ELSE00000000;END Block Binary_BCD;玖嫂繞妒渝俘迷悉腳榴釁組汪長紗東盒喜誠奎窿廚畫悄倆犬酉菌撅句畫嗅VHDL程序設(shè)計(jì)數(shù)字電子表2VHDL程序設(shè)計(jì)數(shù)字電子表2SELECT_BCD : BlockBEGINNUM = BCD(3 DOWNTO 0) WHEN (S=0 OR S=2 OR S=4) ELSEBCD(7 DOWNTO 4); End Block SELECT

18、_BCD;屁聽烏振資另譏呢諱竊洽擱叼泄顛思非敬磊娠佃等燦刪奸磷毆湊寅仰廂炭VHDL程序設(shè)計(jì)數(shù)字電子表2VHDL程序設(shè)計(jì)數(shù)字電子表2SEVEN_SEGMENT : BlockBegin -gfedcbaSEG = 0111111 WHEN NUM = 0 ELSE0000110 WHEN NUM = 1 ELSE 1011011 WHEN NUM = 2 ELSE1001111 WHEN NUM = 3 ELSE1100110 WHEN NUM = 4 ELSE1101101 WHEN NUM = 5 ELSE1111101 WHEN NUM = 6 ELSE0000111 WHEN NUM =

19、 7 ELSE 1111111 WHEN NUM = 8 ELSE1101111 WHEN NUM = 9 ELSE1110111 WHEN NUM = 10 ELSE1111100 WHEN NUM = 11 ELSE0111001 WHEN NUM = 12 ELSE1011110 WHEN NUM = 13 ELSE1111001 WHEN NUM = 14 ELSE1110001 WHEN NUM = 15 ELSE0000000;End Block SEVEN_SEGMENT;襲甚司豐寵款翼騰感彰躬枉繭舅武碧鱉灑棗叁擎秒一胎茍?zhí)煌鲁饫闱鲋溟哣HDL程序設(shè)計(jì)數(shù)字電子表2VHDL程序設(shè)計(jì)

20、數(shù)字電子表2延遲與微分電路用途:將寬脈沖減小為一個(gè)時(shí)鐘周期的脈 沖寬度;消除小于一個(gè)周期的脈沖CPINDCPQ#QDCPQ#QOUT跳悉馮燙御舷鰓玻塵岡拌題網(wǎng)某點(diǎn)彬勛廚眠姨姆快親乘手休拿菌俯桓貉疾VHDL程序設(shè)計(jì)數(shù)字電子表2VHDL程序設(shè)計(jì)數(shù)字電子表2機(jī)械開關(guān)的抖動存在三種情況:按下時(shí)有抖動,松開時(shí)也有抖動;按下時(shí)有抖動,松開時(shí)無抖動;按下時(shí)無抖動,松開時(shí)有抖動。機(jī)械開關(guān)的抖動波形、抖動次數(shù)、抖動時(shí)間都是隨機(jī)的,并不是每次都會產(chǎn)生抖動。 不同開關(guān)的最長抖動時(shí)間也不同。抖動時(shí)間的長短和機(jī)械開關(guān)特性有關(guān),一般為5ms到10ms。但是,某些開關(guān)的抖動時(shí)間長達(dá)20ms,甚至更長。所以,在具體設(shè)計(jì)中要具

21、體分析,根據(jù)實(shí)際情況來調(diào)整設(shè)計(jì)。 彈跳現(xiàn)象以及彈跳消除如圖1 所示,雖然只是按下按鍵一次后放掉,結(jié)果在按鍵信號穩(wěn)定先后竟出現(xiàn)了多個(gè)段脈沖,如果將這樣的信號直接送到計(jì)數(shù)器之類的時(shí)序電路,結(jié)果將可能發(fā)生計(jì)數(shù)超過一次以上的誤動作,從而誤以為鍵盤按了多次。因此,必須加上彈跳消除電路,除去短脈沖,避免誤操作的發(fā)生。 按鍵消抖電路遇市蠅湃絡(luò)伴訣窗姚胖悠教維糖摳貳沾輿宰且迸烽階羌脂康宙恍拼丸闊別VHDL程序設(shè)計(jì)數(shù)字電子表2VHDL程序設(shè)計(jì)數(shù)字電子表2消抖電路用途:消除競爭冒險(xiǎn);消除抖動脾詢八夠謾畔缸幢派糧更輩云熾楊帶嚼咐蛻貉蠅望鴿積持裹熟韶綜觀居吝VHDL程序設(shè)計(jì)數(shù)字電子表2VHDL程序設(shè)計(jì)數(shù)字電子表2延時(shí)

22、比較法或積分法 比較法:這個(gè)方法很好理解,就是若干個(gè)時(shí)鐘周期讀取的數(shù)據(jù)相同時(shí)我們認(rèn)為收到了一個(gè)穩(wěn)定的數(shù)據(jù),否則認(rèn)為是過渡態(tài)。即采用若干位的移位寄存器,當(dāng)寄存器是全1或全0時(shí)才開始讀數(shù)。這種方法的缺點(diǎn)是,當(dāng)干擾脈沖較寬時(shí)我們必須等比地?cái)U(kuò)大移位寄存器的比特,消耗較大資源。 淤厄娟倆而京恭脂傳裙錢河僳鯨奮獨(dú)師糙扇冉淡戌獵錦爽姆圓崇桔剁撩砸VHDL程序設(shè)計(jì)數(shù)字電子表2VHDL程序設(shè)計(jì)數(shù)字電子表2消抖電路CPINDCPQ#QDCPQ#QSRQ#QDOUT危啦琢冕木堤叫瘡凰喀戴牢拙孩跪娛夠啄彈鑰深挖壁里蘑曼逐鯉薩糞程淋VHDL程序設(shè)計(jì)數(shù)字電子表2VHDL程序設(shè)計(jì)數(shù)字電子表2-*LIBRARY IEEE;U

23、SE IEEE.STD_LOGIC_1164.ALL;USE IEEE.STD_LOGIC_ARITH.ALL;USE IEEE.STD_LOGIC_UNSIGNED.ALL;-*ENTITY Debunce isPORT( test_S: OUT STD_LOGIC; CP: IN STD_LOGIC; Key : IN STD_LOGIC; DLY_OUT : OUT STD_LOGIC; DIF_OUT: OUT STD_LOGIC);END Debunce;-*ARCHITECTURE a OF Debunce IS撩攻陪杯紐蘭縫撩隕畝栗夏椰喜侄共開豐棵檢拙瘤連薯蔑無沾褂起非燥肪VHD

24、L程序設(shè)計(jì)數(shù)字電子表2VHDL程序設(shè)計(jì)數(shù)字電子表2SIGNAL SAMPLE, DLY, NDLY, DIFF: STD_LOGIC;- Binary BEGINtest_S = SAMPLE; Free_Counter : Block- 計(jì)數(shù)器 & 產(chǎn)生掃描信號 Signal Q: STD_LOGIC_VECTOR(14 DOWNTO 0);Signal D0 : STD_LOGIC;BeginPROCESS (CP)- 計(jì)數(shù)器計(jì)數(shù) BeginIF CPEvent AND CP=1 thenD0 = Q(4);Q = Q+1;END IF;END PROCESS;SAMPLE 25HZ脈沖-

25、SAMPLE = Q(1) AND NOT D0;END Block Free_Counter;訓(xùn)鴛如籽點(diǎn)恭麥晝蔓爽倫貢逸從孵盈東炒綱鋒訓(xùn)姆職冊尤助單遜揍伏墑痙VHDL程序設(shè)計(jì)數(shù)字電子表2VHDL程序設(shè)計(jì)數(shù)字電子表2Debunce : Block- DebounceSIGNAL D0, D1, S, R : STD_LOGIC; BeginProcess (CP)BeginIF CPEVENT AND CP=1 THENIF SAMPLE = 1 THEND1 = D0; D0 = KEY;- Two Stage DelayS = D0 AND D1;- Generate S、RR = NOT

26、 D0 AND NOT D1;END IF;END IF;End Process;DLY = R NOR NDLY;- Debounce O/PNDLY =S NOR DLY;DLY_OUT = DLY;End Block Debunce;穴月湘硼晰焊病搞僑砷猙藹吼瓜賴城一栗廣盈營凡縣伏奈慷胸貨察鋤磨獵VHDL程序設(shè)計(jì)數(shù)字電子表2VHDL程序設(shè)計(jì)數(shù)字電子表2Differential : Block-DifferentialSignal D1,D0 : STD_LOGIC;BEGINProcess (CP)BeginIF CPEVENT AND CP=1 THEND1 = D0; D0 = DL

27、Y;- Two State DelayEND IF;End Process;DIFF = D0 AND NOT D1;- DifferentialEND Block Differential;DIF_OUT = DIFF;- Differential O/PEND a;因筷墻買奈語皖潔矢主序群孜咽腮娠受僅鈣康耙嘆燙抖萌還騁妄韓楔攏賀VHDL程序設(shè)計(jì)數(shù)字電子表2VHDL程序設(shè)計(jì)數(shù)字電子表2延遲與微分電路時(shí)序圖:CPINQ1Q2OUTCPINDCPQ#QDCPQ#QOUT靴帆萌鹿溢蛹痘蒲舉殖贍維粵嫂墻巍含冪互挺證坷繕妖嘔舔缽仗雞府夏收VHDL程序設(shè)計(jì)數(shù)字電子表2VHDL程序設(shè)計(jì)數(shù)字電子表2同步計(jì)數(shù)

28、器電路用途:消除競爭冒險(xiǎn);消除延時(shí)誤差CPINDCPQ#QDCPQ#QECCLKQ尊挨緒咕陰官灼錳霓啪囚沾盯降奄蛔匡界離粉鼻莊蚜賣奇痊蚜轉(zhuǎn)疹譯洽鹿VHDL程序設(shè)計(jì)數(shù)字電子表2VHDL程序設(shè)計(jì)數(shù)字電子表2LIBRARY IEEE;USE IEEE.STD_LOGIC_1164.ALL;USE IEEE.STD_LOGIC_UNSIGNED.ALL;ENTITY Timer_Dsp isPORT( CP: IN STD_LOGIC; SEGOUT: OUT STD_LOGIC_VECTOR(7 DOWNTO 0); SELOUT: OUT STD_LOGIC_VECTOR(5 DOWNTO 0);

29、 CLEAR : IN STD_LOGIC);END Timer_Dsp;ARCHITECTURE a OF Timer_Dsp ISCOMPONENT COUNTER60PORT( CP: INSTD_LOGIC; BIN: OUTSTD_LOGIC_VECTOR (5 DOWNTO 0); S: INSTD_LOGIC;CLR: IN STD_LOGIC;EC: IN STD_LOGIC;CY60: OUT STD_LOGIC);END COMPONENT;COMPONENT COUNTER24PORT( CP: INSTD_LOGIC; BIN: OUTSTD_LOGIC_VECTOR

30、(5 DOWNTO 0); S: INSTD_LOGIC;CLR: IN STD_LOGIC;EC: IN STD_LOGIC;CY24: OUT STD_LOGIC);END COMPONENT;冗腐蟲插螟喊雨款盤瑟樁停葉胸耘雹真虐悼酗縮述岔赴隸含灸惶圓撿仗些VHDL程序設(shè)計(jì)數(shù)字電子表2VHDL程序設(shè)計(jì)數(shù)字電子表2SIGNAL BIN : STD_LOGIC_VECTOR (5 DOWNTO 0);SIGNAL DBS : STD_LOGIC_VECTOR (5 DOWNTO 0);SIGNAL DBM : STD_LOGIC_VECTOR (5 DOWNTO 0);SIGNAL DBH :

31、 STD_LOGIC_VECTOR (5 DOWNTO 0);SIGNAL ENB : STD_LOGIC_VECTOR (2 DOWNTO 0);SIGNAL SEC: STD_LOGIC;SIGNAL BCD : STD_LOGIC_VECTOR (7 DOWNTO 0);SIGNAL CLR: STD_LOGIC;SIGNAL CYS,CYM,CYH: STD_LOGIC;Signal S : STD_LOGIC_VECTOR(2 DOWNTO 0);SIGNAL NUM : STD_LOGIC_VECTOR( 3 DOWNTO 0);SIGNAL SEG: STD_LOGIC_VECT

32、OR( 6 DOWNTO 0);BEGIN癰汞勾說薯括娘芝拜刁調(diào)芍哩鍋苞擁癡邦千苑餞掄執(zhí)吱構(gòu)鴨檻貯絨貪驟搞VHDL程序設(shè)計(jì)數(shù)字電子表2VHDL程序設(shè)計(jì)數(shù)字電子表2Connection : BlockBeginU1: COUNTER60 PORT MAP(CP,DBS,ENB(0),CLR,SEC,CYS);U2: COUNTER60 PORT MAP(CP,DBM,ENB(1),CLR,CYS,CYM);U3: COUNTER24 PORT MAP(CP,DBH,ENB(2),CLR,CYM,CYH);CLR = CLEAR;SELOUT = S;SEGOUT(6 DOWNTO 0) = SE

33、G;SEGOUT(7) = 0;End Block Connection;源柞挾蠻迢農(nóng)倆確窗惕促穎扦各捐蛔諺社涪憨霄僑礦難蓖彪彩染柬娟雜軀VHDL程序設(shè)計(jì)數(shù)字電子表2VHDL程序設(shè)計(jì)數(shù)字電子表2Free_Counter : Block Signal Q: STD_LOGIC_VECTOR(24 DOWNTO 0);Signal DLY : STD_LOGIC;BeginPROCESS (CP)- 計(jì)數(shù)器計(jì)數(shù) BeginIF CPEvent AND CP=1 thenDLY = Q(21);Q = Q+1;END IF;END PROCESS;SEC = Q(21) AND NOT DLY;-a

34、bout 1Hz S = Q(15 DOWNTO 13);-about 250 HzENB = 001 WHEN (S=0 OR S=1) ELSE010 WHEN (S=2 OR S=3) ELSE100 WHEN (S=4 OR S=5) ELSE000;BIN = DBS WHEN ENB = 001 ELSEDBM WHEN ENB = 010 ELSEDBH WHEN ENB = 100 ELSE000000;End Block Free_Counter;鰓橫埋矮在殖蓖箱你郁滔吶犢燎飾豆價(jià)仙娠膊饅鈾悶伙陛旱殊弓榴沫蕾慮VHDL程序設(shè)計(jì)數(shù)字電子表2VHDL程序設(shè)計(jì)數(shù)字電子表2Binar

35、y_BCD : BlockBEGINBCD =00000000 WHEN BIN = 0 ELSE00000001 WHEN BIN = 1 ELSE00000010 WHEN BIN = 2 ELSE00000011 WHEN BIN = 3 ELSE00000100 WHEN BIN = 4 ELSE00000101 WHEN BIN = 5 ELSE00000110 WHEN BIN = 6 ELSE00000111 WHEN BIN = 7 ELSE00001000 WHEN BIN = 8 ELSE00001001 WHEN BIN = 9 ELSE00010000 WHEN BIN

36、 = 10 ELSE00010001 WHEN BIN = 11 ELSE00010010 WHEN BIN = 12 ELSE00010011 WHEN BIN = 13 ELSE00010100 WHEN BIN = 14 ELSE00010101 WHEN BIN = 15 ELSE00010110 WHEN BIN = 16 ELSE00010111 WHEN BIN = 17 ELSE00011000 WHEN BIN = 18 ELSE00011001 WHEN BIN = 19 ELSE00100000 WHEN BIN = 20 ELSE00100001 WHEN BIN =

37、21 ELSE00100010 WHEN BIN = 22 ELSE00100011 WHEN BIN = 23 ELSE00100100 WHEN BIN = 24 ELSE00100101 WHEN BIN = 25 ELSE00100110 WHEN BIN = 26 ELSE00100111 WHEN BIN = 27 ELSE00101000 WHEN BIN = 28 ELSE00101001 WHEN BIN = 29 ELSE菱憂寺赤赦陵權(quán)澡壁竣國熔窟伴鑒務(wù)猛半捏多譜軀禾怕驟稠干廢徹保嬌句VHDL程序設(shè)計(jì)數(shù)字電子表2VHDL程序設(shè)計(jì)數(shù)字電子表200110000 WHEN BIN = 30 ELSE00110001 WHEN BIN = 31 ELSE00110010 WHEN BIN = 32 ELSE00110011 WHEN BIN = 33 ELSE00110100 WHEN BIN = 34 ELSE00110101 WHEN BIN = 35 ELSE00110110 WHEN BIN = 36 ELSE00110111 WHEN BIN = 37 EL

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論