八位十進制數(shù)字頻率計基礎資料_第1頁
八位十進制數(shù)字頻率計基礎資料_第2頁
八位十進制數(shù)字頻率計基礎資料_第3頁
八位十進制數(shù)字頻率計基礎資料_第4頁
八位十進制數(shù)字頻率計基礎資料_第5頁
已閱讀5頁,還剩4頁未讀, 繼續(xù)免費閱讀

下載本文檔

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

文檔簡介

1、 eda課程設計報告書題 目:8位十進制數(shù)字頻率計的設計姓 名:學 號:所屬學院:專業(yè)年級:指導教師:完成時間:8位十進制數(shù)字頻率計的設計一、 設計介紹數(shù)字頻率計是采用數(shù)字電路制做成的能實現(xiàn)對周期性變化信號頻率測量的儀器。頻率計主要用于測量正弦波、矩形波、三角波和尖脈沖等周期信號的頻率值。其擴展功能可以測量信號的周期和脈沖寬度。通常說的,數(shù)字頻率計是指電子計數(shù)式頻率計。頻率計主要由四個部分構成:輸入電路、時基(t)電路、計數(shù)顯示電路以及控制電路。在電子技術領域,頻率是一個最基本的參數(shù)。數(shù)字頻率計作為一種最基本的測量儀器以其測量精度高、速度快、操作簡便、數(shù)字顯示等特點被廣泛應用。許多物理量,例如

2、溫度、壓力、流量、液位、ph值、振動、位移、速度等通過傳感器轉(zhuǎn)換成信號頻率,可用數(shù)字頻率計來測量。尤其是將數(shù)字頻率計與微處理器相結(jié)合,可實現(xiàn)測量儀器的多功能化、程控化和智能化.隨著現(xiàn)代科技的發(fā)展,基于數(shù)字式頻率計組成的各種測量儀器、控制設備、實時監(jiān)測系統(tǒng)已應用到國際民生的各個方面。2、 設計目的(1) 熟悉quatus 11軟件的基本使用方法。(2) 熟悉eda實驗開發(fā)系統(tǒng)的使用方法。(3) 學習時序電路的設計、仿真和硬件設計,進一步熟悉vhdl設計技術。 三、數(shù)字頻率計的基本原理數(shù)字頻率計的基本原理是用一個頻率穩(wěn)定度高的頻率源作為基準時鐘,通常情況下計算每秒內(nèi)待測信號的脈沖個數(shù),此時我們稱閘

3、門時間為1秒。閘門時間也可以大于或小于一秒。閘門時間越長,得到的頻率值就越準確,但閘門時間越長則每測一次頻率的間隔就越長。閘門時間越短,測的頻率值刷新就越快,但測得的頻率精度就受影響。數(shù)字頻率計的主要功能是測量周期信號的頻率。頻率是單位時間(1s)內(nèi)信號發(fā)生周期變化的次數(shù)。如果我們能在給定的1s時間內(nèi)對信號波形計數(shù),并將計數(shù)結(jié)果顯示出來,就能讀取被測信號的頻率。數(shù)字頻率計首先必須獲得相對穩(wěn)定與準確的時間,同時將被測信號轉(zhuǎn)換成幅度與波形均能被數(shù)字電路識別的脈沖信號,然后通過計數(shù)器計算這一段時間間隔內(nèi)的脈沖個數(shù),將其換算后顯示出來。這就是數(shù)字頻率計的基本原理。頻率計測量頻率需要設計整形電路使被測周

4、期性信號整形成脈沖,然后設計計數(shù)器對整形后的脈沖在單位時間內(nèi)重復變化的次數(shù)進行計數(shù),計數(shù)器計出的數(shù)字經(jīng)鎖存器鎖存后送往譯碼驅(qū)動顯示電路用數(shù)碼管將數(shù)字顯示出來,需要設計控制電路產(chǎn)生允許產(chǎn)生的門匣信號,計數(shù)器的清零信號和鎖存器的鎖存信號使電路正常工作,再設計一個量程自動轉(zhuǎn)換使測量范圍更廣。四 系統(tǒng)總體框架 圖 3.1 系統(tǒng)總體框架圖總體框圖設計思路:由50mhz系統(tǒng)時鐘分頻得到0.5hz的基準時鐘。在基準時鐘的1s 高電平期間計被測頻率的脈沖個數(shù),1s高電平結(jié)束時計數(shù)結(jié)束,所記錄的脈沖個數(shù)是被測信號的頻率,為了在數(shù)碼管上顯示計數(shù)結(jié)果需要鎖存器將所計的數(shù)鎖存,因此,在基準時鐘下降沿來的時候鎖存器實現(xiàn)

5、鎖存功能。為了下次計數(shù)必須將本次計數(shù)的結(jié)果清零,所以在基準時鐘低電平期間對計數(shù)器清零。被測頻率從計數(shù)器的是中端輸入實現(xiàn)頻率的測試。將鎖存器鎖存的數(shù)據(jù)輸入掃描器,通過譯碼器將鎖存的二進制數(shù)譯成十進制然后顯示到數(shù)碼管上,最終被讀出來。5、 設計內(nèi)容實驗條件: (1)開發(fā)條件:quatus 11軟件。 (2)實驗設備:gw48-es eda實驗開發(fā)系統(tǒng),電腦。 (3)擬用芯片: epf10k20tc144-4芯片。源程序:-test controler(測頻控制器)library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned

6、.all;entity testctl isport (clkk : in std_logic ;-test 1hz control clkcnt_en,rst_cnt,load : out std_logic); -clear the enable , count,end testctl;architecture behav of testctl issignal div2clk : std_logic ;beginprocess (clkk)beginif clkk'event and clkk = '1' thendiv2clk <= not div2clk

7、;end if;end process;process(clkk,div2clk)beginif clkk = '0' and div2clk = '0' then rst_cnt <= '1'else rst_cnt <= '0'end if;end process;load <= not div2clk;cnt_en <= div2clk;end behav;- count10 (cnt10.vhd)(十進制計數(shù)器)library ieee;use ieee.std_logic_1164.all;use

8、 ieee.std_logic_unsigned.all;entity cnt10 isport(clk : in std_logic; clr : in std_logic; enb : in std_logic; outy: out std_logic_vector(3 downto 0); cout: out std_logic);end cnt10;architecture behav of cnt10 isbeginprocess(clk,clr,enb)variable cqi : std_logic_vector (3 downto 0);begin if clr = '

9、1' then cqi :="0000"elsif clk'event and clk = '1' thenif enb = '1' thenif cqi < "1001" then cqi := cqi+1;else cqi :="0000"end if;end if;end if;outy <= cqi;cout <= cqi(0) and (not cqi(1) and (not cqi(2) and cqi(3);end process;end behav;-r

10、egister (reg4b.vhd)(4位鎖存器)library ieee;use ieee.std_logic_1164.all;entity reg4b isport (load : in std_logic; din : in std_logic_vector(3 downto 0); dout : out std_logic_vector (3 downto 0);end reg4b;architecture behav of reg4b isbegin process (load ,din)beginif load'event and load = '1'

11、then dout <= din ; -suo cunend if;end process;end behav;8位十進制頻率計library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity choose isport( clk:in std_logic; a,b,c,d,e,f,g,h:in std_logic_vector(3 downto 0); x,y:out std_logic_vector(7 downto 0);end;architecture one of choose is

12、signal ain:std_logic_vector(2 downto 0);signal bin:std_logic_vector(3 downto 0);beginprocess(clk) begin if(clk'event and clk='1') then if(ain="111") then ain<="000" else ain<=ain+'1' end if; end if; end process;process(ain)begincase ain iswhen"000&q

13、uot;=>bin<=a;y<="11111110"when"001"=>bin<=b;y<="11111101"when"010"=>bin<=c;y<="11111011"when"011"=>bin<=d;y<="11110111"when"100"=>bin<=e;y<="11101111"when"101&q

14、uot;=>bin<=f;y<="11011111"when"110"=>bin<=g;y<="10111111"when"111"=>bin<=h;y<="01111111"when others=>null;end case;end process;process(bin)begincase bin iswhen"0000"=>x<="11111100"when"0001

15、"=>x<="01100000"when"0010"=>x<="11011010"when"0011"=>x<="11110010"when"0100"=>x<="01100110"when"0101"=>x<="10110110"when"0110"=>x<="10111110"when&quo

16、t;0111"=>x<="11100000"when"1000"=>x<="11111110"when"1001"=>x<="11110110"when others=>null;end case;end process;end;-quent1library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity quent1 isport(clkin :

17、in std_logic; fin : in std_logic; scan : out std_logic_vector(7 downto 0); seg : out std_logic_vector(7 downto 0); coutt: out std_logic );end entity quent1;architecture one of quent1 iscomponent chooseport( clk:in std_logic; a,b,c,d,e,f,g,h:in std_logic_vector(3 downto 0); x,y:out std_logic_vector(7

18、 downto 0);end component; component testctlport (clkk : in std_logic;cnt_en , rst_cnt,load : out std_logic);end component;component cnt10port (clk : in std_logic; clr : in std_logic; enb : in std_logic; outy: out std_logic_vector(3 downto 0); cout: out std_logic);end component;component reg4bport (l

19、oad : in std_logic; din : in std_logic_vector(3 downto 0); dout : out std_logic_vector(3 downto 0);end component;signal a_ena,b_rst,c_load,cout1,cout2,cout3,cout4,cout5,cout6,cout7 : std_logic;signal outy1,outy2,outy3,outy4,outy5,outy6,outy7,outy8,out1,out2,out3,out4,out5,out6,out7,out8 : std_logic_

20、vector(3 downto 0);beginu1 : testctl port map (clkk=> clkin,cnt_en=>a_ena,rst_cnt=>b_rst,load=>c_load);u2 : cnt10 port map(clk=> fin,clr=>b_rst,enb=>a_ena,outy=>outy1,cout=>cout1);u3 : cnt10 port map(clk=> cout1,clr=>b_rst,enb=>a_ena,outy=>outy2,cout=>cout2)

21、;u4 : cnt10 port map(clk=> cout2,clr=>b_rst,enb=>a_ena,outy=>outy3,cout=>cout3);u5 : cnt10 port map(clk=> cout3,clr=>b_rst,enb=>a_ena,outy=>outy4,cout=>cout4);u6 : cnt10 port map(clk=> cout4,clr=>b_rst,enb=>a_ena,outy=>outy5,cout=>cout5);u7 : cnt10 port m

22、ap(clk=> cout5,clr=>b_rst,enb=>a_ena,outy=>outy6,cout=>cout6);u8 : cnt10 port map(clk=> cout6,clr=>b_rst,enb=>a_ena,outy=>outy7,cout=>cout7);u9 : cnt10 port map(clk=> cout7,clr=>b_rst,enb=>a_ena,outy=>outy8,cout=>coutt);u10 : reg4b port map(load=> c_lo

23、ad,din=> outy1,dout=>out1);u11 : reg4b port map(load=> c_load,din=> outy2,dout=>out2);u12 : reg4b port map(load=> c_load,din=> outy3,dout=>out3);u13 : reg4b port map(load=> c_load,din=> outy4,dout=>out4);u14 : reg4b port map(load=> c_load,din=> outy5,dout=>o

24、ut5);u15 : reg4b port map(load=> c_load,din=> outy6,dout=>out6);u16 : reg4b port map(load=> c_load,din=> outy7,dout=>out7);u17 : reg4b port map(load=> c_load,din=> outy8,dout=>out8);u18 : choose port map(clk=>fin,a=>out1,b=>out2,c=>out3,d=>out4,e=>out5,f=>out6,g=>out7,h=>out8,x=>

溫馨提示

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

評論

0/150

提交評論