




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)
文檔簡介
2.4VHDL主要描述方式VHDL主要描述方式(1)行為描述方式(2)數(shù)據(jù)流描述方式(3)結(jié)構(gòu)描述方式(4)混合描述方式(略)行為描述方式特點:常以算法形式描述電路功能,不體現(xiàn)電路結(jié)構(gòu)。用于系統(tǒng)數(shù)學模型的仿真或者系統(tǒng)工作原理的仿真。大量采用算術(shù)運算、關(guān)系運算等。例:全加器libraryieee;useieee.std_logic_1164.all;entityFAisport(x,y,ci:instd_logic;s,co:outstd_logic);endFA;architecturebehavofFAis行為描述方式
beginprocess(x,y,ci)variablen:integer;constantsum_vector:std_logic_vector(0to3):=“0101”;constantcarry_vector:std_logic_vector(0to3):=“0011”;beginn:=0;ifx=’1’thenn:=n+1;endif;ify=‘1’thenn:=n+1;endif;ifci=’1’thenn:=n+1;endif;s<=sum_vector(n);co<=carry_vector(n);endprocess;endbehav;此為查表法數(shù)據(jù)流描述方式
特點:既表示行為,又隱含著結(jié)構(gòu);體現(xiàn)數(shù)據(jù)的流動路徑和方向
例:全加器entityFAisport(…..);endFA;architecturedataflowofFAissignals:std_logic;begins<=xXORyXORci;co<=(xANDy)OR(xANDci)OR(yANDci);enddataflow;
特點:描述電路元件與它們之間的連接關(guān)系
結(jié)構(gòu)描述方式半加器
LibraryIEEE;Usestd_logic_1164.all;Entityhalf_adderisport(X,Y:inbit;sum,carry:outbit);endhalf_adder;Architecturedataflowofhalf_adderisbegin--并行處理語句
sum<=XxorYafter10ns;carry<=XandYafter10ns;Enddataflow;全加器
LibraryIEEE;Usestd_logic_1164.all;Entityfull_adderis Port(A,B,carry_in:inbit;AB,carry_out:outbit);Endfull_adder;Architecture
structureoffull_adderis
Signaltemp_sum:bit;--定義語句
Signaltemp_carry1:bit;
Signaltemp_carry2:bit;
Componenthalf_adderPort(X,Y:inbit;sum,carry:outbit);Endcomponent;
Componentor_gatePort(in1,in2:inbit;out1:outbit);Endcomponent;全加器Begin--并行語句U0
:half_adder元件例化語句
Portmap(X=>A,Y=>B,sum=>temp_sum,carry=>temp_carry1);名稱映射U1
:half_adderPortmap(X=>temp_sum,Y=>carry_in,sum=>AB,carry=>temp_carry2);U2:or_gatePortmap(in1=>temp_carry1,in2=>temp_carry2,out1=>carry_out);Endstructure;層次化設計結(jié)構(gòu)描述寫出位置映射。元件例化語句Component元件名
Generic說明;
Port說明;
EndComponent;Component語句用于Architecture、Package、Block說明語句中。標號名:元件名portmap(信號,…);位置映射和名稱映射練習題請寫出下列組合邏輯的結(jié)構(gòu)描述方式entityAnd2isport(x,y:inbit;z:outbit);endAnd2;architectureex1ofAnd2isbeginz<=xandy;endex1;先寫與門(底層)entityOr2isport(x,y:inbit;z:outbit);endentityOr2;architectureex1ofOr2isbeginz<=xory;endarchitectureex1;再寫或門(底層)entityNot1isport(x:inbit;z:outbit);endentityNot1;architectureex1ofNot1isbeginz<=notx;endarchitectureex1;再寫非門(底層)entitycomb_functionis port(a,b,c:inbit;z:outbit);endentitycomb_function;
architecturenetlistofcomb_functionis
componentAnd2is port(x,y:inbit;z:outbit); endcomponentAnd2; componentOr2is port(x,y:inbit;z:outbit); endcomponentOr2; componentNot1is port(x:inbit;z:outbit); endcomponentNot1;
signalp,q,r:bit;最后按層次化寫頂層模塊beging1:Not1
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
- 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 8 數(shù)學廣角-數(shù)與形 第一課時(教學設計)-2024-2025學年六年級上冊數(shù)學人教版
- 12 低碳生活每一天 第二課時 教學設計-2023-2024學年道德與法治四年級上冊統(tǒng)編版
- Module 4單元整體(教學設計)-2024-2025學年外研版(三起)英語四年級上冊
- 聘用人員 合同范本
- 英文合同范本甲方全稱
- 門店住宅改造合同范本
- Module 6 Unit 1 You can play football well(教學設計)-2024-2025學年外研版(三起)英語五年級上冊
- 12 家鄉(xiāng)的喜與憂2023-2024學年四年級下冊道德與法治同步教學設計(統(tǒng)編版)
- 2024年九年級數(shù)學中考專題-相似系列之一線三等角 教學設計
- 4 選舉產(chǎn)生班委會 教學設計-2023-2024學年道德與法治五年級上冊統(tǒng)編版
- 初三開學第一課家長會優(yōu)秀課件兩篇
- 馬工程教材《公共財政概論》PPT-第十四章 國際財政
- 獅子王1中英文臺詞
- 《大學俄語》教學大綱
- 清淤工程施工記錄表
- TCITSA 24-2022 基于ETC的高速公路自由流收費技術(shù)規(guī)范
- 2022年涉農(nóng)領(lǐng)域涉嫌非法集資風險專項排查工作總結(jié)
- 起重裝卸機械操作工國家職業(yè)技能標準(2018年版)
- 五年級下冊美術(shù)課件-第2課 新街古韻丨贛美版
- 秦荻輝科技英語寫作教程練習答案(共42頁)
- GB∕T 41168-2021 食品包裝用塑料與鋁箔蒸煮復合膜、袋
評論
0/150
提交評論