空间科学与应用研究中心_第1页
空间科学与应用研究中心_第2页
免费预览已结束,剩余4页可下载查看

付费下载

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、Assignment1. Design an 8-bit upand downsynchronouscounter inVHDLwith thefollowing(1) The same portsAssignment1. Design an 8-bit upand downsynchronouscounter inVHDLwith thefollowing(1) The same ports are used for signals to be inputted and outputted. The ports are bi-directionally buffered (three-s(2

2、) The counter is with an asynchronous t assigns a specific initial value (3) The counter is synchronous data load control input for a new value of and an enable control input for allowing the up and down counting. The load input has a priority over the enable control input. This t when the operation

3、 isin sthe counter operationis(4) Some ypes, such as STD_LOGIC, UNSIGNED, SIGNED EGER, may Synthesize the design. Create a set of reasonable input waveforms for your design completeboth behavioral t-place&routesimulationsernalsignalsand/orincluded in waveformorlist 1、题目使用VHDL-所inout 8 bit reset 端口、l

4、oad 端口,load 先级比enable即 counterenable8 bit 8bit2、程序2、程序library use use entitycounter_bidirport inininstd_logic; up_down: instd_logic; incnt_inout: inoutstd_logic_vector(7downtoend architectureBehavioralofcounter_bidirsignalcnt_in: std_logic_vector(7downtosignalcnt_out:std_logic_vector(7downto0); 3、Te

5、st -signaloe:3、Test -signaloe:std_logic:=0; signalload:std_logic :=load0,cnt_inout 为输出enable=currenttime:400ns wait for 300 ns;load=-当 t_inout作为输入时(把 t_inoutcnt_incnt为高阻状态-否则,即cnt_inout作为输出时(把 t_out(即计数器计数输出值)-end s(load,cnt_out,cnt_inout) if (load=1) cnt_inoutZ); cnt_in = cnt_inout;cnt_inout=cnt_ou

6、t; end if;end -counter_control: s(clk,-当复位信号rst=1,cnt_out否则在时钟的上升沿检测 t_inout-当作为输入时load=1 ), 把cnt_in中的数取进来-end s(clk,rst) if (rst = 1)cnt_out0);elsif rising_edge(clk)if (load = 1) thencnt_out = cnt_in; elsif(enable=1) thenif (up_down = 0) then cnt_out=cnt_out+1;cnt_out=cnt_out-1; end if;endif; end if;end 4功能仿真(前仿4功能仿真(前仿真根据TestBench进入程序之后,首先复位,这时cnt_out 0 4 之后,把 cnt_inout 变成了输入信号,并且给其赋了10000011;在load 加载该值之后,200ns 之后将cnt_inoutcnt_inout131100ns129(时50 ns),然后遇到了up_down=0,开始做递增。5、ISim 时序仿真(后仿真在ISE Prope PropertiesFPGA,仿真器(Simulator)选择为“ISim在仿真(Simulation)下拉列表中,选择在ISim在后仿真的波形中,可以看到输出(输入)信号cnt

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论