- 1、本文档共24页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 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
您可能关注的文档
- 超声波热量表格原理及应用.docx
- 超声波风速风向仪设计.docx
- 超声测距系统设计开题报告计划.docx
- 超声科主任述职报告计划.docx
- 超声科医生出科小结.docx
- 超声科十八项核心制度解读.docx
- 超声科图像质量评价表格.docx
- 超声科图像质量评价表格范例.docx
- 超声科考核标准.docx
- 超声科规章制度.docx
- 中科院课件-高分子化学-4(2)(活性聚合-1).ppt
- 中海达Hi-RTK操作流程.ppt
- 二年级下册第二单元作文.ppt
- 人教版初中语文七年级《古诗四首》课件.ppt
- 现浇箱梁专项施工方案.doc
- 期末真题分类汇编 一 单项选择题 三年级英语下册 人教精通版(三起)含答案.docx
- 四川省成都市双流区2023-2024学年六年级下学期期末语文试卷.docx
- 河南省驻马店市汝南县2023-2024学年三年级下学期6月期末语文试题.docx
- 四川省德阳市中江县2022-2023学年七年级下学期期末考试英语试题.docx
- 期末押题试卷-2023-2024学年语文四年级下册统编版 (1).docx
文档评论(0)