




版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、精選優(yōu)質(zhì)文檔-傾情為你奉上 EDA報(bào)告 題 目 VHDL設(shè)計(jì)初步 學(xué) 院 電子工程學(xué)院 專 業(yè) 學(xué) 號(hào) 導(dǎo)師姓名 朱燕 目錄 引言 隨著大規(guī)模集成電路技術(shù)和計(jì)算機(jī)技術(shù)的不斷發(fā)展,在涉及通信、國(guó)防、航天、醫(yī)學(xué)、工業(yè)自動(dòng)化、計(jì)算機(jī)應(yīng)用、儀器儀表等領(lǐng)域的電子系統(tǒng)設(shè)計(jì)工作中,EDA技術(shù)的含量正以驚人的速度上升;電子類的高新技術(shù)項(xiàng)目的開(kāi)發(fā)也逾益依賴于EDA技術(shù)的應(yīng)用。即使是普通的電子產(chǎn)品的開(kāi)發(fā),EDA技術(shù)常常使一些原來(lái)的技術(shù)瓶頸得以輕松突破,從而使產(chǎn)品的開(kāi)發(fā)周期大為縮短、性能價(jià)格比大幅提高。不言而喻,EDA技術(shù)將迅速成為電子設(shè)計(jì)領(lǐng)域中的極其重要的組成部分。第一章 實(shí)驗(yàn)部分(流水燈)開(kāi)始1、程序設(shè)計(jì)流程圖
2、: 開(kāi)始模8的計(jì)數(shù)器輸出計(jì)數(shù)電平4M的分頻器輸出1HZ38譯碼器依次輸出低電平8個(gè)二極管燈依次點(diǎn)亮結(jié)束2、模塊說(shuō)明第一部分:分頻器 因?yàn)橹靼迨莄yclong-EP16C6Q240C8的主頻是4M赫茲,如果直接當(dāng)做CLK信號(hào),根本無(wú)法看清流水燈的變化,所以需要做分頻操作。仿照數(shù)電課本的例題中的分頻器。分頻器的實(shí)體:entity devide isport( clk :in std_logic; clk_out:out std_logic );end devide;我們可以從程序中看到,輸入時(shí)clk(外部主頻時(shí)鐘),輸出是clk_out(分頻后的時(shí)鐘)。(這是實(shí)體的器件圖)分頻器的結(jié)構(gòu)體: pro
3、cess;用進(jìn)程語(yǔ)言描述 begin wait until clk'event and clk='1' if(count<)then count<=count+1; clk_out<='0' else count<=(others=>'0'); clk_out<='1' 我們可以從程序中看到wait until clk'event and clk='1'這句是時(shí)鐘來(lái)到意思,當(dāng)count計(jì)數(shù)小于時(shí),count自加1,且輸出為零,只有當(dāng)大于時(shí),產(chǎn)生一個(gè)高電平脈沖。接下
4、來(lái)是對(duì)分頻器的波形仿真:從波形中我們可以看到分頻器的工作.第二部分:模8計(jì)數(shù)器 我們需要一個(gè)計(jì)數(shù)器來(lái)輸出計(jì)數(shù)電頻,作為下一步38譯碼器的輸入信號(hào),首先我們來(lái)看這個(gè)器件的實(shí)體:port(clk:in std_logic; dout:out std_logic_vector(2 downto 0) );(這是器件的實(shí)體圖)輸入端口是clk,是接入分頻器的時(shí)鐘信號(hào),輸出就是計(jì)數(shù)電平了。計(jì)數(shù)器的結(jié)構(gòu)體:architecture arc_m of m issignal count:std_logic_vector(2 downto 0);begin process(clk) beginif rising
5、_edge(clk) then if count<7 then count<=count+1;elsif count=7 then count<="000" end if; end if;a<=count(0);b<=count(1);c<=count(2);end process; 以上是模8計(jì)數(shù)器的結(jié)構(gòu)體,我們可以看到,但時(shí)鐘來(lái)到時(shí),在count小于7時(shí)count加一,當(dāng)count=7時(shí),count清零。接下來(lái)是對(duì)計(jì)數(shù)器波形的仿真: dout輸出000,001,010,011,100,101,110,111,000,001這符合我們的
6、要求。第三部分:38譯碼器因?yàn)槲覀兪褂檬枪碴帢O二極管,38譯碼器每接受一個(gè)來(lái)自計(jì)數(shù)器的點(diǎn)平時(shí),對(duì)應(yīng)的Yn就輸出低電平,點(diǎn)亮此二極管。我們就可以看到二極管依次點(diǎn)亮好似流水一般。譯碼器的實(shí)體:port(a,b,c:in std_logic; y:out std_logic_vector(7downto 0); 輸入是a,b,c從低到高的三個(gè),輸出是y對(duì)應(yīng)的譯碼電平。(這是譯碼器的原件圖)譯碼器的結(jié)構(gòu)體:architecture arc_yima38 of yima38 issignal comb:std_logic_vector(2 downto 0); begin comb<=x; pro
7、cess(comb) begin case comb is when "000" =>y<= "" when "001" =>y<= "" when "010" =>y<= "" when "011" =>y<= "" when "100" =>y<= "" when "101" =>y<= "&
8、quot; when "110" =>y<= "" when "111" =>y<= "" when others =>y<=null; end case; end process;我們可以看到如下的波形:在y的輸出波形中,“0”循環(huán)右移,這是我們想要的結(jié)果。第四部分:總體效果3、遇到的問(wèn)題和解決方法 我使用的是原理圖連接,在下到片子后我編譯失敗,經(jīng)過(guò)同學(xué)和我的檢查,終于發(fā)現(xiàn)我的原理圖連接有問(wèn)題,如上圖所示,我將y2.0連接到譯碼器的輸入端(a,b,c),這是不正確的,因?yàn)閥2.
9、0是(vector)矢量,而(a,b,c)是位,我錯(cuò)誤的以為用線連起來(lái)就可以使用,但事實(shí)是矢量必須配對(duì)矢量,位配對(duì)位。第二章 習(xí)題部分(Ex-1)畫出下例實(shí)體描述對(duì)應(yīng)的原理圖符號(hào)元件:ENTITY buf3s IS - 實(shí)體1: 三態(tài)緩沖器 PORT (input : IN STD_LOGIC ; - 輸入端 enable : IN STD_LOGIC ; - 使能端 output : OUT STD_LOGIC ) ; - 輸出端END buf3x ;答:ENTITY mux21 IS -實(shí)體2: 2選1多路選擇器 PORT (in0, in1, sel : IN STD_LOGIC; ou
10、tput : OUT STD_LOGIC); END ENTITY mux21;(Ex-2)圖中所示的是4選1多路選擇器,試分別用IF_THEN語(yǔ)句和CASE語(yǔ)句的表達(dá)方式寫出此電路的VHDL程序。 ( 選擇控制的信號(hào)s1和s0為STD_LOGIC_VECTOR類型;當(dāng)s1='0',s0='0';s1='0',s0='1';s1='1',s0='0'和s1='1',s0='1'分別執(zhí)行y<=a、y<=b、y<=c、y<=d。) 答:首先為用IF
11、 THEN 語(yǔ)句實(shí)現(xiàn)程序如下:library IEEE; USE IEEE.STD_LOGIC_1164.ALL; USE IEEE.STD_LOGIC_UNSIGNED.ALL;entity mux41 isport(a,b,c,d:in std_logic; s1,s0:in std_logic_vector(1 downto 0); y:out std_logic );end entity mux41;architecture one of mux41 isbegin process(a,b,c,d,s1,s0) begin if s1='0'and s0='0&
12、#39; then y<=a; else if s1='0'and s0='1' then y<=b; else if s1='1'and s0='0' then y<=c; else if s1='1'and s0='1' then y<=d; end if;end process;end architecture one;用 case 語(yǔ)句程序如下:library IEEE; USE IEEE.STD_LOGIC_1164.ALL; USE IEEE.STD_LOGIC_
13、UNSIGNED.ALL;entity mux41 isport(a,b,c,d:in std_logic; s1,s0:in std_logic; -這里s1 s0沒(méi)有定義成2位矢量 y:out std_logic );end entity mux41;architecture one of mux41 issignal l1:std_logic_vector(1 downto 0); -中間信號(hào)為兩位矢量,為了使用&begin process(a,b,c,d,s1,s0) begin l1<=s1&s0; case l1 is when "00"=
14、>y<=a; when "01"=>y<=b; when "10"=>y<=c; when "11"=>y<=d; end case;end process;end architecture one;(Ex-3)圖中所示的是雙2選1多路選擇器構(gòu)成的電路MUXK,對(duì)于其中MUX21A,當(dāng)s='0'和'1'時(shí),分別有y<='a'和y<='b'。試在一個(gè)結(jié)構(gòu)體中用兩個(gè)進(jìn)程來(lái)表達(dá)此電路,每個(gè)進(jìn)程中用CASE語(yǔ)句描述一個(gè)2
15、選1多路選擇器MUX21A。 library ieee;use ieee.std_logic_1164.all;entity muxk is port ( a1,a2,a3:in std_logic; -待選擇變量 temp:buffer std_logic; -中間信號(hào) s1,s0:in std_logic; -控制端 output:out std_logic); -輸出結(jié)果end muxk;architecture pr1 of muxk is beginprocess(a2,a3,s0) -process1 begincase s0 is -使用case語(yǔ)句when '0'
16、;=> temp<=a2;when '1'=> temp<=a3;end case;end process;process(a1,temp,s1) -process2begincase s1 iswhen '0'=> output<=a1;when '1'=> output<=temp;end case;end process;end pr1; (Ex-4)圖中是一個(gè)含有上升沿觸發(fā)的D觸發(fā)器的時(shí)序電路,試寫出此電路的VHDL設(shè)計(jì)文件。 library IEEE; USE IEEE.STD_LOGIC
17、_1164.ALL; entity dff is port(cl,clk0:in std_logic; out1:out std_logic);end entity dff;architecture one of dff issignal q1,q2:std_logicbegin process(clk) begin if rising edge(clk) then q2=not q1; q1=not(cl and q2); end if; end process; out<=q2;end one;(Ex-5)給出1位全減器的VHDL描述。要求:(1)首先設(shè)計(jì)1位半減器,然后用例化語(yǔ)句將
18、它們連接起來(lái),圖中h_suber是半減器,diff是輸出差,s_out是借位輸出,sub_in是借位輸入。 (2)以1位全減器為基本硬件,構(gòu)成串行借位的8位減法器,要求用例化語(yǔ)句來(lái)完成此項(xiàng)設(shè)計(jì)(減法運(yùn)算是 x y - sun_in = diffr)。 答:(1)全減器library ieee;use ieee.std_logic_1164.all;entity h_suber is -定義半減器port(x,y:in std_logic; -減數(shù)與被減數(shù) diff,s_out:out std_logic); -分別為本位輸出和借位輸出end h_suber;architecture h1 of
19、 h_suber is begin diff<=x xor y; -根據(jù)真值表寫出差和借位 s_out<=(not x)and y; -得到的邏輯關(guān)系end h1;library ieee;use ieee.std_logic_1164.all;entity or2 is - 或門port (a,b:in std_logic; c:out std_logic); end or2;architecture one of or2 is begin c<=a or b;end one;library ieee;use ieee.std_logic_1164.all;entity f
20、_suber is -定義全減器port(x1,y1,sub_in:in std_logic; -x1,y1 為減數(shù)和被減數(shù),subin為借位輸入 sub_out,diffr:out std_logic); -diffr為輸出差,sub_out為借位輸出end f_suber;architecture one of f_suber is component h_suber -引用半減器例化聲明 port(x,y:in std_logic; diff,s_out:out std_logic);end component;component or2 -引用或門例化聲明 port(a,b:in st
21、d_logic; c:out std_logic);end component;signal d,e,f:std_logic; -敏感信號(hào)列表例化聲明beginu1:h_suber port map(x=>x0,y=>y0,diff=>d,s_out=>e); -引用半減器u2:h_suber port map(x=>d,y=>sub_in,diff=>diffr,s_out=>f); -引用半減器u3:or2 port map(a=>f,b=>e,c=>sub_out); -引用或門end one; (2)8位減法器libra
22、ry IEEE; USE IEEE.STD_LOGIC_1164.ALL; USE IEEE.STD_LOGIC_UNSIGNED.ALL;entity f8_suber is port(a:in std_logic_vector(8 downto 1); -定義輸入為8位數(shù),輸 b:in std_logic_vector(8 downto 1);
23、160; -出為8位,s_in為借位輸s_in:in std_logic; -入,s_out為借位輸出 c:out std_logic_vector(8 downto 1); s_out:out std_logic); end entity f8_suber; architecture behave of f8_sube
24、r is component f_suber -全減器的例化 port(x,y,sub_in:in std_logic; diffr,sub_out:out std_logic); end component; signal stmp:std_logic_vector(8 downto 1); - 定義中間信號(hào)begin stmp(0)<=s_in;s_out<
25、=stmp(8); gensub:for i in 1 to 8 generate -generate為生成相同元件多次例化 u1:f_suber port map(x=>a(i),y=>b(i), sub_in=>stmp(i), diffr=>c(i),sub_out=>stmp(i+1);end generate; end architecture behave; (Ex-6)根
26、據(jù)下圖,寫出頂層文件MX3256.VHD的VHDL設(shè)計(jì)文件。 答:library ieee;use ieee.std_logic_1164.all;entity diff is -用到的D觸發(fā)器 port(d,clk:in std_logic; clear:in std_logic; q:out std_logic);end entity diff;architecture one of diff is begin process (clear,d,clk) begin if (clk'event and clk='1') then -上升沿有效 if (clear=&
27、#39;0') then q<='0' -異步清零 else q<=d; end if; end if; end process;end one;library ieee;use ieee.std_logic_1164.all;entity jk is -定義JK觸發(fā)器port(a1,a2,clk: in std_logic; o1,o2: buffer std_logic); end;architecture one1 of jk issignal o1_s,o2_s:std_logic; begin process(a1,a2,clk,o1_s,o2_s
28、) begin if(clk'event and clk='1')then if(a1='0')and(a2='1')then o1_ s<='0', o2_s<='1' elsif (a1='1')and(a2='0')then o1_s<='1',o2_s<='0' elsif(a1='1')and(a2='1')then o1_s<=not o1; o2_s<=not o
29、2; end if; end if; o1<=o1_s; o2<=o2_s; end process; end one1;library ieee;use ieee.std_logic_1164.all;entity mux21 is port (a,b,s:in std_logic; c:out std_logic);end entity;architecture bhv of mux21 isbegin process (a,b,s) -敏感信號(hào)列表 begin if s='0' then c<=a; else c<=b; end if; end p
30、rocess; end bhv; library ieee;use ieee.std_logic_1164.all;entity max3256 is -定義頂層文件 port (ina,inb,inck,inc:in std_logic; -采用例化語(yǔ)句實(shí)現(xiàn) e,out1:out std_logic);end max3256;architecture bhv1 of max3256 is component jk -jk觸發(fā)器port(a1,a2,clk: in std_logic; o1,o2: buffer std_logic);end component;component max3256 - max3256例化port (a,b,s:in std_logic; c:out std_logic);end component;component diff -D觸發(fā)器port(d,clk:in std_logic; clear:in std_logic; q:out std_logic);end component;signal m1
溫馨提示
- 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025年劍橋五級(jí)CPE考試試卷:閱讀技巧與理解深度分析試題
- 環(huán)保污水處理設(shè)備采購(gòu)與安裝服務(wù)協(xié)議
- 2025年柴油發(fā)動(dòng)機(jī)電控裝置項(xiàng)目規(guī)劃申請(qǐng)報(bào)告
- 2025年保健按摩師(保健按摩技術(shù)市場(chǎng)前景分析報(bào)告)職業(yè)技能鑒定試卷
- 2025年北京銀行公務(wù)員錄用考試銀監(jiān)財(cái)經(jīng)類專業(yè)試卷
- 智能制造設(shè)備銷售與租賃協(xié)議
- 市場(chǎng)開(kāi)發(fā)合作協(xié)議條款說(shuō)明
- 企業(yè)合作經(jīng)驗(yàn)及信譽(yù)度證明書(7篇)
- 市場(chǎng)開(kāi)拓及業(yè)務(wù)合作協(xié)議條款說(shuō)明
- 各處風(fēng)景小學(xué)作文700字6篇
- 康復(fù)醫(yī)院的設(shè)計(jì)要點(diǎn)精選
- 10kv高壓架空電線防護(hù)方案概述
- 空調(diào)維保方案及報(bào)價(jià)(共3頁(yè))
- 國(guó)家種畜禽生產(chǎn)經(jīng)營(yíng)許可證管理系統(tǒng)操作指南
- 石油化工管道施工方案
- 四川SG-008技術(shù)、經(jīng)濟(jì)簽證核定單(共2頁(yè))
- 崗位分析及崗位職責(zé)富士康公司組織架構(gòu)及部門職責(zé)
- 商品房銷售代理合同
- 智能化建筑工程檢驗(yàn)批質(zhì)量驗(yàn)收記錄文本表(共69頁(yè))
- GB∕T 40740-2021 堆焊工藝評(píng)定試驗(yàn)
- 檢驗(yàn)檢測(cè)機(jī)構(gòu)內(nèi)審示例(41頁(yè))正式完美版
評(píng)論
0/150
提交評(píng)論