超大规模集成电路第九次作业秋段成华.docx

超大规模集成电路第九次作业秋段成华.docx

  1. 1、本文档共24页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
精品文档 精品文档 袄 莀肇 薀虿 蚈莂 芄薄 肂羇 艿袀 螈羄 蚅膃 蒀袇 肈膁 袈膂 肆PAGE PAGE24 精品文档 PAGE 超大规模集成电路第九次作业 2016秋-段成华 Assignment9 Designan8-bitupanddownsynchronouscounterinVHDLwiththefollowingfeatures: Thesameportsareusedforsignalstobeinputtedandoutputted.Theportsarebi-directionallybuffered(three-state). Thecounteriswithanasynchronousresetthatassignsaspecificinitialvalueforcounting. Thecounteriswithasynchronousdataloadcontrolinputforanewvalueofcountingandanenablecontrolinputforallowingtheupanddowncounting.Theloadcontrolinputhasapriorityovertheenablecontrolinput.Thisimpliesthatwhentheloadoperationisinprocessthecounteroperationisprohibited. Somedatatypes,suchasSTD_LOGIC,UNSIGNED,SIGNEDandINTEGER,maybeused. Synthesizethedesign.Createasetofreasonableinputwaveformsforyourdesignandcompletebothbehavioralandpost-placeroutesimulationswithinternalsignalsand/orvariablesincludedinwaveformorlistwindows. Solution:代码如下: libraryIEEE; useIEEE.STD_LOGIC_1164.ALL; useIEEE.STD_LOGIC_ARITH.ALL; useIEEE.STD_LOGIC_UNSIGNED.ALL; Uncommentthefollowinglibrarydeclarationifinstantiating anyXilinxprimitivesinthiscode. --libraryUNISIM; --useUNISIM.VComponents.all; entitycount_8_bidiris cnt_out=(others=0); elsif rising_edge(clk)then if(load=1)then cnt_out=cnt_in; elsif(enable=1)then cnt_out=cnt_out+1; else cnt_out=cnt_out-1; endif; endif; endprocess; endBehavioral; 解释代码:这里有两个进程,进程0时是用来控制三态门控制的双向端口。当cnt作为输入时(load=1),把cnt赋给cnt_in(初值装载),然后置cnt为高阻状态;否则,即cnt作为输出时(load=0),把cnt_out(计数器计数输出值)赋给cnt。进程1的作用是:当复位信号rst=1,计数器输出cnt_out为全0,否则在时钟的上升沿检测cnt端口是作为输入还是作为输出,当作为输入时 load=1),把cnt_in中的数取进来,然后当up_down=0时,进行加法运算,否则做减法运算,同时可以和进程0配合当load=0,将数值从cnt_out输出到 cnt。 TestBench代码: LIBRARYieee; USEieee.std_logic_1164.ALL; USEieee.std_logic_unsigned.all; USEieee.numeric_std.ALL; ENTITYcount_8_bidir_tbIS ENDcount_8_bidir_tb; ARCHITECTUREbehaviorOFcount_8_bidir_tbIS ComponentDeclarationfortheUnitUnderTest(UUT)COMPONENTcount_8_bidir PORT( oe:INstd_logic; clk:INstd_logic; rst:INstd_logic; load:INstd_logic; enable:IN std_logic; cnt:INOUT std_logic_vec

文档评论(0)

zdq0037 + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档