中國地質大學EDA實驗報告.doc_第1頁
中國地質大學EDA實驗報告.doc_第2頁
中國地質大學EDA實驗報告.doc_第3頁
中國地質大學EDA實驗報告.doc_第4頁
中國地質大學EDA實驗報告.doc_第5頁
已閱讀5頁,還剩17頁未讀 繼續免費閱讀

VIP免費下載

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

文檔簡介

EDA實驗報告 基礎實驗實驗一 組合邏輯設計一、 實驗目的:1、通過一個簡單的3-8譯碼器的設計,掌握組合邏輯電路的設計方法。2、掌握組合邏輯電路的靜態測試方法。3、初步了解quartusII原理圖輸入設計的全過程。二、實驗的硬件要求:1、主芯片:EP1K10TC10032、輸出:八個LED燈3、輸入:DIP撥碼開關3位三、實驗器材: 試驗箱四、實驗原理: 三八譯碼器三輸入,八輸出。當輸入信號按二進制方式的表示為N時,輸出端從零標記到八。因為三個輸入端能產生的組合狀態有八種,所以輸出端在每種組合中僅有一位有效的情況下,能表示所有的輸入組合。3-8譯碼器真值表輸入輸出A2 A1 A0Y7 Y6 Y5 Y4 Y3 Y2 Y1 Y00 0 00 0 10 1 00 1 11 0 01 0 11 1 01 1 10 0 0 0 0 0 0 1 0 0 0 0 0 0 1 00 0 0 0 0 1 0 00 0 0 0 1 0 0 00 0 0 1 0 0 0 00 0 1 0 0 0 0 00 1 0 0 0 0 0 01 0 0 0 0 0 0 0五、實驗步驟:1、打開quartusII 軟件,選擇file-new project wizard建立工程,選擇器件主芯片:EP1K10TC1003 ,工程文件名為ym,2、新建Block diagram/schematic file程序3、在窗口繪制原理圖:單擊鼠標右鍵選擇symbol,選擇相應原件用鼠標拖入文件中編輯,繪制完成后保存原理圖,將程序名改為ym,與工程名相同。4、對程序進行編譯,編譯無誤后,進行波形仿真完成后,進行管腳配置,并將程序下載到實驗箱仿真波形5、實驗電路連線與實驗結果用撥碼開關的低三位代表譯碼器輸入,將之與配置好的管腳相連;用led燈代表譯碼器的輸出,將之與配置好的管腳相連。完成連接后,撥動撥檔開關,觀察led的發光狀態與輸入狀態的對應關系是否與真值表中的情況相同。經觀察,led的發光狀態符合真值表的描述。六、試驗心得試驗中對quartus的操作不夠熟悉,繪制原理圖出現連線錯誤,以致繪制原理圖速度慢。通過實驗熟悉了對軟件的操作,掌握了建立工程的方法,繪制bdf文件的方法,了解了試驗箱的使用。實驗二 掃描顯示電路的驅動一、實驗目的: 了解教學系統中8位七段數碼管顯示模塊的工作原理,設計標準掃描驅動電路模塊。二、硬件要求: 主芯片:EP1K10TC100-3,時鐘源,八位七段數碼顯示管,四位撥碼開關。三、實驗內容:1、用撥碼開關產生8421BCD碼,用CPLD產生字形編碼電路和掃描驅動電路,然后進行仿真,觀察波形,正確后進行設計實現。調節時鐘頻率,感受“掃描”的過程,并觀察字符亮度和顯示刷新的效果。2、編制一個簡單的從0F輪換顯示十六進制的電路。四、實驗原理: 四位撥碼開關提供8421BCD碼,經譯碼電路后成為七段數碼管的字形顯示驅動信號。掃描電路通過可調時鐘輸出片選地址SEL3.0。由SEL3.0和AG決定了8位中的哪一位顯示和顯示什么字形,SEL3.0變化的快慢決定了掃描頻率的快慢。五、實驗步驟:1、 編寫DECL7S實驗代碼并封裝: library ieee;use ieee.std_logic_1164.all;entity decl7s is port(a: in std_logic_vector(3 downto 0); led7s: out std_logic_vector(6 downto 0);end;architecture one of decl7s isbegin process(a)begin case a is when 0000= led7s led7s led7s led7s led7s led7s led7s led7s led7s led7s led7s led7s led7s led7s led7s led7s null; end case; end process;end;實驗原理圖:在電腦軟件上繪制出所要求的圖像如下:通過軟件得出實驗RTL圖實驗波形仿真圖:六、實驗結果連接好電路,接入時鐘信號,數碼管從0-F輪流顯示。七、試驗心得試驗中,學會了程序的封裝和調用,學習了8位七段數碼管顯示模塊的工作原理。由于試驗進度慢,操作不夠熟悉,未能在試驗時間內順利完成實驗。實驗三 梁祝音樂演奏實驗一、實驗目的: 1. 了解普通揚聲器的工作原理。2. 使用FPGA產生不同的音樂頻率。3. 進一步體驗FPGA的靈活性。二、實驗硬件要求: 1. 375KHz信號源。2. FPGA EP1K10TC1003主芯片。3. 揚聲器。三、實驗原理:本實驗是完成一小段音樂程序的開發,然后再用揚聲器進行試聽。下面主要介紹一下完成本實驗的幾個主要部分的工作原理。1、音符的產生:音符的產生是利用計數器對輸入的時鐘信號進行分頻,然后輸出不同的頻率來控制揚聲器發不同的聲音。計數器必須是模可變的計數器,也就是其初始計數值可變,這樣便可以對其進行初始化,使其從不同的初始值開始計數,實現對輸入時鐘信號的不同分頻。2、節拍的產生:節拍也是利用計數器來實現,如果某一個音符需要維持的時間比較長,那么就可以在此計數器從計數值A到計數值B之間都維持該音符,很顯然,A和B之間的間隔越大,那么該音符維持的時間也就越長。3、樂譜的存儲:樂譜是一個固定的組合電路,根據不同的輸入值,然后輸出一個固定的值,該值就是音符產生計數器的分頻的初始值。適當的選擇這些計數器和組合電路,便可完成不同的樂曲和不同節奏。四、實驗內容及步驟:本實驗要完成的任務是設計一個驅動揚聲器產生梁祝音樂的程序,設計步驟如下:1、打開quartusII,建立工程,選擇芯片ACEX1K10TC1003,新建vhdl文件,編寫音樂輸出的VHDL代碼。2、用quartusII對其進行編譯仿真。3在仿真確定無誤后,對管腳進行配置,再次進行編譯。根據已配置的管腳,在實驗箱上對揚聲器接口和FPGA之間進行正確連線。Clk:時鐘輸入信號,接375KHz的時鐘源。Spk:輸出,接揚聲器部分的輸入端。將程序下載到試驗箱,觀看實驗結果。Vhdl程序 :library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_arith.all;use ieee.std_logic_unsigned.all;entity music isport(clk : in std_logic;spk : buffer std_logic);end music;architecture behave of music issignal tone : std_logic_vector(10 downto 0);signal tone_count : std_logic_vector(10 downto 0);signal tone_index : integer range 0 to 15;signal clk10_count: std_logic_vector(17 downto 0);signal time : integer range 0 to 150;signal clk10 : std_logic;beginprocess(clk10)beginif(clk10event and clk10=1)thenclk10_count=clk10_count+1;if(clk10_count=16#3fff#) thenclk10= not clk10;end if;end if;end process;process(clk10)beginif(clk10event and clk10=1)thenif(time=150) thentime=0;elsetimetone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextone_indextonetonetonetonetonetonetonetonetonetonetonetonetonetone=11111111111;end case;end process;process(clk)beginif(clkevent and clk=1)thenif(tone_count=16#7ff#) thentone_count=tone;if(tone2047) thenspk=not spk;end if;elsetone_count=tone_count+1;end if;end if;end process;end behave;實驗RTL圖七、實驗結果:蜂鳴器奏響梁祝,改變輸入的時鐘頻率,音樂輸出也不同。實驗八 步進電機控制實驗一、 實驗目的1、 了解步進電機的工作原理。2、 掌握用FPGA產生驅動步進電機的時序。3、 掌握用FPGA來控制步進電機轉動的整個過程。二、 硬件要求1、 步進電機。2、 主芯片FPGA EP1K10TC1003。3、 8個按鍵和一個撥擋開關。4、 可變時鐘源。三、實驗原理步進電機是工業過程控制及儀表中常用的控制元件之一,例如在機械裝置中可以用絲桿把角度變為直線位移,也可以用步進電機帶動螺旋電位器,調節電壓或電源,從而實現對執行機械的控制。四、實驗內容及步驟本實驗需要完成的任務是編寫VHDL代碼來驅動步進電機動作,通過撥動開關使其正轉、反轉;通過按下相應的按鍵開關使其旋轉相應的角度。1、打開quartusII,建立工程,工程名為stepmotor,新建vhdl文件,選擇芯片ACEX1K EP1K10TC1003 編寫驅動步進電機旋轉的VHDL程序。程序如下: library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_arith.all;use ieee.std_logic_unsigned.all;entity stepmotor isport( clk : in std_logic; key1_8,key5_4,key9 : in std_logic; key18,key45,key90 : in std_logic; key180,key360 : in std_logic; keyorder : in std_logic; astep,bstep : out std_logic; cstep,dstep : out std_logic); end stepmotor;architecture behave of stepmotor issignal dcount : std_logic_vector(4 downto 0); signal degreecount : std_logic_vector(7 downto 0); signal degree : std_logic_vector(7 downto 0); signal abcd : std_logic_vector(1 downto 0); signal clk_temp : std_logic; beginprocess(clk) beginif(clkevent and clk=1) thendcount=dcount+1;end if;end process;process(clk) beginif(clkevent and clk=1) thenif(dcount=11111) thenclk_temp=not clk_temp;end if;end if;end process;process(clk) beginif(clkevent and clk=1) thenif(key1_8=0) thendegree=00000001;elsif(key5_4=0) thendegree=00000011;elsif(key9=0) thendegree=00000101;elsif(key18=0) thendegree=00001010;elsif(key45=0) thendegree=00011001;elsif(key90=0) thendegree=00110010;elsif(key180=0) thendegree=01100100;elsif(key360=0) thendegree0) thendegree0) thendegreecount0) thendegreecount=degreecount-1;abcd=abcd+1;elsedegreecount=00000000;end if;end if;end process;process(clk_temp) beginif(clk_tempevent and clk_temp=1) thenif(keyorder=1) thenif(abcd=0) thenastep=1;bstep=0;cstep=0;dstep=0;elsif(abcd=1) thenastep=0;bstep=1;cstep=0;dstep=0;elsif(abcd=2) thenastep=0;bstep=0;cstep=1;dstep=0;elsif(abcd=3) thenastep=0;bstep=0;cstep=0;dstep=1;end if;elseif(abcd=0) thenastep=1;bstep=0;cstep=0;dstep=0;elsif(abcd=1) thenastep=0;bstep=0;cstep=0;dstep=1;elsif(abcd=

溫馨提示

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

評論

0/150

提交評論