版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、計(jì)數(shù)顯示電路設(shè)計(jì)一 設(shè)計(jì)要求設(shè)計(jì)輸出為3位BCD碼的計(jì)數(shù)顯示電路。由三個(gè)模塊構(gòu)成:十進(jìn)制計(jì)數(shù)器(BCD_CNT)、分時(shí)總線切換電路(SCAN)和七段顯示譯碼器電路(DEC_LED)。BCD碼計(jì)數(shù)電路從0計(jì)到9然后返回到0從新計(jì)數(shù)。3位BCD碼計(jì)數(shù)器可以實(shí)現(xiàn)從0到999的十進(jìn)制計(jì)數(shù)。要將計(jì)數(shù)過程用七段顯示LED數(shù)碼管顯示出來,這里采用動(dòng)態(tài)分時(shí)總線切換電路對(duì)數(shù)碼管進(jìn)行掃描,對(duì)數(shù)碼管依次分時(shí)選中進(jìn)行輸出計(jì)數(shù)的個(gè)、十、百位的數(shù)據(jù)??驁D如圖1:圖1二 設(shè)計(jì)思路圖2是源程序的RTL級(jí)電路圖。整個(gè)設(shè)計(jì)分十進(jìn)制計(jì)數(shù)器模塊(BCD_CNT)、分時(shí)總線切換電路模塊(SCAN)和七段顯示譯碼器電路模塊(DEC_LE
2、D)構(gòu)成??偟妮斎霝槭M(jìn)制計(jì)數(shù)器時(shí)鐘clk,異步復(fù)位清零信號(hào)reset,分時(shí)總線切換電路時(shí)鐘CL。在reset信號(hào)為0期間,在每個(gè)clk的上升沿計(jì)數(shù)器將加1。在每個(gè)cl的上升沿將會(huì)改變對(duì)三個(gè)數(shù)碼管的掃描選通??偟妮敵鰹閿?shù)碼管選通信號(hào)sel(三位),輸出到七段數(shù)碼管的數(shù)據(jù)信號(hào)ledout(七位)。圖2為了檢驗(yàn)系統(tǒng)的正確與否,這里還添加了四個(gè)輸出:十進(jìn)制計(jì)數(shù)器輸出c1(四位)、c2(四位)、c3(四位),分時(shí)總線切換電路一個(gè)輸出q(四位),它是對(duì)計(jì)數(shù)器輸出c1、c2、c3進(jìn)行分時(shí)輸出。分時(shí)選通個(gè)、十、百位的數(shù)碼管并將相應(yīng)要顯示的數(shù)據(jù)輸出到七段顯示譯碼器電路(DEC_LED),由此實(shí)現(xiàn)數(shù)碼管的動(dòng)態(tài)掃
3、描顯示。三 VHDL源代碼(1)頂層模塊:library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_arith.all;use ieee.std_logic_unsigned.all;entity top isport(clk,reset:in std_logic; CL:in std_logic; c1,c2,c3:out std_logic_vector(3 downto 0); ledout:out std_logic_vector(6 downto 0); q:out std_logic_vector(3 downto 0)
4、; sel:out std_logic_vector(2 downto 0);end top;architecture content of top issignal c1_1,c2_1,c3_1:std_logic_vector(3 downto 0);signal q_1:std_logic_vector(3 downto 0);component BCD_CNT is port(clk,reset:in std_logic; c1,c2,c3:out std_logic_vector(3 downto 0);end component;component SCAN isport( c1,
5、c2,c3:in std_logic_vector(3 downto 0); CL:in std_logic; q:out std_logic_vector(3 downto 0); sel:out std_logic_vector(2 downto 0);end component;component DEC_LED isport( q:in std_logic_vector(3 downto 0); ledout:out std_logic_vector(6 downto 0);end component;beginu1: BCD_CNT port map (clk,reset,c1_1,
6、c2_1,c3_1); u2: SCAN port map(c1_1,c2_1,c3_1,CL,q_1,sel); u3: DEC_LED port map(q_1,ledout);c1=c1_1;c2=c2_1;c3=c3_1;q =q_1; end content;(2)十進(jìn)制計(jì)數(shù)器電路(BCD_CNT)模塊:library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_arith.all;use ieee.std_logic_unsigned.all;entity BCD_CNT is port(clk,reset:in std_
7、logic; c1,c2,c3:out std_logic_vector(3 downto 0);end BCD_CNT;architecture cnt of BCD_CNT issignal cn1,cn2,cn3:std_logic_vector(3 downto 0); begin cnt1:process(clk,reset) begin if(reset=1) then cn1=0000; elsif(clkevent and clk=1) then if(cn19) then cn1=cn1+1; else cn1=0000; end if; end if; end proces
8、s cnt1; c1=cn1; cnt2:process(cn1(3),reset) begin if(reset=1) then cn2=0000; elsif(cn1(3)event and cn1(3)=0) then if(cn29) then cn2=cn2+1; else cn2=0000; end if; end if; end process cnt2; c2=cn2; cnt3:process(cn2(3),reset) begin if(reset=1) then cn3=0000; elsif(cn2(3)event and cn2(3)=0) then if(cn39)
9、 then cn3=cn3+1; else cn3=0000; end if; end if; end process cnt3; c3=cn3; end cnt;(3)分時(shí)總線切換電路(SCAN)模塊:library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_arith.all;use ieee.std_logic_unsigned.all;entity SCAN is port( c1,c2,c3:in std_logic_vector(3 downto 0); cl:in std_logic; q:out std_logic_
10、vector(3 downto 0); sel:out std_logic_vector(2 downto 0); end SCAN;architecture one of SCAN issignal cnt:std_logic_vector(1 downto 0);signal q_temp:std_logic_vector(3 downto 0);signal sel_temp:std_logic_vector(2 downto 0); beginp1:process(cl)begin if(clevent and cl=1) then if(cnt2) then cnt=cnt+1; else cnt q_temp=c1; sel_temp q_temp=c2; sel_temp q_temp=c3; sel_temp null; end case; end process p2; q=q_temp; sel ledout ledout ledout ledout ledout ledout ledout ledout ledout ledout null; end case; end process;end one; 四 仿真結(jié)果圖2是電路的總體輸入輸出仿真波形。圖3五、結(jié)果分析由圖3可以看出,當(dāng)掃描頻率CL很大的時(shí)候,sel
溫馨提示
- 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ì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 五保供養(yǎng)培訓(xùn)課件
- 2026年劇本殺運(yùn)營(yíng)公司行業(yè)規(guī)范遵守管理制度
- 幼兒園開展戶外游戲活動(dòng)促進(jìn)兒童社交能力發(fā)展課題報(bào)告教學(xué)研究課題報(bào)告
- 2026年無人駕駛汽車安全報(bào)告
- 2025年社區(qū)養(yǎng)老服務(wù)培訓(xùn)基地建設(shè)與養(yǎng)老行業(yè)人才培養(yǎng)機(jī)制可行性研究報(bào)告
- 2026年醫(yī)療物聯(lián)網(wǎng)技術(shù)應(yīng)用報(bào)告
- 普通高中課程方案和課程標(biāo)準(zhǔn)變化的時(shí)代價(jià)值與教師應(yīng)對(duì)
- 眼巢護(hù)理基礎(chǔ)理論培訓(xùn)
- 2026及未來5年中國(guó)智能化工程行業(yè)市場(chǎng)動(dòng)態(tài)分析及發(fā)展趨向研判報(bào)告
- 2025年韓國(guó)金融科技監(jiān)管政策變化分析報(bào)告
- 人教版數(shù)學(xué)四年級(jí)上冊(cè)期末測(cè)試卷及答案 (共八套)-2
- 淮安市2022-2023學(xué)年七年級(jí)上學(xué)期期末道德與法治試題【帶答案】
- 大轉(zhuǎn)爐氧槍橡膠軟管和金屬軟管性能比較
- 四川省內(nèi)江市2023-2024學(xué)年高二上學(xué)期期末檢測(cè)生物試題
- 02-廢氣收集系統(tǒng)-風(fēng)管設(shè)計(jì)課件
- 2022ABBUMC100.3智能電機(jī)控制器
- 天津東疆我工作圖0718
- GB/T 19367-2022人造板的尺寸測(cè)定
- 北京春季化學(xué)會(huì)考試卷及答案
- 數(shù)學(xué)建模插值與擬合
- GB/T 34528-2017氣瓶集束裝置充裝規(guī)定
評(píng)論
0/150
提交評(píng)論