约翰逊计数器实验报告含截图及源代码.docx_第1页
约翰逊计数器实验报告含截图及源代码.docx_第2页
约翰逊计数器实验报告含截图及源代码.docx_第3页
约翰逊计数器实验报告含截图及源代码.docx_第4页
约翰逊计数器实验报告含截图及源代码.docx_第5页
已阅读5页,还剩8页未读 继续免费阅读

下载本文档

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

文档简介

。 西 安 邮 电 大 学 (电子工程学院)VerilogHDL实验报告实验名称: 约翰逊计数器 专业名称: 集成电路与集成系统班 级: 电路1501 学生姓名: 张璐学号(8位): 05156033 实验日期: 1、 功能描述2、 设计方案三、验证方案4、 设计代码(一)约翰逊计数器modulecount(reset,clk,out);inputreset,clk;outputout;reg7:0out;reg 23:0c;reg b;always(posedgeclk)begin if(reset)c=0;else begin c=c+1b1; b=c23;endendalways(posedgeb)beginif(reset)out=8b0;elsebeginout0=out7;out7:1=out6:0;endendendmodule/激励文件modulesti;regclk,reset;wire7:0out;counttest(reset,clk,out);initialclk=8b0;always#10clk=clk;initialbeginreset=1;#50reset=0;end Endmodule(二)串并变换电路 功能模块代码:module counter_mod_8(clock,reset,Q); input clock; /posedge effective input reset; / negedge effective output 2:0 Q;reg 2:0 Q;always(posedge clock or negedge reset) begin if(reset)Q = 3d0; elseQ = Q + 1;endendmodule串转并模块:module ser_to_par_8bit(ser_in,clk,rst,out); input ser_in,clk,rst;output 7:0 out;wire 7:0out;reg7:0par_out;wire 2:0count;counter_mod_8 f1(.clock(clk),.reset(rst),.Q(count);always(posedge clk or negedge rst) begin if(rst)par_out = 8b0000_0000; else beginpar_out = par_out6:0,ser_in;endendassign out = (count = 7)? par_out : 8b0000_0000; endmodule1313。测试模块代码:module test_ser_par; reg 7:0 data; wire data_in; reg clock, reset;wire 7:0 out;initial begin clock = 1b0; reset = 1b0; #3 reset = 1b1;data = 8b1001_1101; #300 $stop;endalways#5clock = clock; always(posedge clock)data =data6:0,data7; assign data_in = data7;ser_to_par_8bit a(.ser_in(data_in),.clk(clock),.rst(reset),.out(out);initial$monitor($time,reset= %b,data= %b,data_in= %b,out= %b,reset,data,data_in,out); endmodule5、 仿

温馨提示

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

评论

0/150

提交评论