VHDL与数字电路设计课件.ppt

VHDL与数字电路设计课件.ppt

此“教育”领域文档为创作者个人分享资料,不作为权威性指导和指引,仅供参考
  1. 1、本文档共200页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
我們曾舉過一個二輸入的與門電路的例子: Library ieee; Use ieee.std_logic_1164.all; Entity and2 is Port(d1,d2 : in std_logic; op : out std_logic); End and2; Architecture m1 of and2 is Begin op= ‘1’ when(d1=’1’ and d2=’1’)else ‘0’; End m1; Library ieee; Use ieee.std_logic_1164.all; Entity mux is Port(a,b,c : in bit; p1,p2 : in bit z : out bit); End and2; Architecture m1 of mux is Begin z= a when p1=‘1’ else b when p2=‘1’ else c; End m1; 允許有重疊 三、選擇式信號設置語句:With-Select-When With expression Select 賦值目標=運算式 When constant_value1 運算式 When constant_value2 … 運算式 When Others; 選擇式信號設置語句本身不能在進程中應用其功能與進程中 的CASE語句相同。 例:不允許有重疊現象;必須含蓋所有條件 Architecture m2 of and2 is Signal tmp : std_logic_vector(1 down to 0); Begin tmp=d1 d2; With tmp select f=’1’ when “11”; ‘0’ when others; End m2; When-else語句和With-select-When語句的差別 兩個語句的關鍵不同是:對於條件的要求程度不同,前者 要求較松,後者要求嚴格。 a With-select-When語句中When後的constant_value必須 是互不相同的; b 而When-else語句中When後的logic_expression則不需要這樣 的嚴格條件,因為其When後的logic_expression的優先權次序 為由先到後排列。 4.3 進程語句(process) Process 語句的格式為: [進程標號:] Process [(敏感信號列表)] [變數聲明] Begin 順序語句; End Process [進程標號]; 敏感表(Sensitivity list)包括進程的一些信號,當敏感表中的某個信號變化時進程才 被啟動,進程內的順序語句被執行。當進程結束時,進程內的輸出信號值被更新, 進程進入等待(睡眠)狀態,直到敏感表中的某一信號發生變化,進程被再次啟動。? 下麵舉一個應用示例,如下面電路: 用用不同VHDL語句對電路的描述如下: library ieee; use ieee.std_logic_1164.all; Entity exam1 is Port (a,b : in std_logic; c,d : out std_logic); End exam1; Architecture m1 of exam1 is Begin c=a and b; d=a or b ; End m1; architecture m2 of exam1 is begin process begin c=a and b; d= a or b ; end process; end m2; architecture m2 of exam1 is begin process begin c=a and b; d= a or b ; end process; end

文档评论(0)

子不语 + 关注
官方认证
服务提供商

平安喜乐网络服务,专业制作各类课件,总结,范文等文档,在能力范围内尽量做到有求必应,感谢

认证主体菏泽喜乐网络科技有限公司
IP属地山东
统一社会信用代码/组织机构代码
91371726MA7HJ4DL48

1亿VIP精品文档

相关文档