EDA技術課程設計

2022-10-15 08:24:05 字數 4808 閱讀 1445

河北科技大學

課程設計報告

姓名(學號):潘小霖(17)彭酉幹(18)

喬穎晟(19)時金旭(20)宋文雪(21)

專業班級: 電信112班

課程名稱: eda技術課程設計

學年學期: 2 013 —2 014 學年第 2 學期

指導教師於國慶

2 0 14 年 6 月

課程設計成績評定表

基於fpga自動量程頻率計

摘要: 系統基於eda技術的自動量程頻率計實現,以現場可程式設計門陣列(fpga)為設計核心,整合於一片altera公司的acex系列ep1k100qc208—3晶元上,採用超高速硬體描述語言(vhdl)模組化程式設計,實現了被測訊號的頻率、計數、週期測量,並顯示在8個數碼管上等功能。本設計的特點在於能夠完成被測訊號的頻率手動和自動測量,當超量程和欠量程時能報警提示,並當自動模式時能自動切換到適合的量程,該系統具有整合度高、靈活性強、易於開發和維護等特點。

關鍵字: fpga vhdl 自動量程頻率計計數週期測量

abstract: the system based on the eda technique achieve the automatic measurement frequency meter, centering on fpga(field programmable gate array) and adopting vhdl(vhsic hardware description language) as the platform to carry out the modularization programming. the whole design integrates on the acex series ep1k100qc208—3 chip of the altera company .

our design realizes the measurement of measured signal 『s frequency and cycle ,counting and displaying the results on the nixie tubes. this design features in achieving the measurement of frequency manually or automatically, and it can give an alarm when it over range or owe range. when you choose the automatic mode, it also can change for the suitable range.

the system has the features of high integration , strong flexibility and easy to develop and maintain.

key –word: fpga vhdl automatic range frequency meter counting periodic measurement

目錄一、設計要求 5

二、系統設計 5

三、單元模組設計 6

四、**與除錯 13

五、優化與約束 13

六、協同與分工 14

七、心得體會 (總結) 14

八、參考文獻 14

九、附錄(所有程式15

設計乙個3位十進位制頻率計,分三個基本量程:1khz、10khz、100khz(讀數對應 .999 、9.99、99.9,單位khz),量程自動或手動轉換。

量程自動或手動轉換規則

1、當讀數大於999時,處於超量程狀態,顯示器發出溢位指示(最高位顯示f),下一測量週期量程增加一檔;

2、當讀數小於90時,處於欠量程狀態,顯示器發出欠量程指示(最高位顯示l),下一測量週期量程減小一檔;

超欠量程時時聲音提示;

頻率計同時具有計數功能,計數範圍為0~9999999,由顯示計數值時,最高位顯示c;超出計數範圍時,顯示cf。

要求:測量週期固定為500ms,3個「量程選擇」鍵、1個「手/自動量程」 模式選擇建和1個「頻率/計數」顯示模式選擇鍵以及1個「計數清零」鍵;量程模式狀態、顯示模式狀態、量程狀態分別由led指示。

發揮:訊號週期測量、占空比測量等。

基準訊號選擇4.19mhz頻率的方波,通過分頻可產生系統所需訊號,數碼管使用8個,動態掃瞄顯示,可顯示頻率值、計數值、週期值。乙個開關控制頻率/計數功能切換,乙個控制自動或手動量程功能,乙個開關控制訊號週期的顯示。

三個按鈕可在手動量程是切換量程範圍。五個led燈分別自顯示量程模式狀態、顯示模式狀態、量程狀態。另外輸出連線一蜂鳴器,當超量程或欠量程時報警提示。

entity plj is

port ( change:in std_logic; --手動/自動 1-自動 0-手動

cont : in std_logic; --頻率/計數 1-頻率 0-計數

clr:in std_logic; --復位

zant:in std_logic; --暫停

zhouqi:in std_logic; --週期

clk :in std_logic; --基準

clk1:in std_logic; --被測訊號

fxuan : in std_logic_vector(2 downto 0);

beep: out std_logic;

lcway:out std_logic_vector(2 downto 0);

chgway:out std_logic; --手動/自動亮-自動滅-手動

xsway:out std_logic; --頻率/計數亮-頻率滅-計數

yy1:out std_logic_vector(7 downto 0);

w1 :out std_logic_vector(7 downto 0

end plj;

基準分頻模組:系統基準時鐘選用4.19mhz方波,分頻分別產生1hz方波、500hz方波和1mhz方波。

用於產生500ms閘門時間、數碼管動態顯示掃瞄時間和週期測量時的基準訊號。產生程式如下:

second:process(clk

begin

if clk'event and clk='1' then500ms閘門訊號

if q<2095000 then en<= '1';q<=q+1;flag2<='0';flag3<='0';

elsif q=2095001 then en<='0';q<=q+1;flag2<='0';flag3<='1';

elsif q<4190000 then en<='0'; q<=q+1;flag2<='0';flag3<='0';

elsif q=4190000 then en<='0'; q<=0;flag2<='1';flag3<='0';

end if;

end if;

end process;

process(clk)

begin

if clk'event and clk='1' then500hz

if p=4195 then sclk<= not sclk;p<=0;

else p<=p+1;

end if;

end if;

end process;

process(clk1mhz

begin

if clk'event and clk='1' then

if i=1 then pclk<=not pclk; i<=0;

else i<=i+1;

end if;

end if;

end process;

被測訊號2分頻:被測訊號沒來一上公升沿,clk0翻轉乙個,實現被測訊號的2分頻,用於週期測量的計數。高電平時間即被測訊號週期時間。

process(clk1被測訊號2分頻

begin

if clk1'event and clk1='1' then

clk0<=not clk0;

end if;

end process;

測頻計數模組:基準訊號為4.19mhz,分頻產生1hz的方波en,1hz方波高電平期間計算被測訊號上公升沿個數,低電平將計數值送入數碼管顯示,並將計數值清零。

計數範圍為7位數,0--9999999。測頻程式如下:

and2:process(en,clk1

begin

bclk<=clk1 and en;

end process;

com:process(en,bclk,flag2測頻

begin

if en='0' and flag3='1' then a1<=b1;a2<=b2;a3<=b3;a4<=b4;a5<=b5;a6<=b6;a7<=b7;

elsif en='0' and flag2='1' then b1<="0000";b2<="0000";b3<="0000";b4<="0000";b5<="0000";b6<="0000";b7<="0000";

elsif bclk'event and bclk='1' then

if b1="1000" then b1<="0000

if b2="1001" then b2<="0000

if b3="1001" then b3<="0000

if b4="1001" then b4<="0000

if b5="1001" then b5<="0000"; --flag1<='1';

if b6="1001" then b6<="0000";

if b7="1001" then b7<="0000";

else b7<=b7+1;

end if;

供電技術課程設計

摘要本變電所為中小型企業變電所,此礦是由35kv架空進線,經主變壓器降壓為6kv,再分別進入各車間變電所。此設計涉及到變電所主接線的設計 短路電流計算 繼電保護設計 電氣裝置選擇 配電裝置設計 防雷和接地設計。設計中將各個電氣裝置分別裝入合適的高壓開關櫃和低壓配電屏中,其結構簡單 占地面積小。新裝置...

測試技術課程設計

機械工程測試技術 課程設計 對無縫鋼管超聲測厚儀的 姓名 朱傳超 學院 機電工程學院 專業 機械設計製造及其自動化 班級 2011級本科6班 學號 201115310349 完成日期 2012年11月25日 目錄1 緒論 2 訊號 採集與分析處理 2.1 題目 2.2 matlab處理分析 2.3討...

網路管理技術課程設計

2010 級網路工程專業網路管理技術 課程設計課程教學計畫 2012 2013 學年第二學期 姓名 李廣 學號 10539037 班級 2 班 指導教師 饒元 日期 2013.6.5 一 實習目的與要求 課程設計是 網路管理技術 教學活動中的乙個重要環節,其目的是幫助學生全面 梳理和掌握課程內容,培...