版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、 實(shí)驗(yàn)五 數(shù)字時(shí)鐘的設(shè)計(jì)實(shí)驗(yàn)性質(zhì):綜合性 實(shí)驗(yàn)級(jí)別: 開(kāi)課單位:信息與通信工程學(xué)院通信工程系 學(xué)時(shí):4學(xué)時(shí)一、實(shí)驗(yàn)?zāi)康模?、學(xué)習(xí)用VHDL語(yǔ)言實(shí)現(xiàn)比較大型的電路的方法。 2、繼續(xù)鞏固cpld技術(shù)層次化設(shè)計(jì)方法。二、實(shí)驗(yàn)器材:計(jì)算機(jī)、Quartus II軟件三、實(shí)驗(yàn)內(nèi)容:設(shè)計(jì)一數(shù)字時(shí)鐘,要求具有時(shí)、分、秒、計(jì)數(shù)顯示功能,以24小時(shí)循環(huán)計(jì)時(shí);具有清零,調(diào)節(jié)小時(shí),分鐘功能;具有整點(diǎn)報(bào)時(shí)功能。四、實(shí)驗(yàn)步驟:1、根據(jù)電路特點(diǎn),用層次設(shè)計(jì)的概念,將此任務(wù)分成若干模塊,規(guī)定每一模塊的功能和各模塊之間的接口。讓幾個(gè)學(xué)生分作和調(diào)試其中之一,然后再將各模塊合起來(lái)聯(lián)試。以培養(yǎng)學(xué)生之間的合作精神,同時(shí)加深層次化設(shè)計(jì)概
2、念。2、了解軟件的元件管理深層含義,以及模塊元件之間的連接概念,對(duì)于不同目錄下的同一設(shè)計(jì),如何融合。3、模塊說(shuō)明: 各種進(jìn)制的計(jì)數(shù)及時(shí)鐘控制模塊(10進(jìn)制、6進(jìn)制、24進(jìn)制) 掃描分時(shí)顯示,譯碼模塊 各模塊都用VHDL語(yǔ)言編寫(xiě)五、實(shí)驗(yàn)?zāi)K:秒模塊LIBRARY ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;ENTITY second ISPORT(clk, reset,setmin : INSTD_LOGIC;enmin : OUTSTD_LOGIC;da0out: out std_logic_vector (
3、6 downto 0);END entity second;ARCHITECTURE fun OF second ISSIGNAL count: STD_LOGIC_VECTOR( 6 downto 0);BEGIN da0out = count; process ( clk , reset , setmin) begin - enmin=k; if (reset=0) then count = 0000000; elsif (setmin=0) then enmin = clk; elsif (clk event and clk=1) then if (count(3 downto 0)=1
4、001) then if (count 16#60#) then if (count=1011001) then enmin=1; count=0000000; ELSE count=count+7; end if; else count=0000000; end if; elsif (count 16#60#) then count = count+1; enmin=0 after 100 ns; else count=0000000; end if; end if; end process;END fun;分析: 脈沖從0計(jì)數(shù)至59,向前進(jìn)1,enmin由低電平變至高電平。分模塊LIBRA
5、RY ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;ENTITY minute ISPORT(clk, reset,sethour : INSTD_LOGIC;enhour : OUTSTD_LOGIC;da1out: out std_logic_vector (6 downto 0);END entity minute;ARCHITECTURE fun OF minute ISSIGNAL count: STD_LOGIC_VECTOR( 6 downto 0);BEGIN da1out = count; p
6、rocess ( clk , reset , sethour) begin - enmin=k; if (reset=0) then count = 0000000; elsif (sethour=0) then enhour = clk; elsif (clk event and clk=1) then if (count(3 downto 0)=1001) then if (count 16#60#) then if (count=1011001) then enhour=1; count=0000000; ELSE count=count+7; end if; else count=00
7、00000; end if; elsif (count 16#60#) then count = count+1; enhour=0 after 100 ns; else count=0000000; end if; end if; end process;END fun;分析: 脈沖從0計(jì)數(shù)至59,向前進(jìn)1,enhour由低電平變至高電平。時(shí)模塊LIBRARY ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;ENTITY hour ISPORT(clk, reset,setweek : INSTD_LOGIC;
8、enweek : OUTSTD_LOGIC;da2out: out std_logic_vector (6 downto 0);END entity hour ;ARCHITECTURE fun OF hour ISSIGNAL count: STD_LOGIC_VECTOR( 6 downto 0);BEGIN da2out = count; process ( clk , reset , setweek) begin - enmin=k; if (reset=0) then count = 0000000; elsif (setweek=0) then enweek = clk; elsi
9、f (clk event and clk=1) then if (count(3 downto 0)=1001) then if (count 16#23#) then if (count=00100011) then enweek=1; count=0000000; ELSE count=count+7; end if; else count=0000000; end if; elsif (count 16#23#) then count = count+1; enweek=0 after 100 ns; else countyyyyyyyyyyyyyyyyyyyyyy=0000000; e
10、nd case; end process; end beh;分析: 將8421BCD碼轉(zhuǎn)化成7段碼。 整點(diǎn)報(bào)時(shí)library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity speaker is port(clk:in std_logic; speaksec:in std_logic_vector(6 downto 0); speakmin:in std_logic_vector(6 downto 0); speak:out std_logic);end entity speaker;archite
11、cture fun of speaker isbeginprocess(clk,speakmin)begin if(clk event and clk=1)then if(speakmin=0000000 and speaksec=0000000)then speak=1;else speak=0;end if; end if;end process;end fun;分析: 當(dāng)時(shí)鐘計(jì)數(shù)到整點(diǎn),即秒和分都等于0時(shí)蜂鳴器報(bào)警,以實(shí)現(xiàn)整點(diǎn)報(bào)時(shí)功能。輸入:clk計(jì)數(shù)時(shí)鐘信號(hào),speaksec秒輸出信號(hào),speakmin分輸出信號(hào)輸出:報(bào)警信號(hào)輸出轉(zhuǎn)換模塊六轉(zhuǎn)一library IEEE;use IEEE
12、.STD_LOGIC_1164.ALL;use IEEE.STD_LOGIC_ARITH.ALL;use IEEE.STD_LOGIC_UNSIGNED.ALL;- Uncomment the following lines to use the declarations that are- provided for instantiating Xilinx primitive components.-library UNISIM;-use UNISIM.VComponents.all;entity sixtozero is Port ( d:in std_logic_vector(6 dow
13、nto 0); out6 : out std_logic; out5 : out std_logic; out4 : out std_logic; out3 : out std_logic; out2 : out std_logic; out1 : out std_logic; out0 : out std_logic); end sixtozero;architecture Behavioral of sixtozero isbeginprocess(d)Beginout6=d(6);out5=d(5); out4=d(4); out3=d(3); out2=d(2); out1=d(1);
14、 out0=d(0);end process;end Behavioral;二轉(zhuǎn)一library IEEE;use IEEE.STD_LOGIC_1164.ALL;use IEEE.STD_LOGIC_ARITH.ALL;use IEEE.STD_LOGIC_UNSIGNED.ALL;- Uncomment the following lines to use the declarations that are- provided for instantiating Xilinx primitive components.-library UNISIM;-use UNISIM.VCompone
15、nts.all;entity twotozero is Port ( d:in std_logic_vector(2 downto 0); out2 : out std_logic; out1 : out std_logic; out0 : out std_logic);end twotozero;architecture Behavioral of twotozero isbeginprocess(d)begin out2=d(2); out1=d(1); out0=d(0);end process;end Behavioral;3.三轉(zhuǎn)一library IEEE;use IEEE.STD_
16、LOGIC_1164.ALL;use IEEE.STD_LOGIC_ARITH.ALL;use IEEE.STD_LOGIC_UNSIGNED.ALL;- Uncomment the following lines to use the declarations that are- provided for instantiating Xilinx primitive components.-library UNISIM;-use UNISIM.VComponents.all;entity tretozero is Port ( d:in std_logic_vector(6 downto 0); out3 : out std_logic; out2 : out std_logic; out1 : out std_logic; out0 : out std_logic); end tretozero;architecture Behavioral of
溫馨提示
- 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ù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
- 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ì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025年食堂信息化管理及服務(wù)外包合同5篇
- 2025年度購(gòu)物中心物業(yè)管理員勞動(dòng)合同3篇
- 二零二五版泰康人壽保險(xiǎn)產(chǎn)品推廣合同范本3篇
- 2025年度木工項(xiàng)目投資與建設(shè)合同4篇
- 2025年度定制化木模板木方定制加工及銷售合同4篇
- 印刷材料的科技創(chuàng)新與應(yīng)用考核試卷
- 2025版老舊建筑幕墻改造升級(jí)合同范文4篇
- 2025年醫(yī)療病例管理協(xié)議
- 2025年度美發(fā)店客戶滿意度調(diào)查與服務(wù)提升合同8篇
- 2025年食堂檔口租賃及市場(chǎng)營(yíng)銷合作合同范本3篇
- 電纜擠塑操作手冊(cè)
- 浙江寧波鄞州區(qū)市級(jí)名校2025屆中考生物全真模擬試卷含解析
- IATF16949基礎(chǔ)知識(shí)培訓(xùn)教材
- 【MOOC】大學(xué)生創(chuàng)新創(chuàng)業(yè)知能訓(xùn)練與指導(dǎo)-西北農(nóng)林科技大學(xué) 中國(guó)大學(xué)慕課MOOC答案
- 勞務(wù)派遣公司員工考核方案
- 基礎(chǔ)生態(tài)學(xué)-7種內(nèi)種間關(guān)系
- 2024年光伏農(nóng)田出租合同范本
- 《阻燃材料與技術(shù)》課件 第3講 阻燃基本理論
- 2024-2030年中國(guó)黃鱔市市場(chǎng)供需現(xiàn)狀與營(yíng)銷渠道分析報(bào)告
- 新人教版九年級(jí)化學(xué)第三單元復(fù)習(xí)課件
- 江蘇省南京鼓樓區(qū)2024年中考聯(lián)考英語(yǔ)試題含答案
評(píng)論
0/150
提交評(píng)論