约翰逊计数器实验报告含截图及源代码

上传人:s9****2 文档编号:507883303 上传时间:2022-12-17 格式:DOCX 页数:14 大小:275.14KB
返回 下载 相关 举报
约翰逊计数器实验报告含截图及源代码_第1页
第1页 / 共14页
约翰逊计数器实验报告含截图及源代码_第2页
第2页 / 共14页
约翰逊计数器实验报告含截图及源代码_第3页
第3页 / 共14页
约翰逊计数器实验报告含截图及源代码_第4页
第4页 / 共14页
约翰逊计数器实验报告含截图及源代码_第5页
第5页 / 共14页
点击查看更多>>
资源描述

《约翰逊计数器实验报告含截图及源代码》由会员分享,可在线阅读,更多相关《约翰逊计数器实验报告含截图及源代码(14页珍藏版)》请在金锄头文库上搜索。

1、 西 安 邮 电 大 学 (电子工程学院)VerilogHDL试验汇报试验名称: 约翰逊计数器 专业名称: 集成电路与集成系统班 级: 电路1501 学生姓名: 张璐学号(8位): 05156033 试验日期: 一、 功能描述二、 设计方案三、验证方案四、 设计代码(一)约翰逊计数器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(pose

2、dgeb)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

3、 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)

4、,.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; endmodule测试模块代码:module test_ser_par; reg 7:0 data; wire data_in; reg clock, reset;wire 7:0 out;initial begin cloc

5、k = 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); endmodule五、 仿真成果分析(一)约翰逊计数器(二)串并变换电路六、试验心得

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 办公文档 > 解决方案

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号