实验7-取指令与指令译码实验

上传人:日度 文档编号:145971459 上传时间:2020-09-25 格式:DOC 页数:6 大小:139KB
返回 下载 相关 举报
实验7-取指令与指令译码实验_第1页
第1页 / 共6页
实验7-取指令与指令译码实验_第2页
第2页 / 共6页
实验7-取指令与指令译码实验_第3页
第3页 / 共6页
实验7-取指令与指令译码实验_第4页
第4页 / 共6页
实验7-取指令与指令译码实验_第5页
第5页 / 共6页
点击查看更多>>
资源描述

《实验7-取指令与指令译码实验》由会员分享,可在线阅读,更多相关《实验7-取指令与指令译码实验(6页珍藏版)》请在金锄头文库上搜索。

1、实验报告 2018 年 5 月 5 日 成绩: 姓名阳光男学号16041321班级16052317专业计算机科学与技术课程名称计算机组成原理与系统结构试验任课老师张翔老师指导老师张翔老师机位号默认实验序号7实验名称实验七 取指令与指令译码实验实验时间2018/5/30实验地点1教211实验设备号个人电脑+Nexy3开发板 一、实验程序源代码顶层电路:module top(input clk,input rst,input 1:0C,output reg7:0LED);wire 31:0Inst_code;pc pc_test(clk,rst,Inst_code);always(*)begin

2、case(C) 2b00:LED=Inst_code7:0; 2b01:LED=Inst_code15:8; 2b10:LED=Inst_code23:16; 2b11:LED=Inst_code31:24;endcaseendendmodulePC取指令电路module pc(input clk,input rst,output wire31:0Inst_code);reg 31:0PC;wire31:0PC_new;initialPC=32h00000000;Inst_ROM Inst_ROM1 ( .clka(clk), .addra(PC7:2), .douta(Inst_code)

3、);assign PC_new=PC+4;always(posedge rst or negedge clk)beginif(rst)PC=32h00000000;elsePC=24h000000,PC_new7:0;endendmodule测试代码:module test;/ Inputsreg clk;reg rst;/ Outputswire 31:0 Inst_code;/ Instantiate the Unit Under Test (UUT)pc uut (.clk(clk), .rst(rst), .Inst_code(Inst_code);initial begin/ Ini

4、tialize Inputsclk = 0;rst = 0;/ Wait 100 ns for global reset to finish#100;clk = 1;rst = 0;#100;clk = 0;rst = 0;#100;clk = 1;rst = 0;#100;clk = 0;rst = 0;#100;clk = 1;rst = 0;#100;clk = 0;rst = 0;#100;clk = 1;rst = 0;#100;clk = 0;rst = 0;/ Add stimulus hereend endmodule二、仿真波形三、电路图 顶层电路模块 顶层电路内部结构:四、

5、引脚配置(约束文件)NET LED7 LOC = T11;NET LED6 LOC = R11;NET LED5 LOC = N11;NET LED4 LOC = M11;NET LED3 LOC = V15;NET LED2 LOC = U15;NET LED1 LOC = V16;NET LED0 LOC = U16;NET C1 LOC = T9;NET C0 LOC = T10;NET clk LOC = D9;NET rst LOC = C9;五、思考与探索R0 (r0) = 00000000 R8 (t0) = 00007000 R16 (s0) = fffffff0 R24 (t

6、8) = 00000000R1 (at) = ffffffff R9 (t1) = ffff8fff R17 (s1) = 00000010 R25 (t9) = 00000000R2 (v0) = 00000001 R10 (t2) = ffff8ffe R18 (s2) = 70000000 R26 (k0) = 00000000R3 (v1) = 00000002 R11 (t3) = 00006ff2 R19 (s3) = 00020000 R27 (k1) = 00000000R4 (a0) = 00000003 R12 (t4) = ffff900e R20 (s4) = 80000000 R28 (gp) = 00000000R5 (a1) = 00000005 R13 (t5) = ffff800e R21 (s5) = 00000000 R29 (sp) = 7ffff364R6 (a2) = 00000007 R14 (t6) = ffff9fff R22 (s6) = 00000000 R30 (s8) = 00000000R7 (a3) = 0000000e R15 (t7) = 0000000f R23 (s7) = 00000000 R31 (ra) = 00000000

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

当前位置:首页 > 大杂烩/其它

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