EDA課程設(shè)計--數(shù)字頻率計(共15頁)_第1頁
EDA課程設(shè)計--數(shù)字頻率計(共15頁)_第2頁
EDA課程設(shè)計--數(shù)字頻率計(共15頁)_第3頁
EDA課程設(shè)計--數(shù)字頻率計(共15頁)_第4頁
EDA課程設(shè)計--數(shù)字頻率計(共15頁)_第5頁
已閱讀5頁,還剩11頁未讀, 繼續(xù)免費閱讀

下載本文檔

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

文檔簡介

1、 EDA數(shù)字頻率計 課程設(shè)計報告專 業(yè): 電子信息工程 班 級: 08電信 姓 名: 劉冰 學(xué) 號: F 指導(dǎo)教師: 任蘋 年 月 日 一 課程設(shè)計目的1)課程設(shè)計題:數(shù)字頻率計2)任務(wù)及要求1、設(shè)計一個能測量方波信號的頻率的頻率計。2、測量的頻率范圍是0Hz。3、結(jié)果用十進(jìn)制數(shù)顯示。4、按要求寫好設(shè)計報告(設(shè)計報告內(nèi)容包括:引言,方案設(shè)計與論證,總體設(shè)計,各模塊設(shè)計,調(diào)試與數(shù)據(jù)分析,總結(jié))。3)教學(xué)提示1、脈沖信號的頻率就是在單位時間內(nèi)所產(chǎn)生的脈沖個數(shù),其表達(dá)式為,f為被測信號的頻率,N為計數(shù)器所累計的脈沖個數(shù),T為產(chǎn)生N個脈沖所需的時間。所以,在1秒時間內(nèi)計數(shù)器所記錄的結(jié)果,就是被測信號的

2、頻率。2、被測頻率信號取自實驗箱晶體振蕩器輸出信號,加到主控門的輸入端。3、再取晶體振蕩器的另一標(biāo)準(zhǔn)頻率信號,經(jīng)分頻后產(chǎn)生各種時基脈沖:1ms,10ms,0.1s,1s等,時基信號的選擇可以控制,即量程可以改變。4、時基信號經(jīng)控制電路產(chǎn)生閘門信號至主控門,只有在閘門信號采樣期間內(nèi)(時基信號的一個周期),輸入信號才通過主控門。5f=N/T,改變時基信號的周期T,即可得到不同的測頻范圍。5、 當(dāng)主控門關(guān)閉時,計數(shù)器停止計數(shù),顯示器顯示記錄結(jié)果,此時控制電路輸出一個置零信號,將計數(shù)器和所有觸發(fā)器復(fù)位,為新的一次采樣做好準(zhǔn)備。6、 改變量程時,小數(shù)點能自動移位。4)設(shè)計報告要求1、說明設(shè)計作品的功能、

3、特點、應(yīng)用范圍;2、方案對比,確定方案。3、電路工作原理、操作方法;4、編程方法、程序框圖及關(guān)鍵程序清單。5、課程設(shè)計總結(jié)。數(shù)字頻率計是計算機(jī)、通訊設(shè)備、音頻視頻等科研生產(chǎn)領(lǐng)域不可缺少的測量儀器。它是一種用十進(jìn)制數(shù)字,顯示被測信號頻率的數(shù)字測量儀器。它的基本功能是測量正弦信號,方波信號以及其他各種單位時間內(nèi)變化的物理量。在進(jìn)行模擬、數(shù)字電路的設(shè)計、安裝、調(diào)試過程中,由于其使用十進(jìn)制數(shù)顯示,測量迅速,精度高,顯示直觀,所以經(jīng)常要用到數(shù)字頻率計。二、設(shè)計方案論證、結(jié)果以及分析1 原理圖編譯成功后其波形圖如下:2、信號發(fā)生器library ieee;use ieee.std_logic_1164.a

4、ll;use ieee.std_logic_unsigned.all;entity sele is port(clk: in std_logic; jian: in std_logic_vector(1 downto 0); oclk: out std_logic);end;architecture s_1 of sele issignal full : std_logic;signal t :integer range 0 to ; beginP1:process(jian,t) begin case jian is when 00 = t t t t null; end case;end

5、process P1;P2: process(clk,t) variable s : integer range 0 to ; begin if (clkevent and clk = 1) then if s t then s := s +1; else s := 0 ; end if; end if; if s = t then full = 1; else full = 0; end if;end process P2;P3: process(full) variable c : std_logic;begin if fullevent and full = 1 then c := no

6、t c; if c = 1 then oclk = 1; else oclk =0; end if; end if; end process P3;end;其仿真波形為:3、 測頻library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity cp is port(clkk: in std_logic; en,rst,load: out std_logic);end;architecture cp_1 of cp is signal div2: std_logic;beginprocess(clkk

7、)begin if(clkkevent and clkk=1) then div2 = not div2; end if;end process;process(clkk,div2)begin if (clkk=0 and div2=0) then rst =1; else rst =0; end if;end process;load = not div2;en = div2;end;其仿真波形為:4、 計數(shù)器library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity jishu is por

8、t(rst,en,clk: in std_logic; Q: out std_logic_vector(3 downto 0); cout: out std_logic);end;architecture cnt of jishu is signal cnt: std_logic_vector(3 downto 0);beginprocess(rst,en,clk)beginif rst=1 then cnt = 0000;elsif(clkevent and clk=1) and en = 1 then if cnt = 1001 then cnt = 0000; cout = 1; els

9、e cnt = cnt + 1; cout = 0; end if;end if;end process;Q = cnt;end;在源程序中COUT是計數(shù)器的進(jìn)位輸出;Q3.0是計數(shù)器的狀態(tài)輸出;CLK是時鐘輸入端;RST是復(fù)位控制端;當(dāng)RST=1時,Q3.0=0,EN是使能控制輸入端,當(dāng)EN=1時,計數(shù)器計數(shù),當(dāng)EN=0時,計數(shù)器保持狀態(tài)不變。編譯成功后,其仿真波形如下:在項目編譯仿真成功后,將設(shè)計的十進(jìn)制計數(shù)器電路設(shè)置成可調(diào)用的元件jishu.sym用于以下的頂層設(shè)計。5、 16位寄存器library ieee;use ieee.std_logic_1164.all;use ieee.st

10、d_logic_unsigned.all;entity suocun is port(load: in std_logic; din : in std_logic_vector(15 downto 0); dout: out std_logic_vector(15 downto 0);end;architecture suo of suocun is beginprocess(load,din)beginif (loadevent and load=1) then dout = din;end if;end process;end;在源程序中l(wèi)oad是鎖存信號,上升沿觸發(fā);din3.0是寄存器

11、輸入;dout3.0是寄存器輸出。編譯成功后生成元件圖如下圖,以便頂層模塊的調(diào)用。4位寄存器寄存器是在計數(shù)結(jié)束后,利用觸發(fā)器的上升沿吧最新的頻率測量值保存起來,這樣在計數(shù)的過程中可不必一直看數(shù)碼顯示器,顯示器將最終的頻率讀數(shù)定期進(jìn)行更新,其輸出作為動態(tài)掃描電路的輸入。library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity suo is port(load: in std_logic; din : in std_logic_vector(3 downto 0); dout: out std_l

12、ogic_vector(3 downto 0);end;architecture suo_1 of suo is beginprocess(load,din)beginif (loadevent and load=1) then dout bt = 00;q bt = 01;q bt = 10;q bt = 11;q null; end case; case q is when 0000 = sg sg sg sg sg sg sg sg sg sg null; end case;end process P1;P2:process(clk) begin if(clkevent and clk=

13、1) then cnt8 = cnt8 +1; end if;end process P2;end;編譯成功后,其波形圖為:7、 譯碼library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity divid is port(clk50: in std_logic; qlkhz: out std_logic);end;architecture div of divid isbeginK1:process(clk50) variable cout: integer:=0; begin if(clk50

14、event and clk50=1) then cout := cout + 1; if cout = 24999 then qlkhz = 1; elsif cout = 49999 then qlkhz led0 led1 led2 led3 null;end case;end if;end process;end;仿真波形如下:編譯成功后生成元件圖如下圖,以便頂層模塊的調(diào)用。9、 分頻設(shè)計library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_signed.all;entity fp is port( clk : in st

15、d_logic; oclk: out std_logic);end;architecture fp_1 of fp issignal full : std_logic;beginP1: process(clk) variable s : integer range 0 to 99; begin if (clkevent and clk = 1) then if s 99 then s := 0; elsif s = 99 then full = 1; end if; end if;end process P1;P2: process(full) variable c : std_logic;

16、begin if full = 1 then c := not c; if c = 1 then oclk = 1; else oclk =0; end if; end if; end process P2;end;編譯成功后,其波形圖為:三設(shè)計體會通過對EDA技術(shù)這門課程的學(xué)習(xí),心得體會甚多。雖然一開始覺得什么都不懂,但是通過一次次的實驗,我們真的學(xué)到了不少的東西。往往書本上的知識在實際使用或?qū)嶒灂r都應(yīng)該加以修改,使之更適合實際應(yīng)用,也更簡潔。這次EDA課程設(shè)計,使我更加的了解了EDA,VHDL語言和外部設(shè)備的接線。也讓我更加了解了EDA設(shè)計的流程和原理。通過本次設(shè)計,讓我很好的鍛煉了理論聯(lián)

17、系實際,與具體項目、課題相結(jié)合開發(fā)、設(shè)計產(chǎn)品的能力。既讓我們懂得了怎樣把理論應(yīng)用于實際,又讓我們懂得了在實踐中遇到的問題怎樣用理論去解決。在本次設(shè)計中,我們還需要一些上課時沒有牢固的知識,于是圖書館和INTERNET成了我們很好的助手。在查閱資料的過程中,我們要判斷優(yōu)劣、取舍相關(guān)知識,不知不覺中我們查閱資料的能力也得到了很好的鍛煉。我們學(xué)習(xí)的知識是有限的,在以后的工作中我們肯定會遇到許多未知的領(lǐng)域,這方面的能力便會使我們受益非淺。在設(shè)計過程中,總是遇到這樣或那樣的問題。有時發(fā)現(xiàn)一個問題的時候,需要做大量的工作,花大量的時間才能解決。自然而然,我的耐心便在其中建立起來了。為以后的工作積累了經(jīng)驗,增強(qiáng)了信心。我認(rèn)為,不僅僅是此次考查設(shè)計,在整個這學(xué)期的實驗中,不僅培養(yǎng)了獨立思考、動手操作的能力,在各種其它能力上也都有了提高。更重要的是,在實驗課上,我們學(xué)會

溫馨提示

  • 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)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論