EDA-課程設(shè)計-智能函數(shù)發(fā)生器_第1頁
EDA-課程設(shè)計-智能函數(shù)發(fā)生器_第2頁
EDA-課程設(shè)計-智能函數(shù)發(fā)生器_第3頁
EDA-課程設(shè)計-智能函數(shù)發(fā)生器_第4頁
EDA-課程設(shè)計-智能函數(shù)發(fā)生器_第5頁
已閱讀5頁,還剩7頁未讀 繼續(xù)免費閱讀

下載本文檔

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

文檔簡介

EDA課程設(shè)計題目:智能函數(shù)發(fā)生器專業(yè):通信工程班級:通信082姓名:謝振峰學(xué)號:一、 設(shè)計題目:智能函數(shù)發(fā)生器設(shè)計一個智能函數(shù)發(fā)生器,能夠產(chǎn)生遞增、遞減、方波、三角波、正弦波及及階梯波波形,并可通過開關(guān)選擇輸出的波形。二、 設(shè)計目標:1) 設(shè)計一個智能函數(shù)發(fā)生器,能夠以穩(wěn)定的頻率發(fā)生遞增斜波、遞減斜波、三角波、梯形波,正弦波和方波。2) 設(shè)置一個波形選擇輸入信號,通過此改變該信號可以選擇以上各種不同種類的輸出函數(shù)波形,系統(tǒng)具有復(fù)位功能。三、 設(shè)計原理:1. 原理圖框圖如下:遞增模塊遞減模塊三角波模塊階梯波模塊正弦波模塊方波模塊選 擇 模 塊輸出信號圖1、原理圖框圖2. 原理圖說明本設(shè)計采用VHDL語言和原理圖設(shè)計結(jié)合的方法,首先用文本輸入法設(shè)計了六個波形模塊,分別為遞增、遞減、三角波、梯形、正弦波、方波模塊,和一個選擇模塊。然后進行原理圖設(shè)計,將各波形模塊與選擇模塊相應(yīng)的引腳連接,從而完成智能函數(shù)發(fā)生器的設(shè)計。四、 設(shè)計內(nèi)容: 1) 遞增模塊遞增模塊是用VHDL語言描述的遞增函數(shù),實體部分部分說明三個端口,兩個輸入端口時鐘信號clk、復(fù)位信號rst和一個輸出端口q。設(shè)計思路為:通過設(shè)計一個中間變量從0x00到0xFF的遞增賦值給輸出信號q,從而實現(xiàn)遞增數(shù)字信號的輸出。遞增模塊仿真圖如下:圖2、遞增模塊仿真圖2) 遞減模塊遞減模塊的實體包含時鐘信號輸入端口clk和復(fù)位信號端口rst,輸出信號端口q。設(shè)計思路為:通過設(shè)計一個中間變量從0xFF到0x00的遞減賦值給輸出信號q,從而實現(xiàn)遞減數(shù)字信號的輸出。遞減模塊仿真圖如下:圖3、遞減模塊仿真圖3) 三角波模塊三角波模塊的實體包含時鐘信號輸入端口clk和復(fù)位信號端口rst,輸出信號端口q。設(shè)計思路為:通過設(shè)計一個中間變量先從0x00遞增到0x7F,然后從0x7F遞減到0x00,將中間變量賦值給輸出信號q,從而實現(xiàn)一個周期三角波形的輸出。三角波模塊仿真圖如下:圖4、三角波模塊仿真圖4) 階梯波模塊階梯波模塊的實體包含時鐘信號輸入端口clk和復(fù)位信號端口rst,輸出信號端口q。設(shè)計思路為:通過變量控制使中間變量從00H到FFH之間加10H遞增,遞增到FFH后復(fù)位為00H,從而實現(xiàn)階梯波形。階梯波仿真圖如下:圖5、階梯波模塊仿真圖5) 正弦波模塊正弦波模塊的包含時鐘信號輸入端口clk和復(fù)位信號端口rst,輸出信號端口q。設(shè)計思路為:取一個正弦波周期64個采樣值,設(shè)置一個64進制的計數(shù)器,每次計數(shù)將每個采樣值輸出到端口q,從而實現(xiàn)正弦波數(shù)字波形輸出。正弦波仿真圖如下:圖6、正弦波模塊仿真圖6) 方波模塊方波模塊的包含時鐘信號輸入端口clk和復(fù)位信號端口rst,輸出信號端口q。設(shè)計思路為:設(shè)置一個中間變量,將其從0x00遞增到0x7F,輸出信號端口q輸出0x00;中間變量從0x7F遞增到0xFF,端口q輸出0xFF,再將中間變量復(fù)位為0x00,以此循環(huán),從而實現(xiàn)方波輸出。方波模塊仿真圖如下:圖7、方波模塊仿真圖7) 原理圖設(shè)計如下圖8、原理圖設(shè)計五、 仿真結(jié)果圖9、仿真結(jié)果(一)圖10、仿真結(jié)果(二)六、 總結(jié)本設(shè)計完整地實現(xiàn)了課程設(shè)計要求,通過輸入選擇信號,輸出指定的波形,并能實現(xiàn)復(fù)位功能。通過這次這次智能函數(shù)發(fā)生器的課程設(shè)計,我更加熟悉了學(xué)會了使用EDA編程工具軟件Quartus II的操作,加深了對VHDL語言的理解,熟練了利用原理圖設(shè)計電路的方面,體會到了將所學(xué)的數(shù)字電路知識付諸實踐的樂趣。七、 附錄1.遞增模塊源程序library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity increase isport(clk,rst:in std_logic;q:out std_logic_vector(7 downto 0);end increase;architecture behave of increase isbeginprocess(clk,rst)variable temp:std_logic_vector(7 downto 0);beginif rst=0then temp:=;elsif clkevent and clk=1 thenif temp=thentemp:=;elsetemp:=temp+1;end if;end if;q=temp;end process;end behave;2.遞減模塊源程序library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity decrease isport( clk,rst:in std_logic; q:out std_logic_vector(7 downto 0);end decrease;architecture behave of decrease isbeginprocess(clk,rst)variable temp:std_logic_vector(7 downto 0);beginif rst=0then temp:=; elsif clkevent and clk=1 then if temp= then temp:=; else temp:=temp-1; end if;end if; q=temp;end process;end architecture;3.三角波模塊源程序library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity triangle isport( clk,rst: in std_logic; q:out std_logic_vector(7 downto 0);end triangle;architecture behav of triangle isbeginprocess(clk,rst) variable temp:std_logic_vector(7 downto 0); beginif rst=0 then temp:=; elsif clkevent and clk=1 then temp:=temp+1; if temp= then q=temp; else q=255-temp; if temp= then temp:= ; end if; end if; end if; end process; end architecture;4.階梯波模塊源程序library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity stair isport( clk,rst:in std_logic; q:out std_logic_vector(7 downto 0);end stair; architecture behav of stair isbeginprocess(clk,rst)variable tmp:std_logic_vector(7 downto 0);Begin if rst=0then tmp:=; elsif clkevent and clk=1 then if tmp= then tmp:=; else tmp:=tmp+16; end if;end if;q=tmp;end process;end behav; 5.正弦波模塊源程序library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity sinwave isport (clk,rst:in std_logic;d:out std_logic_vector(7 downto 0);end sinwave;architecture behav of sinwave isbeginprocess(clk,rst)variable num:integer range 0 to 63;beginif rst=0 then dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddnull;end case;end if;end process;end behav;6.方波模塊源程序library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity rectangle isport( clk,rst:in std_logic; q:out std_logic_vector(7 downto 0);end rectangle;architecture behav of rectangle isbeginprocess(clk,rst) variab

溫馨提示

  • 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)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

最新文檔

評論

0/150

提交評論