EDA原理及應(yīng)用_10_component.ppt_第1頁
EDA原理及應(yīng)用_10_component.ppt_第2頁
EDA原理及應(yīng)用_10_component.ppt_第3頁
EDA原理及應(yīng)用_10_component.ppt_第4頁
EDA原理及應(yīng)用_10_component.ppt_第5頁
已閱讀5頁,還剩23頁未讀, 繼續(xù)免費閱讀

下載本文檔

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

文檔簡介

1、1,VHDL的層次化設(shè)計,使多個設(shè)計者并行工作 可對每個模塊單獨仿真,便于減少錯誤和Debug 分階段完成設(shè)計 使一些通用模塊能夠重復(fù)使用 增加程序的可讀性 層次化設(shè)計用到的基本概念:庫、包、元件(Component)、函數(shù)(Function)、過程(Procedure)等。,2,庫(Library),已編譯的數(shù)據(jù)集合,存放包集合、實體、構(gòu)造體、數(shù)據(jù)類型、函數(shù)、過程和配置的定義 庫的種類 VHDL 系統(tǒng)庫: std 、library ieee; VHDL工作庫-WORK 存放當(dāng)前正在設(shè)計的編譯結(jié)果,比如其他成員的設(shè)計結(jié)果 廠家自定義庫 Max+PlusII中有l(wèi)pm庫,定義了許多數(shù)字電路基本元

2、件 Library lpm; ieee庫的內(nèi)容在maxplus2vhdl93目錄下,3,包(Package),每個庫可包含一個或多個包 在Architecture中定義的Type、Component、Function或其它聲明對于別的設(shè)計文件來說都是不可見的。 Package中定義的對于其它設(shè)計是可見的。 Use library_name.package_name.item 如果想Package中所有定義都可見,則item用all來代替,4,IEEE標(biāo)準(zhǔn)庫,5,元件(Component),Component1 Component2 Component3,1Hz時鐘,時 分 秒,TopModul

3、e,SubModule,6,元件(Component),層次圖,TopModule,SubModule1,SubModule0,信號流圖,Top.vhd,cnt60.vhd,cnt60.vhd,cnt24.vhd,時 分 秒,cnt60.vhd,cnt60.vhd,1Hz,?,?,cnt24.vhd,7,輸入時鐘為65536Hz計時,8,四 時序邏輯電路之分頻器篇,9,分頻器,使輸出信號頻率為輸入信號頻率整數(shù)分之一的電子電路。在許多電子設(shè)備中如電子鐘等,需要各種不同頻率的信號協(xié)同工作,常用的方法是以穩(wěn)定度、精度高的高頻晶體振蕩器為主振源,通過變換得到所需要的各種頻率成分,分頻器是一種主要變換手

4、段。,f = 1Hz: C=1F,L=25mH,10,2的冪次方分頻器,Fclk/2,Fclk/4,Fclk/8,Fclk/16,11,整數(shù)分頻(非2的冪),10分頻器,10進(jìn)制計數(shù)器,12,10倍分頻器,Library ieee; Use ieee.std_logic_1164.all; Use ieee.std_logic_unsigned.all; Entity ClkDiv Is port( clkin: In std_logic; clkout: out std_logic ); End;,13,10倍分頻器,Architectue bhv of clkdiv is signal c

5、nt: integer range 9 downto 0; Begin Process (clkin) Begin If (clkinEvent And clkin=1) then if (cnt = 9) then cnt = 0; else cnt = cnt +1; end if; End if; End Process;,14,10倍分頻器,Process (clkin, cnt) Begin if (cnt = 4) then clkout = 1; else clkout = 0; end if; End Process; End bhv;,cnt=0,1,2,3,4輸出1,15,

6、10倍分頻器,十進(jìn)制計數(shù)器,輸出控制,16,10倍分頻器_經(jīng)DFF輸出,Process (clkin, cnt) Begin If (clkinEvent And clkin=1) then if (cnt = 4) then clkout = 1; else clkout = 0; end if; End if; End Process; End bhv;,Clkout經(jīng)DFF鎖存輸出,17,10倍分頻器_DFF輸出,18,元件(Component),層次圖,TopModule,SubModule1,SubModule0,信號流圖,Top.vhd,cnt60.vhd,cnt60.vhd,cn

7、t24.vhd,時 分 秒,cnt60.vhd,cnt60.vhd,1Hz,?,?,cnt24.vhd,19,Cnt24.vhd,LIBRARY ieee; USE ieee.std_logic_1164.ALL; USE ieee.std_logic_unsigned.ALL; Entity cnt24 is port ( CLK: in std_logic; CY : out std_logic; CNT: out std_logic_vector(7 downto 0) ); End;,功能:1 實現(xiàn)12小時計數(shù)并輸出計數(shù)結(jié)果, 2 產(chǎn)生低位至高位的進(jìn)位信號,20,Cnt24.vhd,A

8、rchitecture a of cnt24 is Signal icnt : std_logic_vector(7 downto 0); Begin process( clk ) begin if (clkevent and clk = 1) then if(icnt = x23) then icnt = x00; elsif(icnt(? downto 0) = 9 ) then icnt = icnt + 7; else icnt = icnt + 1; end if; if(icnt = x23) then cy = 1; else cy = 0; end if; end if; CN

9、T = iCNT; end process; End a;,Cnt60.vhd?,21,Top.vhd,功能:1 實現(xiàn)子模塊間的互聯(lián),進(jìn)而形成一個功能完整的數(shù)字系統(tǒng) 2 接收外部信號 3 將信息處理的結(jié)果輸出,LIBRARY ieee; USE ieee.std_logic_1164.ALL; Entity Top is port (CLK : in std_logic; Hour : out std_logic_vector(7 downto 0); Min : out std_logic_vector(7 downto 0); Sec : out std_logic_vector(7 do

10、wnto 0) ); End;,22,Top.vhd,Architecture a of Top is Component cnt24 is port ( CLK: in std_logic; CY : out std_logic; CNT: out std_logic_vector(7 downto 0) ); End Component; Component cnt60 is port ( CLK: in std_logic; CY : out std_logic; CNT: out std_logic_vector(7 downto 0) ); End Component ;,23,To

11、p.vhd,Signal SCY , MCY : std_logic; Begin SecCNT : CNT60 PORT MAP (CLK, SCY, SEC); MinCNT : CNT60 PORT MAP (SCY, MCY, MIN); HourCNT : CNT24 PORT MAP (MCY, OPEN, HOUR); End a;,24,Cnt12_24.vhd,功能:1 可預(yù)置時間, 2 12/24小時計時通用,Architecture a of cnt24 is Signal icnt : std_logic_vector(7 downto 0); Begin proces

12、s( clk ) begin if (clkevent and clk = 1) then if(icnt = x23) then icnt = x00; elsif(icnt(3 downto 0) = 9 ) then icnt = icnt + 7; else icnt = icnt + 1; end if; cnt = icnt; end process; End a;,CLK,Load,12/24 HourCnt,PreData,CNT(7:0),25,Cnt12_24.vhd,LIBRARY ieee; USE ieee.std_logic_1164.ALL; USE ieee.s

13、td_logic_unsigned.ALL; Entity cnt12_24 is Generic (Mode : integer := 12); port ( CLK, Load : in std_logic; PreData : in std_logic_vector(7 downto 0); CNT : out std_logic_vector(7 downto 0) ); End;,功能:1 可預(yù)置時間, 2 12/24小時計時通用,26,Cnt12_24.vhd,process( clk , load, predata ) begin if (clkevent and clk = 1

14、) then if(Load = 1) then icnt = PreData; elsif(Mode = 24 and icnt = x23) then icnt = x00; elsif(Mode = 12 and icnt = x12) then icnt = x01; elsif(icnt(3 downto 0) = 9 ) then icnt = icnt + 7; else icnt = icnt + 1; end if; end if; cnt = icnt; end process;,能滿足用戶設(shè)置計時模式要求?,27,Cnt12_24.vhd,Signal SCY , MCY : std_logi

溫馨提示

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

最新文檔

評論

0/150

提交評論