【计组实验】P2 Modelsim Verilog单周期处理器开发 MIPS指令集
一點心得:
如果遇到不會的題,可以看著別人的代碼,比著抄一遍(不要直接復(fù)制粘貼),抄的同時盡量理解每句代碼的含義。如果看不懂某句代碼,(覺得這句沒有用),可以跳過這句不寫,按照自己的思路繼續(xù)。
如果之后沒有出現(xiàn)問題,就不用管之前跳過的那句了;如果寫著寫著發(fā)現(xiàn)自己的思路行不通,再回去看別人的代碼,大多數(shù)時候會發(fā)現(xiàn):剛才跳過的那句,恰好能解決現(xiàn)在遇到的問題
一定要動手操作,不能只看書/答案
更新中,指令已完成,打包文件中含有執(zhí)行的完整指令(經(jīng)過MARS驗證)以及所有代碼。
最后一次修改時間:2019-4-20 14:59:34
最近一次代碼+指令打包:
鏈接: https://pan.baidu.com/s/1EK9ArGvEcTTlDLyVs9hPMw
提取碼: y6kv
心得
雖說Verilog是一種類C的語言,但絕不能用C語言的思想學(xué)習(xí)Verilog,尤其是注意時序問題。比如說關(guān)于<=賦值與=賦值,以及always與assign的區(qū)別,在初學(xué)的時候及易出錯。在使用Verilog設(shè)計處理器時,一定要理解并行與串行的區(qū)別,(在這次設(shè)計中,我改過的bug大多數(shù)是因為時序問題)
另外,已經(jīng)過MARS運行對比,能夠正確執(zhí)行以下命令↓
ModelSim打開已建立過的工程
File -> Open
在彈出的窗口中,文件類型選.mpf
然后路徑指到工程所在文件夾,選擇建立的.mpf文件即可
- 以下代碼為舊版,最新版在上面的網(wǎng)盤鏈接中
ALU
alu.v
關(guān)于Result為什么是reg類型:
解釋:在always塊中,如果要對某個端口賦值。需要把這個端口定義為reg格式。因為被賦值,所以為輸出口。
alu_tb.v
`timescale 1ns/1ns //仿真時間單位/時間精度 `include "alu.v" module ALU_tb;reg [31:0] A;reg [31:0] B;reg [4:0] sl; //左移的位數(shù)reg [2:0] ALUctr; //3位ALU控制信號wire [31:0] Result; //輸出端口不能定義為reg型wire zero; //零標志位ALU myalu(A,B,sl,ALUctr,Result,zero);always #5 A<=A+1;initialbegin A=0;B=0;sl=0;ALUctr=3'b010;#5 B<=1; //因為begin-end是串行,實際上是第5+5ns開始對b賦值endinitialbegin$monitor($time,,"%d + %d = %d",A,B,Result);#100$finish;end endmodule仿真效果
"testbench.v"中,定義ALUctr=3'b010,測試ALU的加法功能。
點擊紅色剪頭指示的按鈕,可以自動將時間線移動到下一個最近的波形變化邊沿??梢钥闯?#xff0c;每5ns,A的值增加1,B的值不變,Result=a+b,Result值增加一。
溢出的后果檢測
給A賦初值(16進制)fffffff0,將textbench修改為如下:
alu_tb.v
`timescale 1ns/1ns //仿真時間單位/時間精度 `include "alu.v" module ALU_tb;reg [31:0] A;reg [31:0] B;reg [4:0] sl; //左移的位數(shù)reg [2:0] ALUctr; //3位ALU控制信號wire [31:0] Result;wire zero; //零標志位ALU myalu(A,B,sl,ALUctr,Result,zero);always #2 A<=A+1;initialbegin A=32'hffff_fff0;B=0;sl=0;ALUctr=3'b010;#0 B<=1; //因為begin-end是串行,實際上是第5+5ns開始對b賦值endinitialbegin$monitor($time,,"%d + %d = %d",A,B,Result);#100$finish;end endmodule溢出仿真效果
看下面的控制臺輸出。溢出后再次從0開始。
IM指令寄存器
指令寄存器用于寄存指令。將指令從code.txt中讀入到im中,然后可以按地址輸出。
im.v
im_tb.v
按照不同的地址分別輸出每一條指令。
`timescale 1ns/1ns //仿真時間單位/時間精度 `include "im.v" module IM4k_tb;reg [31:0]addr;wire[5:0]op;//接收來自被測模塊的輸出 用導(dǎo)線連接wire[4:0]rs;wire[4:0]rt;wire[4:0]rd;wire[4:0]shamt;wire[5:0]func;wire[15:0]immediate16;//addresswire[25:0]immediate26;//J指令 26位跳轉(zhuǎn)地址IM_4k myim(addr,op,rs,rt,rd,shamt,func,immediate16,immediate26);always #5 addr<=addr+4;initial addr=0;//不能給wire型變量賦值initialbegin$monitor($time,,"addr = %d, code = %b%b%b%b%b%b",addr,op,rs,rt,rd,shamt,func);#100$finish;end endmodule仿真結(jié)果
txt文檔中是預(yù)期結(jié)果,控制臺輸出是實際結(jié)果。通過對比,兩個結(jié)果相同。
PC+NPC
pc.v
//輸入:NPC代表的下一條指令的地址 //輸出:"下一條指令" 即 "當前指令"。如果不reset,則根據(jù)clk輸出當前指令PC的地址 `timescale 1ns / 1ns module PC( input [31:0] NPC, //NextPC計算單元input clk, //時鐘信號input reset, //復(fù)位output reg [31:0] PC //輸出下一條指令的地址);initialbeginPC <= 0000_0000; //為什么別人寫的是 32'h00003000?endalways@(posedge clk, posedge reset)//任何一個變動都可以觸發(fā)beginif(reset) PC <= 0000_0000;//為什么別人寫的是 32'h00003000?else PC <= NPC;end endmodulenpc.v
//計算下一條指令的地址 //輸入的PC是當前指令的地址 //輸出的NPC是下一條指令的地址 module NextPC(input [31:0] PC,input [31:0] imm16, //beqinput [25:0] imm26, //j,jalinput [31:0] rsd, //jr跳轉(zhuǎn)至寄存器input branch_ctr,input j_ctr,input jr_ctr,output reg [31:0] NPC, //下一條指令的地址output [31:0] jalPC //jal跳轉(zhuǎn)的地址);assign jalPC = PC + 4;always @(*)beginif(j_ctr) NPC <= {PC[31:28], imm26, 2'b0};//j指令else if(jr_ctr) NPC <= rsd;//jr指令else if(branch_ctr) NPC <= PC + 4 + $signed(imm16<<2);//beq指令,branch判斷是否執(zhí)行分支else NPC = PC + 4;end endmodulepc_npc_tb
debug改出來的,不明白為什么NPC是是wire類型,而不是reg類型
//用于測試pc和npc `timescale 1ns/1ns //仿真時間單位/時間精度 `include "pc.v" `include "npc.v"module pc_npc_tb;wire [31:0] NPC; //下一條指令的地址,不明白為什么是wire類型而不是regreg clk;reg reset;reg [31:0] imm16; //beqreg [25:0] imm26; //j,jalreg [31:0] rsd; //jr跳轉(zhuǎn)至寄存器的寄存器值reg branch_ctr;reg j_ctr;reg jr_ctr;wire [31:0] pc;wire [31:0] jalPC; //jal跳轉(zhuǎn)的地址PC mypc(NPC, clk, reset, pc);NextPC mynextpc(pc, imm16, imm26, rsd, ranch_ctr, j_ctr, jr_ctr,NPC,jalPC);always #5 clk = ~clk;//initial NPC=0;initial clk=0;initial reset=0;initial imm16=0; initial imm26=0; initial rsd=0; initial branch_ctr=0; initial j_ctr=0; initial jr_ctr=0;initialbegin$monitor($time,,"NPC = %d, PC = %d",NPC, pc);#100$finish;end endmodule仿真結(jié)果
testbench里只是5ms改變一次clk,沒有做其他測試,該測試僅可以看出PC可以正常執(zhí)行PC+4。波形如下:
以下為完整代碼:
MIPS.v
`timescale 1ns/1nsmodule mips(input clk,input reset);//以下是每個模塊的輸出//Control控制單元wire [1:0]RegDst; //寫寄存器的目標寄存器號來源:0-rt 1-rdwire ALUSrc; //第二個ALU操作數(shù)的來源 :0-讀寄存器2 1-指令低16位的符號拓展wire [1:0] MemToReg; //寫入寄存器的數(shù)據(jù)來源wire RegWrite; //寄存器寫使能有效wire MemWrite; //將數(shù)據(jù)寫入到指定存儲器單元中wire PCSrc; //判斷是否執(zhí)行分支(PC+4 or PC+4+offset)wire [1:0]ExtOp; //控制Extender的拓展方式wire [2:0]ALUctr; //3bit 控制ALU的運算wire j_ctr; //控制PC是否轉(zhuǎn)移到J指令指示的地址wire jr_ctr; //jr指令wire DMSrc;wire [15:0]immediate16;//addresswire [25:0]immediate26;//J指令 26位跳轉(zhuǎn)地址//IM指令存儲器wire [5:0] opcode;wire [4:0] rs;wire [4:0] rt;wire [4:0] rd;wire [5:0] shamt;wire [5:0] func;//GPR寄存器堆wire [31:0] rd1; //讀出的數(shù)據(jù)1wire [31:0] rd2; //讀出的數(shù)據(jù)2//DM數(shù)據(jù)存儲器wire [31:0] dout; //讀出的數(shù)據(jù)//ALU算數(shù)邏輯單元wire [31:0] Result;wire zero;//Ext拓展單元wire [31:0] EXTout;//MUX多路選擇器wire [31:0] DataToDM;wire [31:0] DataToALU;wire [31:0] RegWriteData;wire [4:0] RegWriteAddress;//NPCwire [31:0] NPC; //下一條指令的地址wire [31:0] jalPC; //jal跳轉(zhuǎn)的地址//PCwire [31:0] PC; //PC輸出下一條指令的地址//以下是各個模塊的實例化 就是用導(dǎo)線把他們接在一起 注意函數(shù)參數(shù)要與上方的輸出相同 否則會出現(xiàn)變量未定義的問題control Control(opcode[5:0],zero,func[5:0],RegDst[1:0],ALUSrc,MemToReg[1:0],RegWrite,MemWrite,PCSrc,ExtOp[1:0],ALUctr[2:0],j_ctr,jr_ctr,DMSrc);/*opcode[5:0],zero, //beq指令func[5:0],RegDst[1:0], //寫寄存器的目標寄存器號來源:0-rt 1-rdALUSrc, //第二個ALU操作數(shù)的來源MemToReg[1:0], //寫入寄存器的數(shù)據(jù)來源RegWrite, //寄存器寫使能有效MemWrite, //將數(shù)據(jù)寫入到指定存儲器單元中PCSrc, //判斷是否執(zhí)行分支(PC+4 or PC+4+offset)ExtOp[1:0], //控制Extender的拓展方式ALUctr[2:0], //3bit 控制ALU的運算j_ctr, //控制PC是否轉(zhuǎn)移到J指令指示的地址jr_ctr, //jr指令DMSrc*/IM_4k im (PC,opcode[5:0],rs[4:0],rt[4:0],rd[4:0],shamt[4:0],func[5:0],immediate16[15:0],immediate26[25:0]);/*addr[31:0], //輸入 與上一個模塊以導(dǎo)線相連 要取出的指令地址op[5:0], //輸出 6位操作碼oprs[4:0], //輸出 源1rt[4:0], //輸出 源2rd[4:0], //輸出 目的shamt[4:0], //只用于移位指令sllfunc[5:0], //指出ALU的功能immediate16[15:0], //addressimmediate26[25:0] //J指令 26位跳轉(zhuǎn)地址*/GPR gpr (PC,clk,reset,RegWrite,rs[4:0],rt[4:0],RegWriteAddress,RegWriteData,rd1[31:0],rd2[31:0]);/*WPC[31:0], //writePCclk,reset,RegWrite, //寄存器寫使能ra1[4:0], //ReadAddress1ra2[4:0], //ReadAddress2wa[4:0], //RegWriteAddresswd[31:0], //WriteDatard1[31:0], //ReadData1rd2[31:0] //ReadData2*/dm_4k dm (PC[31:0],Result[31:0],DataToDM[31:0],MemWrite,clk,reset,dout[31:0]);/*pc[31:0], //僅用于控制臺輸出看著方便addr[31:0], //地址din[31:0], //datainMemWrite, //寫使能clk,reset,dout[31:0] //dataout*/ALU Alu (rd1[31:0],DataToALU,5'b0,ALUctr[2:0],Result[31:0],zero);/*A[31:0], //輸入32位AB[31:0], //輸入32位Bsl[4:0], //左移的位數(shù) sl是移位指令 沒用ALUctr[2:0], //3位ALU控制信號Result[31:0], //因為要在always里面賦值,所以定義為regzero //零標志位*/EXT ext (immediate16[15:0],ExtOp[1:0],EXTout[31:0]);/*EXTin[15:0], //輸入EXT的數(shù)據(jù)ExtOp[1:0],EXTout[31:0] //拓展后輸出的數(shù)據(jù)*///計算寫入DM的數(shù)據(jù)mutiplexer32_1 MuxDataToDM(DMSrc,rd2[31:0],32'b0,DataToDM);//計算參與運算的ALU數(shù)據(jù)2mutiplexer32_1 MuxDataToALU(ALUSrc,rd2[31:0],EXTout,DataToALU);/*control,//ALU數(shù)據(jù)2來源:0-讀寄存器2 1-指令低16位的符號拓展din0 [31:0], //讀寄存器2din1 [31:0], //指令低16位的符號拓展out32_1 [31:0]*///RegWriteData的計算mutiplexer32_2 mux32_2(MemToReg,Result,dout,jalPC,32'b0,RegWriteData);/*control [1:0], //MemToReg: 00ALU運算結(jié)果(包含高16拓展\普通運算) 01數(shù)據(jù)存儲器的輸出 10JAL跳轉(zhuǎn)的目的地址din0 [31:0], //ALU結(jié)果din1 [31:0], //DM輸出din2 [31:0], //JAL跳轉(zhuǎn)目的地址din3 [31:0],//沒用out32_2 [31:0]*///RegWriteAddress的計算 mutiplexer5 mux5(RegDst,rt,rd,5'b11111,RegWriteAddress);/*control [1:0],//Regdst寫寄存器的目標寄存器號來源 0-rt 1-rddin0 [4:0], //rt lui應(yīng)該寫到rtdin1 [4:0], //rddin2 [4:0],out5 [4:0]*/NextPC npc (PC[31:0],immediate16[15:0],immediate26[25:0],rd1[31:0],PCSrc,j_ctr,jr_ctr,NPC[31:0],jalPC[31:0]);/*PC[31:0],imm16[15:0], //beqimm26[25:0], //j,jalrsd[31:0], //jr跳轉(zhuǎn)至寄存器branch_ctr,j_ctr,jr_ctr,NPC[31:0], //下一條指令的地址jalPC[31:0] //jal跳轉(zhuǎn)的地址*/Pc mypc (NPC[31:0],clk,reset,PC[31:0]);/*NPC[31:0], //NextPC計算單元clk, //時鐘信號reset, //復(fù)位PC[31:0] //輸出下一條指令的地址*/endmodulemips_tb
//用于測試整個處理器 `timescale 1ns/1ns //仿真時間單位/時間精度 `include "mips.v"module mips_tb;reg clk;reg reset;mips mymips(clk, reset);always #10 clk = ~clk;initial clk = 0;initialbegin$monitor($time,,"(mips_tb)clk = %b",clk);$display("display is Valid");#2000$finish;endendmodulectrl
//控制單元controller `timescale 1ns/1ns /* ALUOp 3'b000: Result=($signed(A)<$signed(B))?32'h0000_0001:32'h0000_0000;//若A<B,則result=1 3'b001: Result=A|B;//或 3'b010: Result=A+B;//加 3'b011: Result={B[15:0],16'h0000};//拓展到高16位 3'b101: Result=B<<sl;//邏輯左移 3'b110: Result=A-B;//減 3'b111: Result = 32'h0000_0000//defaultEXTOp 2'b00:無符號16to32 2'b01:有符號16to32 2'b10:拓展到高16位 */ module control(input [5:0] opcode,input zero, //beq指令input [5:0] func,output reg [1:0]RegDst, //寫寄存器的目標寄存器號來源:0-rt 1-rdoutput reg ALUSrc, //第二個ALU操作數(shù)的來源output reg [1:0] MemToReg, //寫入寄存器的數(shù)據(jù)來源output reg RegWrite, //寄存器寫使能有效output reg MemWrite, //將數(shù)據(jù)寫入到指定存儲器單元中output reg PCSrc, //判斷是否執(zhí)行分支(PC+4 or PC+4+offset)output reg [1:0]ExtOp, //控制Extender的拓展方式output reg [2:0]ALUctr, //3bit 控制ALU的運算output reg j_ctr, //控制PC是否轉(zhuǎn)移到J指令指示的地址output reg jr_ctr, //jr指令output reg DMSrc);always@(opcode,zero,func)begincase(opcode)6'b000000://addu subu slt jrbeginif(func==6'b100001)//addubeginRegDst = 2'b01; //寫寄存器的目標寄存器號來源:0-rt 1-rdALUSrc = 0; //第二個ALU操作數(shù)的來源MemToReg = 2'b0; //寫入寄存器的數(shù)據(jù)來源RegWrite = 1; //寄存器寫使能有效MemWrite = 0; //將數(shù)據(jù)寫入到指定存儲器單元中PCSrc = 0; //判斷是否執(zhí)行分支(PC+4 or PC+4+offset)ExtOp = 2'b0; //控制Extender的拓展方式ALUctr = 3'b010; //3bit 控制ALU的運算j_ctr = 0; //控制PC是否轉(zhuǎn)移到J指令指示的地址jr_ctr = 0; //jr指令DMSrc = 0;$display($time,,"(Control) ADDU");$display($time,,"(CTRL)RegDst=%b ALUSrc=%b MemToReg=%b RegWrite=%b MemWrite=%b PCSrc=%b ExtOp=%b ALUctr=%b j_ctr=%b jr_ctr=%b DMSrc=%b",RegDst,ALUSrc,MemToReg,RegWrite,MemWrite,PCSrc,ExtOp,ALUctr,j_ctr,jr_ctr,DMSrc);endelse if(func==6'b100011)//sububeginRegDst = 2'b01; //寫寄存器的目標寄存器號來源:0-rt 1-rdALUSrc = 0; //第二個ALU操作數(shù)的來源MemToReg = 2'b0; //寫入寄存器的數(shù)據(jù)來源RegWrite = 1; //寄存器寫使能有效MemWrite = 0; //將數(shù)據(jù)寫入到指定存儲器單元中PCSrc = 0; //判斷是否執(zhí)行分支(PC+4 or PC+4+offset)ExtOp = 2'b0; //控制Extender的拓展方式ALUctr = 3'b110; //3bit 控制ALU的運算j_ctr = 0; //控制PC是否轉(zhuǎn)移到J指令指示的地址jr_ctr = 0; //jr指令DMSrc = 0;$display($time,,"(Control) SUBU");$display($time,,"(CTRL)RegDst=%b ALUSrc=%b MemToReg=%b RegWrite=%b MemWrite=%b PCSrc=%b ExtOp=%b ALUctr=%b j_ctr=%b jr_ctr=%b DMSrc=%b",RegDst,ALUSrc,MemToReg,RegWrite,MemWrite,PCSrc,ExtOp,ALUctr,j_ctr,jr_ctr,DMSrc);endelse if(func==6'b101010)//sltbeginRegDst = 2'b01; //寫寄存器的目標寄存器號來源:0-rt 1-rdALUSrc = 0; //第二個ALU操作數(shù)的來源:0-讀寄存器2 1-指令低16位的符號拓展MemToReg = 2'b0; //寫入寄存器的數(shù)據(jù)來源:0-ALU計算結(jié)果 1-RAMRegWrite = 1; //寄存器寫使能有效MemWrite = 0; //將數(shù)據(jù)寫入到指定存儲器單元中PCSrc = 0; //判斷是否執(zhí)行分支(PC+4 or PC+4+offset) 0-不執(zhí)行 1-執(zhí)行ExtOp = 2'b0; //控制Extender的拓展方式ALUctr = 3'b000; //3bit 控制ALU的運算 見頂部注釋j_ctr = 0; //控制PC是否轉(zhuǎn)移到J指令指示的地址jr_ctr = 0; //jr指令DMSrc = 0;$display($time,,"(Control) SLT");$display($time,,"(CTRL)RegDst=%b ALUSrc=%b MemToReg=%b RegWrite=%b MemWrite=%b PCSrc=%b ExtOp=%b ALUctr=%b j_ctr=%b jr_ctr=%b DMSrc=%b",RegDst,ALUSrc,MemToReg,RegWrite,MemWrite,PCSrc,ExtOp,ALUctr,j_ctr,jr_ctr,DMSrc);endelse if(func==6'b001000)//jrbeginRegDst = 2'b00; //寫寄存器的目標寄存器號來源:0-rt 1-rdALUSrc = 0; //第二個ALU操作數(shù)的來源:0-讀寄存器2 1-指令低16位的符號拓展MemToReg = 2'b0; //寫入寄存器的數(shù)據(jù)來源:0-ALU計算結(jié)果 1-RAMRegWrite = 0; //寄存器寫使能有效MemWrite = 0; //將數(shù)據(jù)寫入到指定存儲器單元中PCSrc = 0; //判斷是否執(zhí)行分支(PC+4 or PC+4+offset) 0-不執(zhí)行 1-執(zhí)行ExtOp = 2'b0; //控制Extender的拓展方式ALUctr = 3'b111; //3bit 控制ALU的運算 見頂部注釋j_ctr = 0; //控制PC是否轉(zhuǎn)移到J指令指示的地址jr_ctr = 1; //jr指令DMSrc = 0;$display($time,,"(Control) JR");$display($time,,"(CTRL)RegDst=%b ALUSrc=%b MemToReg=%b RegWrite=%b MemWrite=%b PCSrc=%b ExtOp=%b ALUctr=%b j_ctr=%b jr_ctr=%b DMSrc=%b",RegDst,ALUSrc,MemToReg,RegWrite,MemWrite,PCSrc,ExtOp,ALUctr,j_ctr,jr_ctr,DMSrc);endelse//避免隱藏的鎖存器beginRegDst = 2'b00; //寫寄存器的目標寄存器號來源:0-rt 1-rdALUSrc = 0; //第二個ALU操作數(shù)的來源:0-讀寄存器2 1-指令低16位的符號拓展MemToReg = 2'b0; //寫入寄存器的數(shù)據(jù)來源:0-ALU計算結(jié)果 1-RAMRegWrite = 0; //寄存器寫使能有效MemWrite = 0; //將數(shù)據(jù)寫入到指定存儲器單元中PCSrc = 0; //判斷是否執(zhí)行分支(PC+4 or PC+4+offset) 0-不執(zhí)行 1-執(zhí)行ExtOp = 2'b0; //控制Extender的拓展方式ALUctr = 3'b111; //3bit 控制ALU的運算 見頂部注釋j_ctr = 0; //控制PC是否轉(zhuǎn)移到J指令指示的地址jr_ctr = 0; //jr指令DMSrc = 0;$display($time,,"(Control) DEFAULT");$display($time,,"(CTRL)RegDst=%b ALUSrc=%b MemToReg=%b RegWrite=%b MemWrite=%b PCSrc=%b ExtOp=%b ALUctr=%b j_ctr=%b jr_ctr=%b DMSrc=%b",RegDst,ALUSrc,MemToReg,RegWrite,MemWrite,PCSrc,ExtOp,ALUctr,j_ctr,jr_ctr,DMSrc);endend6'b001101://ori或立即數(shù)beginRegDst = 2'b00; //寫寄存器的目標寄存器號來源:0-rt 1-rdALUSrc = 1; //第二個ALU操作數(shù)的來源:0-讀寄存器2 1-指令低16位的符號拓展MemToReg = 2'b0; //寫入寄存器的數(shù)據(jù)來源:0-ALU計算結(jié)果 1-RAMRegWrite = 1; //寄存器寫使能有效MemWrite = 0; //將數(shù)據(jù)寫入到指定存儲器單元中PCSrc = 0; //判斷是否執(zhí)行分支(PC+4 or PC+4+offset) 0-不執(zhí)行 1-執(zhí)行ExtOp = 2'b0; //控制Extender的拓展方式ALUctr = 3'b001; //3bit 控制ALU的運算 見頂部注釋j_ctr = 0; //控制PC是否轉(zhuǎn)移到J指令指示的地址jr_ctr = 0; //jr指令DMSrc = 0;$display($time,,"(Control) ORI");$display($time,,"(CTRL)RegDst=%b ALUSrc=%b MemToReg=%b RegWrite=%b MemWrite=%b PCSrc=%b ExtOp=%b ALUctr=%b j_ctr=%b jr_ctr=%b DMSrc=%b",RegDst,ALUSrc,MemToReg,RegWrite,MemWrite,PCSrc,ExtOp,ALUctr,j_ctr,jr_ctr,DMSrc);end6'b100011://lw 從基址+偏移處內(nèi)存中讀取數(shù)據(jù),放入rt寄存器中beginRegDst = 2'b00; //寫寄存器的目標寄存器號來源:0-rt 1-rdALUSrc = 1; //第二個ALU操作數(shù)的來源:0-讀寄存器2 1-指令低16位的符號拓展MemToReg = 2'b01; //寫入寄存器的數(shù)據(jù)來源:00-ALU計算結(jié)果 01-RAMRegWrite = 1; //寄存器寫使能有效MemWrite = 0; //將數(shù)據(jù)寫入到指定存儲器單元中PCSrc = 0; //判斷是否執(zhí)行分支(PC+4 or PC+4+offset) 0-不執(zhí)行 1-執(zhí)行ExtOp = 2'b10; //控制Extender的拓展方式ALUctr = 3'b010; //3bit 控制ALU的運算 見頂部注釋j_ctr = 0; //控制PC是否轉(zhuǎn)移到J指令指示的地址jr_ctr = 0; //jr指令DMSrc = 0;$display($time,,"(Control) LW");$display($time,,"(CTRL)RegDst=%b ALUSrc=%b MemToReg=%b RegWrite=%b MemWrite=%b PCSrc=%b ExtOp=%b ALUctr=%b j_ctr=%b jr_ctr=%b DMSrc=%b",RegDst,ALUSrc,MemToReg,RegWrite,MemWrite,PCSrc,ExtOp,ALUctr,j_ctr,jr_ctr,DMSrc);end6'b101011://sw 把寄存器中的數(shù)據(jù)寫入基址+偏移的內(nèi)存中 偏移的拓展是有符號還是無符號?beginRegDst = 2'b00; //寫寄存器的目標寄存器號來源:0-rt 1-rdALUSrc = 1; //第二個ALU操作數(shù)的來源:0-讀寄存器2 1-指令低16位的符號拓展MemToReg = 2'b00; //寫入寄存器的數(shù)據(jù)來源:00-ALU計算結(jié)果 01-RAMRegWrite = 0; //寄存器寫使能有效MemWrite = 1; //將數(shù)據(jù)寫入到指定存儲器單元中PCSrc = 0; //判斷是否執(zhí)行分支(PC+4 or PC+4+offset) 0-不執(zhí)行 1-執(zhí)行ExtOp = 2'b01; //控制Extender的拓展方式ALUctr = 3'b010; //3bit 控制ALU的運算 見頂部注釋j_ctr = 0; //控制PC是否轉(zhuǎn)移到J指令指示的地址jr_ctr = 0; //jr指令DMSrc = 0;$display($time,,"(Control) SW");$display($time,,"(CTRL)RegDst=%b ALUSrc=%b MemToReg=%b RegWrite=%b MemWrite=%b PCSrc=%b ExtOp=%b ALUctr=%b j_ctr=%b jr_ctr=%b DMSrc=%b",RegDst,ALUSrc,MemToReg,RegWrite,MemWrite,PCSrc,ExtOp,ALUctr,j_ctr,jr_ctr,DMSrc);end6'b000100://beq 相等則(16bitaddress需要拓展并且左移兩位)分支指令 注意需要ALU的0標志位beginRegDst = 2'b00; //寫寄存器的目標寄存器號來源:0-rt 1-rdALUSrc = 0; //第二個ALU操作數(shù)的來源:0-讀寄存器2 1-指令低16位的符號拓展MemToReg = 2'b00; //寫入寄存器的數(shù)據(jù)來源:00-ALU計算結(jié)果 01-RAMRegWrite = 0; //寄存器寫使能有效MemWrite = 0; //將數(shù)據(jù)寫入到指定存儲器單元中if(zero==1) PCSrc = 1; //判斷是否執(zhí)行分支(PC+4 or PC+4+offset) 0-不執(zhí)行 1-執(zhí)行 已經(jīng)在NPC中實現(xiàn)左移兩位else PCSrc = 0;ExtOp = 2'b01; //控制Extender的拓展方式00無符號16to32 01:有符號16to32 10拓展到高16ALUctr = 3'b111; //此處zero標志位單獨判斷 因此不需要ALUctr的控制j_ctr = 0; //控制PC是否轉(zhuǎn)移到J指令指示的地址jr_ctr = 0; //jr指令DMSrc = 0;$display($time,,"(Control) BEQ");$display($time,,"(CTRL)RegDst=%b ALUSrc=%b MemToReg=%b RegWrite=%b MemWrite=%b PCSrc=%b ExtOp=%b ALUctr=%b j_ctr=%b jr_ctr=%b DMSrc=%b",RegDst,ALUSrc,MemToReg,RegWrite,MemWrite,PCSrc,ExtOp,ALUctr,j_ctr,jr_ctr,DMSrc);end6'b001111://lui 立即數(shù)加載至寄存器高16位beginRegDst = 2'b00; //寫寄存器的目標寄存器號來源:0-rt 1-rdALUSrc = 1; //(此標記并未直接控制ALU)第二ALU操作數(shù)的來源:0-讀寄存器2 1-指令低16位的符號拓展MemToReg = 2'b00; //寫入寄存器的數(shù)據(jù)來源:00-ALU計算結(jié)果 01-RAM 02-JALRegWrite = 1; //寄存器寫使能有效MemWrite = 0; //將數(shù)據(jù)寫入到指定存儲器單元中PCSrc = 0; //判斷是否執(zhí)行分支(PC+4 or PC+4+offset) 0-不執(zhí)行 1-執(zhí)行ExtOp = 2'b00; //控制Extender的拓展方式00無符號16to32 01:有符號16to32 10拓展到高16ALUctr = 3'b011; //3bit 控制ALU的運算 見頂部注釋j_ctr = 0; //控制PC是否轉(zhuǎn)移到J指令指示的地址jr_ctr = 0; //jr指令DMSrc = 0;$display($time,,"(Control) LUI");$display($time,,"(CTRL)RegDst=%b ALUSrc=%b MemToReg=%b RegWrite=%b MemWrite=%b PCSrc=%b ExtOp=%b ALUctr=%b j_ctr=%b jr_ctr=%b DMSrc=%b",RegDst,ALUSrc,MemToReg,RegWrite,MemWrite,PCSrc,ExtOp,ALUctr,j_ctr,jr_ctr,DMSrc);end6'b000010://j 無條件跳轉(zhuǎn)beginRegDst = 2'b00; //寫寄存器的目標寄存器號來源:0-rt 1-rdALUSrc = 0; //(此標記并未直接控制ALU)第二ALU操作數(shù)的來源:0-讀寄存器2 1-指令低16位的符號拓展MemToReg = 2'b00; //寫入寄存器的數(shù)據(jù)來源:00-ALU計算結(jié)果 01-RAMRegWrite = 0; //寄存器寫使能有效MemWrite = 0; //將數(shù)據(jù)寫入到指定存儲器單元中PCSrc = 0; //判斷是否執(zhí)行分支(PC+4 or PC+4+offset) 0-不執(zhí)行 1-執(zhí)行ExtOp = 2'b00; //控制Extender的拓展方式00無符號16to32 01:有符號16to32 10拓展到高16ALUctr = 3'b111; //3bit 控制ALU的運算 見頂部注釋j_ctr = 1; //在npc(用于計算下一條指令)中左移兩位 并拼接剩余部分jr_ctr = 0; //jr指令DMSrc = 0;$display($time,,"(Control) J");$display($time,,"(CTRL)RegDst=%b ALUSrc=%b MemToReg=%b RegWrite=%b MemWrite=%b PCSrc=%b ExtOp=%b ALUctr=%b j_ctr=%b jr_ctr=%b DMSrc=%b",RegDst,ALUSrc,MemToReg,RegWrite,MemWrite,PCSrc,ExtOp,ALUctr,j_ctr,jr_ctr,DMSrc);end6'b001000://addi 加立即數(shù) 支持溢出 ??怎么支持溢出??溢出之后存儲在其他的寄存器中嗎??如何體現(xiàn)addi和addiu的區(qū)別?beginRegDst = 2'b00; //寫寄存器的目標寄存器號來源:0-rt 1-rdALUSrc = 1; //(此標記并未直接控制ALU)第二ALU操作數(shù)的來源:0-讀寄存器2 1-指令低16位的符號拓展MemToReg = 2'b00; //寫入寄存器的數(shù)據(jù)來源:00-ALU計算結(jié)果 01-RAMRegWrite = 1; //寄存器寫使能有效MemWrite = 0; //將數(shù)據(jù)寫入到指定存儲器單元中PCSrc = 0; //判斷是否執(zhí)行分支(PC+4 or PC+4+offset) 0-不執(zhí)行 1-執(zhí)行ExtOp = 2'b01; //控制Extender的拓展方式00無符號16to32 01:有符號16to32 10拓展到高16ALUctr = 3'b010; //3bit 控制ALU的運算 見頂部注釋j_ctr = 0; //在npc(用于計算下一條指令)中左移兩位 并拼接剩余部分jr_ctr = 0; //jr指令DMSrc = 0;$display($time,,"(Control) ADDI");$display($time,,"(CTRL)RegDst=%b ALUSrc=%b MemToReg=%b RegWrite=%b MemWrite=%b PCSrc=%b ExtOp=%b ALUctr=%b j_ctr=%b jr_ctr=%b DMSrc=%b",RegDst,ALUSrc,MemToReg,RegWrite,MemWrite,PCSrc,ExtOp,ALUctr,j_ctr,jr_ctr,DMSrc);end6'b001001://addiubeginRegDst = 2'b00; //寫寄存器的目標寄存器號來源:0-rt 1-rdALUSrc = 1; //(此標記并未直接控制ALU)第二ALU操作數(shù)的來源:0-讀寄存器2 1-指令低16位的符號拓展MemToReg = 2'b00; //寫入寄存器的數(shù)據(jù)來源:00-ALU計算結(jié)果 01-RAMRegWrite = 1; //寄存器寫使能有效MemWrite = 0; //將數(shù)據(jù)寫入到指定存儲器單元中PCSrc = 0; //判斷是否執(zhí)行分支(PC+4 or PC+4+offset) 0-不執(zhí)行 1-執(zhí)行ExtOp = 2'b01; //控制Extender的拓展方式00無符號16to32 01:有符號16to32 10拓展到高16ALUctr = 3'b010; //3bit 控制ALU的運算 見頂部注釋j_ctr = 0; //在npc(用于計算下一條指令)中左移兩位 并拼接剩余部分jr_ctr = 0; //jr指令DMSrc = 0;$display($time,,"(Control) ADDIU");$display($time,,"(CTRL)RegDst=%b ALUSrc=%b MemToReg=%b RegWrite=%b MemWrite=%b PCSrc=%b ExtOp=%b ALUctr=%b j_ctr=%b jr_ctr=%b DMSrc=%b",RegDst,ALUSrc,MemToReg,RegWrite,MemWrite,PCSrc,ExtOp,ALUctr,j_ctr,jr_ctr,DMSrc);end6'b000011://jalbeginRegDst = 2'b10; //寫寄存器的目標寄存器號來源:0-rt 1-rdALUSrc = 0; //(此標記并未直接控制ALU)第二ALU操作數(shù)的來源:0-讀寄存器2 1-指令低16位的符號拓展MemToReg = 2'b10; //寫入寄存器的數(shù)據(jù)來源:00-ALU計算結(jié)果 01-RAMRegWrite = 1; //寄存器寫使能有效MemWrite = 0; //將數(shù)據(jù)寫入到指定存儲器單元中PCSrc = 0; //判斷是否執(zhí)行分支(PC+4 or PC+4+offset) 0-不執(zhí)行 1-執(zhí)行ExtOp = 2'b00; //控制Extender的拓展方式00無符號16to32 01:有符號16to32 10拓展到高16ALUctr = 3'b111; //3bit 控制ALU的運算 見頂部注釋j_ctr = 1; //在npc(用于計算下一條指令)中左移兩位 并拼接剩余部分jr_ctr = 0; //jr指令DMSrc = 0;$display($time,,"(Control) JAL");$display($time,,"(CTRL)RegDst=%b ALUSrc=%b MemToReg=%b RegWrite=%b MemWrite=%b PCSrc=%b ExtOp=%b ALUctr=%b j_ctr=%b jr_ctr=%b DMSrc=%b",RegDst,ALUSrc,MemToReg,RegWrite,MemWrite,PCSrc,ExtOp,ALUctr,j_ctr,jr_ctr,DMSrc);enddefault:beginRegDst = 2'b00; //寫寄存器的目標寄存器號來源:0-rt 1-rdALUSrc = 0; //(此標記并未直接控制ALU)第二ALU操作數(shù)的來源:0-讀寄存器2 1-指令低16位的符號拓展MemToReg = 2'b00; //寫入寄存器的數(shù)據(jù)來源:00-ALU計算結(jié)果 01-RAMRegWrite = 0; //寄存器寫使能有效MemWrite = 0; //將數(shù)據(jù)寫入到指定存儲器單元中PCSrc = 0; //判斷是否執(zhí)行分支(PC+4 or PC+4+offset) 0-不執(zhí)行 1-執(zhí)行ExtOp = 2'b00; //控制Extender的拓展方式00無符號16to32 01:有符號16to32 10拓展到高16ALUctr = 3'b111; //3bit 控制ALU的運算 見頂部注釋j_ctr = 0; //在npc(用于計算下一條指令)中左移兩位 并拼接剩余部分jr_ctr = 0; //jr指令DMSrc = 0;$display($time,,"(Control) DEFAULT2");$display($time,,"(CTRL)RegDst=%b ALUSrc=%b MemToReg=%b RegWrite=%b MemWrite=%b PCSrc=%b ExtOp=%b ALUctr=%b j_ctr=%b jr_ctr=%b DMSrc=%b",RegDst,ALUSrc,MemToReg,RegWrite,MemWrite,PCSrc,ExtOp,ALUctr,j_ctr,jr_ctr,DMSrc);endendcaseend endmodulemultiplexer
//多路選擇器`timescale 1ns / 1ns//注意組合邏輯(敏感列表)用=賦值,時序邏輯(clk控制)用<=賦值//二選一 32bit module mutiplexer32_1(input control,input [31:0] din0,input [31:0] din1,output reg [31:0] out32_1);always @(*)beginif(control==0) out32_1 = din0;else out32_1 = din1;$display($time,,"(MUX DataTo DM/ALU)control = %b, din0 = %b, din1 = %b, out = %b", control, din0, din1, out32_1);end endmodule//四選一 32bit 00ALU運算結(jié)果(包含高16拓展\普通運算) 01數(shù)據(jù)存儲器的輸出 10JAL跳轉(zhuǎn)的目的地址 11沒用 module mutiplexer32_2(input [1:0]control,input [31:0] din0, //00ALU運算結(jié)果(包含高16拓展\普通運算)input [31:0] din1, //01數(shù)據(jù)存儲器的輸出input [31:0] din2, //10JAL跳轉(zhuǎn)的目的地址input [31:0] din3, //沒用到output reg [31:0] out32_2);always @(*)beginif(control==0) out32_2=din0;else if(control==2'b01) out32_2=din1;else if(control==2'b10) out32_2=din2;else if(control==2'b11) out32_2=din3;$display($time,,"(MUX RegWriteData)control = %b, din0 = %b, din1 = %b, din2 = %b, out = %b", control, din0, din1, din2, out32_2);end endmodule//3選1 5bit module mutiplexer5 (input [1:0] control, //Regdst寫寄存器的目標寄存器號來源 0-rt 1-rdinput [4:0] din0, //rt (lui)input [4:0] din1, //rdinput [4:0] din2,output reg [4:0] out5);always @(*)beginif(control==0) out5=din0;else if(control==2'b01) out5=din1;else if(control==2'b10) out5=din2;$display($time,,"(MUX RegWriteAddr)control = %b, din0 = %b, din1 = %b, out = %b", control, din0, din1, out5);end endmodulealu
`timescale 1ns / 1ns /** Module Name: ALU* File Created: 2019-4-4 16:11:12* Notes:* 沒有添加溢出判斷 * OF為溢出標志位(有溢出為1,無溢出為0)如果溢出 要用兩個GPR表示這個結(jié)果*///注意組合邏輯(敏感列表)用=賦值,時序邏輯(clk控制)用<=賦值module ALU( input [31:0] A, //輸入32位Ainput [31:0] B, //輸入32位Binput [4:0] sl, //左移的位數(shù)input [2:0] ALUctr, //3位ALU控制信號output reg[31:0] Result, //因為要在always里面賦值,所以定義為regoutput reg zero //零標志位);always@(*) //(*)表示自動添加敏感列表begincase(ALUctr) //決定ALU操作3'b000: beginResult=($signed(A)<$signed(B))?32'h0000_0001:32'h0000_0000;//若A<B,則result=1$display($time,,"(ALU)(if a<b,res=1)A = %b, B = %b, Result = %b", A, B, Result);end3'b001:beginResult=A|B;//或$display($time,,"(ALU)(or)A = %b, B = %b, Result = %b", A, B, Result);end3'b010:beginResult=A+B;//加$display($time,,"(ALU)(add)A = %b, B = %b, Result = %b", A, B, Result);end3'b011:beginResult={B[15:0],16'h0000};//拓展到高16位$display($time,,"(ALU)(16toUp32)A = %b, B = %b, Result = %b", A, B, Result);end3'b101: beginResult=B<<sl;//邏輯左移$display($time,,"(ALU)(<<)A = %b, B = %b, Result = %b", A, B, Result);end3'b110:beginResult=A-B;//減$display($time,,"(ALU)(sub)A = %b, B = %b, Result = %b", A, B, Result);enddefault:beginResult<=32'h0000_0000;$display($time,,"(ALU)(DEFAULT)");endendcaseif(A==B) zero=1;//計算零標志位else zero=0;endendmoduleext
//Extender位拓展 /* EXTOp 2'b00:無符號16to32 2'b01:有符號16to32 2'b10:拓展到高16位 *///注意組合邏輯(always敏感列表)用=賦值,時序邏輯(clk控制)用<=賦值 `timescale 1ns / 1ns module EXT(input [15:0] EXTin,//輸入EXT的數(shù)據(jù)input [1:0]ExtOp,output reg [31:0] EXTout//拓展后輸出的數(shù)據(jù));always@(*)begincase(ExtOp)2'b00://無符號16to32beginEXTout = {16'b0,EXTin[15:0]};$display($time,,"(EXT)EXTOp = 00; EXTin = %b EXTout = %b",EXTin, EXTout);end2'b01://有符號16to32begin$display($time,,"(EXT)EXTOp = 01; EXTin = %b EXTout = %b",EXTin, EXTout);if(EXTin[15]==1)EXTout = {16'b1111_1111_1111_1111,EXTin[15:0]};else EXTout = {16'b0000_0000_0000_0000,EXTin[15:0]};end2'b10://拓展至高16begin$display($time,,"(EXT)EXTOp = 10; EXTin = %b EXTout = %b",EXTin, EXTout);EXTout = {EXTin[15:0],16'b0000_0000_0000_0000};enddefault: begin$display($time,,"(EXT)EXTOp = default");EXTout = 32'b0;endendcaseend endmoduleim
`timescale 1ns/1ns //IM 指令存儲器 與上一個模塊以導(dǎo)線相連wire輸入 將本模塊數(shù)據(jù)輸出到下一個模塊reg輸出 module IM_4k(input [31:0]addr,//與上一個模塊以導(dǎo)線相連 32bit 要取出額的指令地址output reg[5:0]op,//輸出 6位操作碼opoutput reg[4:0]rs,//輸出 源1output reg[4:0]rt,//輸出 源2output reg[4:0]rd,//輸出 目的output reg[4:0]shamt,//只用于移位指令slloutput reg[5:0]func,//指出ALU的功能output reg[15:0]immediate16,//addressoutput reg[25:0]immediate26//J指令 26位跳轉(zhuǎn)地址);reg [31:0]im[1023:0];//im存儲讀取的所有指令 2^10wire [11:2]address;//因為im一共只有2^10,所以address的位寬為10assign address=addr[11:2];//按字節(jié)尋址,address自動取addr的左移兩位initial begin$readmemh("code.txt",im);//從文件中讀取指令$display("(im)Finish Read File: %p",im);endalways @(*)//輸出指令的各個部分beginop=im[address][31:26];rs=im[address][25:21];rt=im[address][20:16];rd=im[address][15:11];shamt=im[address][10:6];func=im[address][5:0];immediate16=im[address][15:0];immediate26=im[address][25:0];$display($time,,"(IM)Current Code:%b %b %b %b %b %b ; TheAddrOfCurCode = %b ",op,rs,rt,rd,shamt,func,addr);endendmodulenpc
`timescale 1ns / 1ns //計算下一條指令的地址 //輸入的PC是當前指令的地址 //輸出的NPC是下一條指令的地址 module NextPC(input [31:0] PC,input [15:0] imm16, //beqinput [25:0] imm26, //j,jalinput [31:0] rsd, //jr跳轉(zhuǎn)至寄存器input branch_ctr,input j_ctr,input jr_ctr,output reg [31:0] NPC, //下一條指令的地址output [31:0] jalPC //jal跳轉(zhuǎn)的地址);assign jalPC = PC + 4;always @(*)beginif(j_ctr) NPC <= {PC[31:28], imm26, 2'b0};//j指令 自帶左移兩位else if(jr_ctr) NPC <= rsd;//jr指令else if(branch_ctr) NPC <= PC + 4 + $signed(imm16<<2);//beq指令,branch判斷是否執(zhí)行分支 自帶左移兩位else NPC = PC + 4;$display($time,,"(NPC)CurPCAddr:%b NextPcAddr:%b",PC,NPC);end endmodulepc
//輸入:NPC代表的下一條指令的地址 //輸出:"下一條指令" 即 "當前指令"。如果不reset,則根據(jù)clk輸出當前指令PC的地址 `timescale 1ns / 1ns module Pc( input [31:0] NPC, //NextPC計算單元input clk, //時鐘信號input reset, //復(fù)位output reg [31:0] PC //輸出下一條指令的地址);initialbeginPC <= 0000_0000; //為什么別人寫的是 32'h00003000?endalways@(posedge clk, posedge reset)//任何一個變動都可以觸發(fā)beginif(reset) PC <= 0000_0000;//為什么別人寫的是 32'h00003000?else PC <= NPC;$display($time,,"(PC)NextPcAddr%b",PC);end endmoduledm
`timescale 1ns / 1ns //DM數(shù)據(jù)寄存器 module dm_4k(input [31:0] pc,//僅用于控制臺輸出看著方便input [31:0] addr,//地址input [31:0] din,//dataininput MemWrite,//寫使能input clk,input reset,output [31:0] dout//dataout);wire [11:2] address; //以字為單位的地址,因為寄存器是1024"字"assign address = addr[11:2];reg[31:0] dm[1023:0]; //32bit*1024字的數(shù)據(jù)存儲器assign dout = dm[address];//始終輸出integer i;initialbeginfor(i = 1; i < 1024; i = i + 1) dm[i] <= 0;//初始化數(shù)據(jù)存儲器為0endalways@(posedge clk, posedge reset)beginif(reset)beginfor(i = 1; i < 1024; i = i + 1) dm[i] <= 0;endelsebeginif(MemWrite)begindm[address] <= din;$monitor($time,,"(DM MemWrite)PC%b: dmAddr%b <= Data%b", pc, addr, din);endendend endmodulegpr
//GPR寄存器堆 `timescale 1ns / 1ns //注意組合邏輯(always敏感列表)用=賦值,時序邏輯(clk控制)用<=賦值 module GPR(input [31:0] WPC,//writePC 僅用于輸出input clk,input reset,input RegWrite,//寫使能input [4:0] ra1,//ReadAddress1input [4:0] ra2,//ReadAddress2input [4:0] wa,//WriteAddressinput [31:0]wd,//WriteDataoutput [31:0] rd1,//ReadData1output [31:0] rd2//ReadData2);reg[31:0] regfile[31:0];//定義32個 32-bit寄存器assign rd1 = regfile[ra1];//第一個讀出的數(shù)據(jù)assign rd2 = regfile[ra2];//第二個讀出的數(shù)據(jù)integer i;//integer flag = 0;initialbeginfor(i = 0; i < 32; i = i + 1) regfile[i] <= 0;end//時序邏輯always@(posedge clk, posedge reset)beginif(reset)beginfor(i = 0; i < 32; i = i + 1) regfile[i] <= 0;endelse if(RegWrite==1 && wa != 0)beginregfile[wa] <= wd;//寫入數(shù)據(jù)$display($time,,"(Write GPR)PC%b: WriteAddress%b <= Data%b", WPC, wa, wd);#1begin$display($time,,"(Show GPR)");for(i = 0; i < 32; i = i + 1)begin$display($time,,"GPR%d = %h", i, regfile[i]);endendendelse if(RegWrite==0)//寫使能無效begin$display($time,,"(GPR)Write:false");endelse//寫使能有效但是寄存器地址為0begin$display($time,,"(GPR)DEFAULT");endend endmodule運行結(jié)果:
run -all # (im)Finish Read File: '{x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, # x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, 1007157248, 135266319, 285802497, 19679265, 30177313, 28078113, 28076065, 28141601, 25978913, 32458785, 17317921, 17317921, 32260129, 28074019, 900530177, 1007484929, 1007419393, 889935189, 21581859, 17387553, 1007222785, 1007157503} # display is Valid # 0 (MUX RegWriteAddr)control = xx, din0 = xxxxx, din1 = xxxxx, out = xxxxx # 0 (MUX RegWriteData)control = xx, din0 = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, din1 = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, din2 = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, out = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx # 0 (MUX DataTo DM/ALU)control = x, din0 = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, din1 = 00000000000000000000000000000000, out = 00000000000000000000000000000000 # 0 (ALU)(DEFAULT) # 0 (MUX RegWriteAddr)control = xx, din0 = xxxxx, din1 = xxxxx, out = xxxxx # 0 (MUX RegWriteData)control = xx, din0 = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, din1 = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, din2 = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, out = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx # 0 (MUX DataTo DM/ALU)control = x, din0 = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, din1 = 00000000000000000000000000000000, out = 00000000000000000000000000000000 # 0 (ALU)(DEFAULT) # 0 (IM)Current Code:xxxxxx xxxxx xxxxx xxxxx xxxxx xxxxxx ; TheAddrOfCurCode = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx # 0 (IM)Current Code:xxxxxx xxxxx xxxxx xxxxx xxxxx xxxxxx ; TheAddrOfCurCode = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx # 0 (IM)Current Code:xxxxxx xxxxx xxxxx xxxxx xxxxx xxxxxx ; TheAddrOfCurCode = zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz # 0 (Control) DEFAULT2 # 0 (CTRL)RegDst=00 ALUSrc=0 MemToReg=00 RegWrite=0 MemWrite=0 PCSrc=0 ExtOp=00 ALUctr=111 j_ctr=0 jr_ctr=0 DMSrc=0 # 0 (Control) DEFAULT2 # 0 (CTRL)RegDst=00 ALUSrc=0 MemToReg=00 RegWrite=0 MemWrite=0 PCSrc=0 ExtOp=00 ALUctr=111 j_ctr=0 jr_ctr=0 DMSrc=0 # 0 (MUX DataTo DM/ALU)control = 0, din0 = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, din1 = 00000000000000000000000000000000, out = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx # 0 (MUX RegWriteAddr)control = 00, din0 = xxxxx, din1 = xxxxx, out = xxxxx # 0 (MUX RegWriteData)control = 00, din0 = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, din1 = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, din2 = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, out = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx # 0 (EXT)EXTOp = 00; EXTin = xxxxxxxxxxxxxxxx EXTout = 0000000000000000xxxxxxxxxxxxxxxx # 0 (ALU)(DEFAULT) # 0 (MUX RegWriteAddr)control = 00, din0 = xxxxx, din1 = xxxxx, out = xxxxx # 0 (MUX RegWriteData)control = 00, din0 = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, din1 = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, din2 = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, out = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx # 0 (EXT)EXTOp = 00; EXTin = xxxxxxxxxxxxxxxx EXTout = 0000000000000000xxxxxxxxxxxxxxxx # 0 (ALU)(DEFAULT) # 0 (NPC)CurPCAddr:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx NextPcAddr:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx # 0 (MUX DataTo DM/ALU)control = 0, din0 = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, din1 = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, out = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx # 0 (MUX DataTo DM/ALU)control = 0, din0 = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, din1 = 00000000000000000000000000000000, out = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx # 0 (NPC)CurPCAddr:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx NextPcAddr:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx # 0 (MUX DataTo DM/ALU)control = 0, din0 = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, din1 = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, out = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx # 0 (MUX DataTo DM/ALU)control = 0, din0 = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, din1 = 0000000000000000xxxxxxxxxxxxxxxx, out = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx # 0 (MUX DataTo DM/ALU)control = 0, din0 = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, din1 = 0000000000000000xxxxxxxxxxxxxxxx, out = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx # 0 (IM)Current Code:001111 00000 01000 00000 00011 111111 ; TheAddrOfCurCode = 00000000000000000000000000000000 # 0 (NPC)CurPCAddr:00000000000000000000000000000000 NextPcAddr:00000000000000000000000000000100 # 0 (IM)Current Code:001111 00000 01000 00000 00011 111111 ; TheAddrOfCurCode = 00000000000000000000000000000000 # 0 (NPC)CurPCAddr:00000000000000000000000000000000 NextPcAddr:00000000000000000000000000000100 # 0 (MUX RegWriteData)control = 00, din0 = 00000000000000000000000000000000, din1 = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, din2 = 00000000000000000000000000000100, out = 00000000000000000000000000000000 # 0 (MUX RegWriteData)control = 00, din0 = 00000000000000000000000000000000, din1 = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, din2 = 00000000000000000000000000000100, out = 00000000000000000000000000000000 # 0 (ALU)(DEFAULT) # 0 (ALU)(DEFAULT) # 0 (MUX DataTo DM/ALU)control = 0, din0 = 00000000000000000000000000000000, din1 = 00000000000000000000000000000000, out = 00000000000000000000000000000000 # 0 (MUX DataTo DM/ALU)control = 0, din0 = 00000000000000000000000000000000, din1 = 0000000000000000xxxxxxxxxxxxxxxx, out = 00000000000000000000000000000000 # 0 (MUX DataTo DM/ALU)control = 0, din0 = 00000000000000000000000000000000, din1 = 00000000000000000000000000000000, out = 00000000000000000000000000000000 # 0 (MUX DataTo DM/ALU)control = 0, din0 = 00000000000000000000000000000000, din1 = 0000000000000000xxxxxxxxxxxxxxxx, out = 00000000000000000000000000000000 # 0 (MUX RegWriteAddr)control = 00, din0 = 01000, din1 = 00000, out = 01000 # 0 (Control) LUI # 0 (CTRL)RegDst=00 ALUSrc=1 MemToReg=00 RegWrite=1 MemWrite=0 PCSrc=0 ExtOp=00 ALUctr=011 j_ctr=0 jr_ctr=0 DMSrc=0 # 0 (EXT)EXTOp = 00; EXTin = 0000000011111111 EXTout = 00000000000000000000000011111111 # 0 (MUX RegWriteAddr)control = 00, din0 = 01000, din1 = 00000, out = 01000 # 0 (Control) LUI # 0 (CTRL)RegDst=00 ALUSrc=1 MemToReg=00 RegWrite=1 MemWrite=0 PCSrc=0 ExtOp=00 ALUctr=011 j_ctr=0 jr_ctr=0 DMSrc=0 # 0 (EXT)EXTOp = 00; EXTin = 0000000011111111 EXTout = 00000000000000000000000011111111 # 0 (ALU)(DEFAULT) # 0 (NPC)CurPCAddr:00000000000000000000000000000000 NextPcAddr:00000000000000000000000000000100 # 0 (ALU)(DEFAULT) # 0 (NPC)CurPCAddr:00000000000000000000000000000000 NextPcAddr:00000000000000000000000000000100 # 0 (ALU)(16toUp32)A = 00000000000000000000000000000000, B = 00000000000000000000000000000000, Result = 00000000000000000000000000000000 # 0 (ALU)(16toUp32)A = 00000000000000000000000000000000, B = 00000000000000000000000000000000, Result = 00000000000000000000000000000000 # 0 (MUX DataTo DM/ALU)control = 1, din0 = 00000000000000000000000000000000, din1 = 00000000000000000000000011111111, out = 00000000000000000000000011111111 # 0 (MUX DataTo DM/ALU)control = 1, din0 = 00000000000000000000000000000000, din1 = 00000000000000000000000011111111, out = 00000000000000000000000011111111 # 0 (ALU)(16toUp32)A = 00000000000000000000000000000000, B = 00000000000000000000000011111111, Result = 00000000111111110000000000000000 # 0 (ALU)(16toUp32)A = 00000000000000000000000000000000, B = 00000000000000000000000011111111, Result = 00000000111111110000000000000000 # 0 (Control) LUI # 0 (CTRL)RegDst=00 ALUSrc=1 MemToReg=00 RegWrite=1 MemWrite=0 PCSrc=0 ExtOp=00 ALUctr=011 j_ctr=0 jr_ctr=0 DMSrc=0 # 0 (Control) LUI # 0 (CTRL)RegDst=00 ALUSrc=1 MemToReg=00 RegWrite=1 MemWrite=0 PCSrc=0 ExtOp=00 ALUctr=011 j_ctr=0 jr_ctr=0 DMSrc=0 # 0 (Control) LUI # 0 (CTRL)RegDst=00 ALUSrc=1 MemToReg=00 RegWrite=1 MemWrite=0 PCSrc=0 ExtOp=00 ALUctr=011 j_ctr=0 jr_ctr=0 DMSrc=0 # 0 (MUX RegWriteData)control = 00, din0 = 00000000111111110000000000000000, din1 = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, din2 = 00000000000000000000000000000100, out = 00000000111111110000000000000000 # 0 (MUX RegWriteData)control = 00, din0 = 00000000111111110000000000000000, din1 = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, din2 = 00000000000000000000000000000100, out = 00000000111111110000000000000000 # 0 (Control) LUI # 0 (CTRL)RegDst=00 ALUSrc=1 MemToReg=00 RegWrite=1 MemWrite=0 PCSrc=0 ExtOp=00 ALUctr=011 j_ctr=0 jr_ctr=0 DMSrc=0 # 0 (MUX RegWriteData)control = 00, din0 = 00000000000000000000000000000000, din1 = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, din2 = 00000000000000000000000000000100, out = 00000000000000000000000000000000 # 0 (MUX RegWriteData)control = 00, din0 = 00000000000000000000000000000000, din1 = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, din2 = 00000000000000000000000000000100, out = 00000000000000000000000000000000 # 0 (ALU)(16toUp32)A = 00000000000000000000000000000000, B = 00000000000000000000000011111111, Result = 00000000111111110000000000000000 # 0 (ALU)(16toUp32)A = 00000000000000000000000000000000, B = 00000000000000000000000011111111, Result = 00000000111111110000000000000000 # 0 (MUX RegWriteData)control = 00, din0 = 00000000111111110000000000000000, din1 = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, din2 = 00000000000000000000000000000100, out = 00000000111111110000000000000000 # 0 (MUX RegWriteData)control = 00, din0 = 00000000111111110000000000000000, din1 = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, din2 = 00000000000000000000000000000100, out = 00000000111111110000000000000000 # 0 (mips_tb)clk = 0 # 10 (Write GPR)PC00000000000000000000000000000000: WriteAddress01000 <= Data00000000111111110000000000000000 # 10 (PC)NextPcAddr00000000000000000000000000000000 # 10 (MUX RegWriteData)control = 00, din0 = 00000000111111110000000000000000, din1 = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, din2 = 00000000000000000000000000001000, out = 00000000111111110000000000000000 # 10 (MUX DataTo DM/ALU)control = 0, din0 = 00000000111111110000000000000000, din1 = 00000000000000000000000000000000, out = 00000000111111110000000000000000 # 10 (MUX DataTo DM/ALU)control = 1, din0 = 00000000111111110000000000000000, din1 = 00000000000000000000000011111111, out = 00000000000000000000000011111111 # 10 (IM)Current Code:001111 00000 01001 00000 00000 000001 ; TheAddrOfCurCode = 00000000000000000000000000000100 # 10 (NPC)CurPCAddr:00000000000000000000000000000100 NextPcAddr:00000000000000000000000000001000 # 10 (MUX DataTo DM/ALU)control = 0, din0 = 00000000000000000000000000000000, din1 = 00000000000000000000000000000000, out = 00000000000000000000000000000000 # 10 (MUX DataTo DM/ALU)control = 1, din0 = 00000000000000000000000000000000, din1 = 00000000000000000000000011111111, out = 00000000000000000000000011111111 # 10 (MUX RegWriteAddr)control = 00, din0 = 01001, din1 = 00000, out = 01001 # 10 (Control) LUI # 10 (CTRL)RegDst=00 ALUSrc=1 MemToReg=00 RegWrite=1 MemWrite=0 PCSrc=0 ExtOp=00 ALUctr=011 j_ctr=0 jr_ctr=0 DMSrc=0 # 10 (EXT)EXTOp = 00; EXTin = 0000000000000001 EXTout = 00000000000000000000000000000001 # 10 (NPC)CurPCAddr:00000000000000000000000000000100 NextPcAddr:00000000000000000000000000001000 # 10 (MUX DataTo DM/ALU)control = 1, din0 = 00000000000000000000000000000000, din1 = 00000000000000000000000000000001, out = 00000000000000000000000000000001 # 10 (ALU)(16toUp32)A = 00000000000000000000000000000000, B = 00000000000000000000000000000001, Result = 00000000000000010000000000000000 # 10 (MUX RegWriteData)control = 00, din0 = 00000000000000010000000000000000, din1 = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, din2 = 00000000000000000000000000001000, out = 00000000000000010000000000000000 # 10 (mips_tb)clk = 1 # 11 (Show GPR) # 11 GPR 0 = 00000000 # 11 GPR 1 = 00000000 # 11 GPR 2 = 00000000 # 11 GPR 3 = 00000000 # 11 GPR 4 = 00000000 # 11 GPR 5 = 00000000 # 11 GPR 6 = 00000000 # 11 GPR 7 = 00000000 # 11 GPR 8 = 00ff0000 # 11 GPR 9 = 00000000 # 11 GPR 10 = 00000000 # 11 GPR 11 = 00000000 # 11 GPR 12 = 00000000 # 11 GPR 13 = 00000000 # 11 GPR 14 = 00000000 # 11 GPR 15 = 00000000 # 11 GPR 16 = 00000000 # 11 GPR 17 = 00000000 # 11 GPR 18 = 00000000 # 11 GPR 19 = 00000000 # 11 GPR 20 = 00000000 # 11 GPR 21 = 00000000 # 11 GPR 22 = 00000000 # 11 GPR 23 = 00000000 # 11 GPR 24 = 00000000 # 11 GPR 25 = 00000000 # 11 GPR 26 = 00000000 # 11 GPR 27 = 00000000 # 11 GPR 28 = 00000000 # 11 GPR 29 = 00000000 # 11 GPR 30 = 00000000 # 11 GPR 31 = 00000000 # 20 (mips_tb)clk = 0 # 30 (Write GPR)PC00000000000000000000000000000100: WriteAddress01001 <= Data00000000000000010000000000000000 # 30 (PC)NextPcAddr00000000000000000000000000000100 # 30 (MUX RegWriteData)control = 00, din0 = 00000000000000010000000000000000, din1 = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, din2 = 00000000000000000000000000001100, out = 00000000000000010000000000000000 # 30 (MUX DataTo DM/ALU)control = 0, din0 = 00000000000000010000000000000000, din1 = 00000000000000000000000000000000, out = 00000000000000010000000000000000 # 30 (MUX DataTo DM/ALU)control = 1, din0 = 00000000000000010000000000000000, din1 = 00000000000000000000000000000001, out = 00000000000000000000000000000001 # 30 (IM)Current Code:000000 01000 01001 01010 00000 100001 ; TheAddrOfCurCode = 00000000000000000000000000001000 # 30 (NPC)CurPCAddr:00000000000000000000000000001000 NextPcAddr:00000000000000000000000000001100 # 30 (MUX RegWriteAddr)control = 00, din0 = 01001, din1 = 01010, out = 01001 # 30 (Control) ADDU # 30 (CTRL)RegDst=01 ALUSrc=0 MemToReg=00 RegWrite=1 MemWrite=0 PCSrc=0 ExtOp=00 ALUctr=010 j_ctr=0 jr_ctr=0 DMSrc=0 # 30 (EXT)EXTOp = 00; EXTin = 0101000000100001 EXTout = 00000000000000000101000000100001 # 30 (ALU)(16toUp32)A = 00000000111111110000000000000000, B = 00000000000000000000000000000001, Result = 00000000000000010000000000000000 # 30 (NPC)CurPCAddr:00000000000000000000000000001000 NextPcAddr:00000000000000000000000000001100 # 30 (MUX RegWriteAddr)control = 01, din0 = 01001, din1 = 01010, out = 01010 # 30 (ALU)(add)A = 00000000111111110000000000000000, B = 00000000000000000000000000000001, Result = 00000000111111110000000000000001 # 30 (MUX DataTo DM/ALU)control = 0, din0 = 00000000000000010000000000000000, din1 = 00000000000000000101000000100001, out = 00000000000000010000000000000000 # 30 (MUX RegWriteData)control = 00, din0 = 00000000111111110000000000000001, din1 = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, din2 = 00000000000000000000000000001100, out = 00000000111111110000000000000001 # 30 (ALU)(add)A = 00000000111111110000000000000000, B = 00000000000000010000000000000000, Result = 00000001000000000000000000000000 # 30 (MUX RegWriteData)control = 00, din0 = 00000001000000000000000000000000, din1 = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, din2 = 00000000000000000000000000001100, out = 00000001000000000000000000000000 # 30 (mips_tb)clk = 1 # 31 (Show GPR) # 31 GPR 0 = 00000000 # 31 GPR 1 = 00000000 # 31 GPR 2 = 00000000 # 31 GPR 3 = 00000000 # 31 GPR 4 = 00000000 # 31 GPR 5 = 00000000 # 31 GPR 6 = 00000000 # 31 GPR 7 = 00000000 # 31 GPR 8 = 00ff0000 # 31 GPR 9 = 00010000 # 31 GPR 10 = 00000000 # 31 GPR 11 = 00000000 # 31 GPR 12 = 00000000 # 31 GPR 13 = 00000000 # 31 GPR 14 = 00000000 # 31 GPR 15 = 00000000 # 31 GPR 16 = 00000000 # 31 GPR 17 = 00000000 # 31 GPR 18 = 00000000 # 31 GPR 19 = 00000000 # 31 GPR 20 = 00000000 # 31 GPR 21 = 00000000 # 31 GPR 22 = 00000000 # 31 GPR 23 = 00000000 # 31 GPR 24 = 00000000 # 31 GPR 25 = 00000000 # 31 GPR 26 = 00000000 # 31 GPR 27 = 00000000 # 31 GPR 28 = 00000000 # 31 GPR 29 = 00000000 # 31 GPR 30 = 00000000 # 31 GPR 31 = 00000000 # 40 (mips_tb)clk = 0 # 50 (Write GPR)PC00000000000000000000000000001000: WriteAddress01010 <= Data00000001000000000000000000000000 # 50 (PC)NextPcAddr00000000000000000000000000001000 # 50 (MUX RegWriteData)control = 00, din0 = 00000001000000000000000000000000, din1 = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, din2 = 00000000000000000000000000010000, out = 00000001000000000000000000000000 # 50 (IM)Current Code:000000 01010 01001 01010 00000 100011 ; TheAddrOfCurCode = 00000000000000000000000000001100 # 50 (NPC)CurPCAddr:00000000000000000000000000001100 NextPcAddr:00000000000000000000000000010000 # 50 (Control) SUBU # 50 (CTRL)RegDst=01 ALUSrc=0 MemToReg=00 RegWrite=1 MemWrite=0 PCSrc=0 ExtOp=00 ALUctr=110 j_ctr=0 jr_ctr=0 DMSrc=0 # 50 (EXT)EXTOp = 00; EXTin = 0101000000100011 EXTout = 00000000000000000101000000100011 # 50 (ALU)(add)A = 00000001000000000000000000000000, B = 00000000000000010000000000000000, Result = 00000001000000010000000000000000 # 50 (NPC)CurPCAddr:00000000000000000000000000001100 NextPcAddr:00000000000000000000000000010000 # 50 (ALU)(sub)A = 00000001000000000000000000000000, B = 00000000000000010000000000000000, Result = 00000000111111110000000000000000 # 50 (MUX DataTo DM/ALU)control = 0, din0 = 00000000000000010000000000000000, din1 = 00000000000000000101000000100011, out = 00000000000000010000000000000000 # 50 (MUX RegWriteData)control = 00, din0 = 00000001000000010000000000000000, din1 = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, din2 = 00000000000000000000000000010000, out = 00000001000000010000000000000000 # 50 (MUX RegWriteData)control = 00, din0 = 00000000111111110000000000000000, din1 = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, din2 = 00000000000000000000000000010000, out = 00000000111111110000000000000000 # 50 (mips_tb)clk = 1 # 51 (Show GPR) # 51 GPR 0 = 00000000 # 51 GPR 1 = 00000000 # 51 GPR 2 = 00000000 # 51 GPR 3 = 00000000 # 51 GPR 4 = 00000000 # 51 GPR 5 = 00000000 # 51 GPR 6 = 00000000 # 51 GPR 7 = 00000000 # 51 GPR 8 = 00ff0000 # 51 GPR 9 = 00010000 # 51 GPR 10 = 01000000 # 51 GPR 11 = 00000000 # 51 GPR 12 = 00000000 # 51 GPR 13 = 00000000 # 51 GPR 14 = 00000000 # 51 GPR 15 = 00000000 # 51 GPR 16 = 00000000 # 51 GPR 17 = 00000000 # 51 GPR 18 = 00000000 # 51 GPR 19 = 00000000 # 51 GPR 20 = 00000000 # 51 GPR 21 = 00000000 # 51 GPR 22 = 00000000 # 51 GPR 23 = 00000000 # 51 GPR 24 = 00000000 # 51 GPR 25 = 00000000 # 51 GPR 26 = 00000000 # 51 GPR 27 = 00000000 # 51 GPR 28 = 00000000 # 51 GPR 29 = 00000000 # 51 GPR 30 = 00000000 # 51 GPR 31 = 00000000 # 60 (mips_tb)clk = 0 # 70 (Write GPR)PC00000000000000000000000000001100: WriteAddress01010 <= Data00000000111111110000000000000000 # 70 (PC)NextPcAddr00000000000000000000000000001100 # 70 (MUX RegWriteData)control = 00, din0 = 00000000111111110000000000000000, din1 = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, din2 = 00000000000000000000000000010100, out = 00000000111111110000000000000000 # 70 (ALU)(sub)A = 00000000111111110000000000000000, B = 00000000000000010000000000000000, Result = 00000000111111100000000000000000 # 70 (IM)Current Code:001101 01000 01011 01010 10101 010101 ; TheAddrOfCurCode = 00000000000000000000000000010000 # 70 (NPC)CurPCAddr:00000000000000000000000000010000 NextPcAddr:00000000000000000000000000010100 # 70 (MUX DataTo DM/ALU)control = 0, din0 = 00000000000000000000000000000000, din1 = 00000000000000000000000000000000, out = 00000000000000000000000000000000 # 70 (MUX DataTo DM/ALU)control = 0, din0 = 00000000000000000000000000000000, din1 = 00000000000000000101000000100011, out = 00000000000000000000000000000000 # 70 (MUX RegWriteData)control = 00, din0 = 00000000111111100000000000000000, din1 = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, din2 = 00000000000000000000000000010100, out = 00000000111111100000000000000000 # 70 (MUX RegWriteAddr)control = 01, din0 = 01011, din1 = 01010, out = 01010 # 70 (Control) ORI # 70 (CTRL)RegDst=00 ALUSrc=1 MemToReg=00 RegWrite=1 MemWrite=0 PCSrc=0 ExtOp=00 ALUctr=001 j_ctr=0 jr_ctr=0 DMSrc=0 # 70 (EXT)EXTOp = 00; EXTin = 0101010101010101 EXTout = 00000000000000000101010101010101 # 70 (NPC)CurPCAddr:00000000000000000000000000010000 NextPcAddr:00000000000000000000000000010100 # 70 (MUX RegWriteAddr)control = 00, din0 = 01011, din1 = 01010, out = 01011 # 70 (ALU)(or)A = 00000000111111110000000000000000, B = 00000000000000000000000000000000, Result = 00000000111111110000000000000000 # 70 (MUX DataTo DM/ALU)control = 1, din0 = 00000000000000000000000000000000, din1 = 00000000000000000101010101010101, out = 00000000000000000101010101010101 # 70 (MUX RegWriteData)control = 00, din0 = 00000000111111110000000000000000, din1 = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, din2 = 00000000000000000000000000010100, out = 00000000111111110000000000000000 # 70 (ALU)(or)A = 00000000111111110000000000000000, B = 00000000000000000101010101010101, Result = 00000000111111110101010101010101 # 70 (MUX RegWriteData)control = 00, din0 = 00000000111111110101010101010101, din1 = 00000000000000000000000000000000, din2 = 00000000000000000000000000010100, out = 00000000111111110101010101010101 # 70 (mips_tb)clk = 1 # 71 (Show GPR) # 71 GPR 0 = 00000000 # 71 GPR 1 = 00000000 # 71 GPR 2 = 00000000 # 71 GPR 3 = 00000000 # 71 GPR 4 = 00000000 # 71 GPR 5 = 00000000 # 71 GPR 6 = 00000000 # 71 GPR 7 = 00000000 # 71 GPR 8 = 00ff0000 # 71 GPR 9 = 00010000 # 71 GPR 10 = 00ff0000 # 71 GPR 11 = 00000000 # 71 GPR 12 = 00000000 # 71 GPR 13 = 00000000 # 71 GPR 14 = 00000000 # 71 GPR 15 = 00000000 # 71 GPR 16 = 00000000 # 71 GPR 17 = 00000000 # 71 GPR 18 = 00000000 # 71 GPR 19 = 00000000 # 71 GPR 20 = 00000000 # 71 GPR 21 = 00000000 # 71 GPR 22 = 00000000 # 71 GPR 23 = 00000000 # 71 GPR 24 = 00000000 # 71 GPR 25 = 00000000 # 71 GPR 26 = 00000000 # 71 GPR 27 = 00000000 # 71 GPR 28 = 00000000 # 71 GPR 29 = 00000000 # 71 GPR 30 = 00000000 # 71 GPR 31 = 00000000 # 80 (mips_tb)clk = 0 # 90 (Write GPR)PC00000000000000000000000000010000: WriteAddress01011 <= Data00000000111111110101010101010101 # 90 (PC)NextPcAddr00000000000000000000000000010000 # 90 (MUX RegWriteData)control = 00, din0 = 00000000111111110101010101010101, din1 = 00000000000000000000000000000000, din2 = 00000000000000000000000000011000, out = 00000000111111110101010101010101 # 90 (MUX DataTo DM/ALU)control = 0, din0 = 00000000111111110101010101010101, din1 = 00000000000000000000000000000000, out = 00000000111111110101010101010101 # 90 (MUX DataTo DM/ALU)control = 1, din0 = 00000000111111110101010101010101, din1 = 00000000000000000101010101010101, out = 00000000000000000101010101010101 # 90 (IM)Current Code:001111 00000 01100 00000 00000 000001 ; TheAddrOfCurCode = 00000000000000000000000000010100 # 90 (NPC)CurPCAddr:00000000000000000000000000010100 NextPcAddr:00000000000000000000000000011000 # 90 (MUX DataTo DM/ALU)control = 0, din0 = 00000000000000000000000000000000, din1 = 00000000000000000000000000000000, out = 00000000000000000000000000000000 # 90 (MUX DataTo DM/ALU)control = 1, din0 = 00000000000000000000000000000000, din1 = 00000000000000000101010101010101, out = 00000000000000000101010101010101 # 90 (MUX RegWriteAddr)control = 00, din0 = 01100, din1 = 00000, out = 01100 # 90 (Control) LUI # 90 (CTRL)RegDst=00 ALUSrc=1 MemToReg=00 RegWrite=1 MemWrite=0 PCSrc=0 ExtOp=00 ALUctr=011 j_ctr=0 jr_ctr=0 DMSrc=0 # 90 (EXT)EXTOp = 00; EXTin = 0000000000000001 EXTout = 00000000000000000000000000000001 # 90 (ALU)(or)A = 00000000000000000000000000000000, B = 00000000000000000101010101010101, Result = 00000000000000000101010101010101 # 90 (NPC)CurPCAddr:00000000000000000000000000010100 NextPcAddr:00000000000000000000000000011000 # 90 (ALU)(16toUp32)A = 00000000000000000000000000000000, B = 00000000000000000101010101010101, Result = 01010101010101010000000000000000 # 90 (MUX DataTo DM/ALU)control = 1, din0 = 00000000000000000000000000000000, din1 = 00000000000000000000000000000001, out = 00000000000000000000000000000001 # 90 (MUX RegWriteData)control = 00, din0 = 00000000000000000101010101010101, din1 = 00000000000000000000000000000000, din2 = 00000000000000000000000000011000, out = 00000000000000000101010101010101 # 90 (MUX RegWriteData)control = 00, din0 = 01010101010101010000000000000000, din1 = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, din2 = 00000000000000000000000000011000, out = 01010101010101010000000000000000 # 90 (ALU)(16toUp32)A = 00000000000000000000000000000000, B = 00000000000000000000000000000001, Result = 00000000000000010000000000000000 # 90 (MUX RegWriteData)control = 00, din0 = 00000000000000010000000000000000, din1 = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, din2 = 00000000000000000000000000011000, out = 00000000000000010000000000000000 # 90 (mips_tb)clk = 1 # 91 (Show GPR) # 91 GPR 0 = 00000000 # 91 GPR 1 = 00000000 # 91 GPR 2 = 00000000 # 91 GPR 3 = 00000000 # 91 GPR 4 = 00000000 # 91 GPR 5 = 00000000 # 91 GPR 6 = 00000000 # 91 GPR 7 = 00000000 # 91 GPR 8 = 00ff0000 # 91 GPR 9 = 00010000 # 91 GPR 10 = 00ff0000 # 91 GPR 11 = 00ff5555 # 91 GPR 12 = 00000000 # 91 GPR 13 = 00000000 # 91 GPR 14 = 00000000 # 91 GPR 15 = 00000000 # 91 GPR 16 = 00000000 # 91 GPR 17 = 00000000 # 91 GPR 18 = 00000000 # 91 GPR 19 = 00000000 # 91 GPR 20 = 00000000 # 91 GPR 21 = 00000000 # 91 GPR 22 = 00000000 # 91 GPR 23 = 00000000 # 91 GPR 24 = 00000000 # 91 GPR 25 = 00000000 # 91 GPR 26 = 00000000 # 91 GPR 27 = 00000000 # 91 GPR 28 = 00000000 # 91 GPR 29 = 00000000 # 91 GPR 30 = 00000000 # 91 GPR 31 = 00000000 # 100 (mips_tb)clk = 0 # 110 (Write GPR)PC00000000000000000000000000010100: WriteAddress01100 <= Data00000000000000010000000000000000 # 110 (PC)NextPcAddr00000000000000000000000000010100 # 110 (MUX RegWriteData)control = 00, din0 = 00000000000000010000000000000000, din1 = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, din2 = 00000000000000000000000000011100, out = 00000000000000010000000000000000 # 110 (MUX DataTo DM/ALU)control = 0, din0 = 00000000000000010000000000000000, din1 = 00000000000000000000000000000000, out = 00000000000000010000000000000000 # 110 (MUX DataTo DM/ALU)control = 1, din0 = 00000000000000010000000000000000, din1 = 00000000000000000000000000000001, out = 00000000000000000000000000000001 # 110 (IM)Current Code:001111 00000 01101 00000 00000 000001 ; TheAddrOfCurCode = 00000000000000000000000000011000 # 110 (NPC)CurPCAddr:00000000000000000000000000011000 NextPcAddr:00000000000000000000000000011100 # 110 (MUX DataTo DM/ALU)control = 0, din0 = 00000000000000000000000000000000, din1 = 00000000000000000000000000000000, out = 00000000000000000000000000000000 # 110 (MUX DataTo DM/ALU)control = 1, din0 = 00000000000000000000000000000000, din1 = 00000000000000000000000000000001, out = 00000000000000000000000000000001 # 110 (MUX RegWriteAddr)control = 00, din0 = 01101, din1 = 00000, out = 01101 # 110 (NPC)CurPCAddr:00000000000000000000000000011000 NextPcAddr:00000000000000000000000000011100 # 110 (mips_tb)clk = 1 # 111 (Show GPR) # 111 GPR 0 = 00000000 # 111 GPR 1 = 00000000 # 111 GPR 2 = 00000000 # 111 GPR 3 = 00000000 # 111 GPR 4 = 00000000 # 111 GPR 5 = 00000000 # 111 GPR 6 = 00000000 # 111 GPR 7 = 00000000 # 111 GPR 8 = 00ff0000 # 111 GPR 9 = 00010000 # 111 GPR 10 = 00ff0000 # 111 GPR 11 = 00ff5555 # 111 GPR 12 = 00010000 # 111 GPR 13 = 00000000 # 111 GPR 14 = 00000000 # 111 GPR 15 = 00000000 # 111 GPR 16 = 00000000 # 111 GPR 17 = 00000000 # 111 GPR 18 = 00000000 # 111 GPR 19 = 00000000 # 111 GPR 20 = 00000000 # 111 GPR 21 = 00000000 # 111 GPR 22 = 00000000 # 111 GPR 23 = 00000000 # 111 GPR 24 = 00000000 # 111 GPR 25 = 00000000 # 111 GPR 26 = 00000000 # 111 GPR 27 = 00000000 # 111 GPR 28 = 00000000 # 111 GPR 29 = 00000000 # 111 GPR 30 = 00000000 # 111 GPR 31 = 00000000 # 120 (mips_tb)clk = 0 # 130 (Write GPR)PC00000000000000000000000000011000: WriteAddress01101 <= Data00000000000000010000000000000000 # 130 (PC)NextPcAddr00000000000000000000000000011000 # 130 (MUX RegWriteData)control = 00, din0 = 00000000000000010000000000000000, din1 = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, din2 = 00000000000000000000000000100000, out = 00000000000000010000000000000000 # 130 (MUX DataTo DM/ALU)control = 0, din0 = 00000000000000010000000000000000, din1 = 00000000000000000000000000000000, out = 00000000000000010000000000000000 # 130 (MUX DataTo DM/ALU)control = 1, din0 = 00000000000000010000000000000000, din1 = 00000000000000000000000000000001, out = 00000000000000000000000000000001 # 130 (IM)Current Code:001101 01101 01101 00000 00000 000001 ; TheAddrOfCurCode = 00000000000000000000000000011100 # 130 (NPC)CurPCAddr:00000000000000000000000000011100 NextPcAddr:00000000000000000000000000100000 # 130 (Control) ORI # 130 (CTRL)RegDst=00 ALUSrc=1 MemToReg=00 RegWrite=1 MemWrite=0 PCSrc=0 ExtOp=00 ALUctr=001 j_ctr=0 jr_ctr=0 DMSrc=0 # 130 (ALU)(16toUp32)A = 00000000000000010000000000000000, B = 00000000000000000000000000000001, Result = 00000000000000010000000000000000 # 130 (NPC)CurPCAddr:00000000000000000000000000011100 NextPcAddr:00000000000000000000000000100000 # 130 (ALU)(or)A = 00000000000000010000000000000000, B = 00000000000000000000000000000001, Result = 00000000000000010000000000000001 # 130 (MUX RegWriteData)control = 00, din0 = 00000000000000010000000000000001, din1 = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, din2 = 00000000000000000000000000100000, out = 00000000000000010000000000000001 # 130 (mips_tb)clk = 1 # 131 (Show GPR) # 131 GPR 0 = 00000000 # 131 GPR 1 = 00000000 # 131 GPR 2 = 00000000 # 131 GPR 3 = 00000000 # 131 GPR 4 = 00000000 # 131 GPR 5 = 00000000 # 131 GPR 6 = 00000000 # 131 GPR 7 = 00000000 # 131 GPR 8 = 00ff0000 # 131 GPR 9 = 00010000 # 131 GPR 10 = 00ff0000 # 131 GPR 11 = 00ff5555 # 131 GPR 12 = 00010000 # 131 GPR 13 = 00010000 # 131 GPR 14 = 00000000 # 131 GPR 15 = 00000000 # 131 GPR 16 = 00000000 # 131 GPR 17 = 00000000 # 131 GPR 18 = 00000000 # 131 GPR 19 = 00000000 # 131 GPR 20 = 00000000 # 131 GPR 21 = 00000000 # 131 GPR 22 = 00000000 # 131 GPR 23 = 00000000 # 131 GPR 24 = 00000000 # 131 GPR 25 = 00000000 # 131 GPR 26 = 00000000 # 131 GPR 27 = 00000000 # 131 GPR 28 = 00000000 # 131 GPR 29 = 00000000 # 131 GPR 30 = 00000000 # 131 GPR 31 = 00000000 # 140 (mips_tb)clk = 0 # 150 (Write GPR)PC00000000000000000000000000011100: WriteAddress01101 <= Data00000000000000010000000000000001 # 150 (PC)NextPcAddr00000000000000000000000000011100 # 150 (MUX RegWriteData)control = 00, din0 = 00000000000000010000000000000001, din1 = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, din2 = 00000000000000000000000000100100, out = 00000000000000010000000000000001 # 150 (MUX DataTo DM/ALU)control = 0, din0 = 00000000000000010000000000000001, din1 = 00000000000000000000000000000000, out = 00000000000000010000000000000001 # 150 (MUX DataTo DM/ALU)control = 1, din0 = 00000000000000010000000000000001, din1 = 00000000000000000000000000000001, out = 00000000000000000000000000000001 # 150 (ALU)(or)A = 00000000000000010000000000000001, B = 00000000000000000000000000000001, Result = 00000000000000010000000000000001 # 150 (IM)Current Code:000000 01101 01100 01100 00000 100011 ; TheAddrOfCurCode = 00000000000000000000000000100000 # 150 (NPC)CurPCAddr:00000000000000000000000000100000 NextPcAddr:00000000000000000000000000100100 # 150 (MUX DataTo DM/ALU)control = 0, din0 = 00000000000000010000000000000000, din1 = 00000000000000000000000000000000, out = 00000000000000010000000000000000 # 150 (MUX DataTo DM/ALU)control = 1, din0 = 00000000000000010000000000000000, din1 = 00000000000000000000000000000001, out = 00000000000000000000000000000001 # 150 (MUX RegWriteAddr)control = 00, din0 = 01100, din1 = 01100, out = 01100 # 150 (Control) SUBU # 150 (CTRL)RegDst=01 ALUSrc=0 MemToReg=00 RegWrite=1 MemWrite=0 PCSrc=0 ExtOp=00 ALUctr=110 j_ctr=0 jr_ctr=0 DMSrc=0 # 150 (EXT)EXTOp = 00; EXTin = 0110000000100011 EXTout = 00000000000000000110000000100011 # 150 (NPC)CurPCAddr:00000000000000000000000000100000 NextPcAddr:00000000000000000000000000100100 # 150 (MUX RegWriteAddr)control = 01, din0 = 01100, din1 = 01100, out = 01100 # 150 (ALU)(sub)A = 00000000000000010000000000000001, B = 00000000000000000000000000000001, Result = 00000000000000010000000000000000 # 150 (MUX DataTo DM/ALU)control = 0, din0 = 00000000000000010000000000000000, din1 = 00000000000000000110000000100011, out = 00000000000000010000000000000000 # 150 (MUX RegWriteData)control = 00, din0 = 00000000000000010000000000000000, din1 = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, din2 = 00000000000000000000000000100100, out = 00000000000000010000000000000000 # 150 (ALU)(sub)A = 00000000000000010000000000000001, B = 00000000000000010000000000000000, Result = 00000000000000000000000000000001 # 150 (MUX RegWriteData)control = 00, din0 = 00000000000000000000000000000001, din1 = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, din2 = 00000000000000000000000000100100, out = 00000000000000000000000000000001 # 150 (mips_tb)clk = 1 # 151 (Show GPR) # 151 GPR 0 = 00000000 # 151 GPR 1 = 00000000 # 151 GPR 2 = 00000000 # 151 GPR 3 = 00000000 # 151 GPR 4 = 00000000 # 151 GPR 5 = 00000000 # 151 GPR 6 = 00000000 # 151 GPR 7 = 00000000 # 151 GPR 8 = 00ff0000 # 151 GPR 9 = 00010000 # 151 GPR 10 = 00ff0000 # 151 GPR 11 = 00ff5555 # 151 GPR 12 = 00010000 # 151 GPR 13 = 00010001 # 151 GPR 14 = 00000000 # 151 GPR 15 = 00000000 # 151 GPR 16 = 00000000 # 151 GPR 17 = 00000000 # 151 GPR 18 = 00000000 # 151 GPR 19 = 00000000 # 151 GPR 20 = 00000000 # 151 GPR 21 = 00000000 # 151 GPR 22 = 00000000 # 151 GPR 23 = 00000000 # 151 GPR 24 = 00000000 # 151 GPR 25 = 00000000 # 151 GPR 26 = 00000000 # 151 GPR 27 = 00000000 # 151 GPR 28 = 00000000 # 151 GPR 29 = 00000000 # 151 GPR 30 = 00000000 # 151 GPR 31 = 00000000 # 160 (mips_tb)clk = 0 # 170 (Write GPR)PC00000000000000000000000000100000: WriteAddress01100 <= Data00000000000000000000000000000001 # 170 (PC)NextPcAddr00000000000000000000000000100000 # 170 (MUX RegWriteData)control = 00, din0 = 00000000000000000000000000000001, din1 = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, din2 = 00000000000000000000000000101000, out = 00000000000000000000000000000001 # 170 (MUX DataTo DM/ALU)control = 0, din0 = 00000000000000000000000000000001, din1 = 00000000000000000000000000000000, out = 00000000000000000000000000000001 # 170 (MUX DataTo DM/ALU)control = 0, din0 = 00000000000000000000000000000001, din1 = 00000000000000000110000000100011, out = 00000000000000000000000000000001 # 170 (IM)Current Code:000000 01111 01100 01000 00000 100001 ; TheAddrOfCurCode = 00000000000000000000000000100100 # 170 (NPC)CurPCAddr:00000000000000000000000000100100 NextPcAddr:00000000000000000000000000101000 # 170 (MUX RegWriteAddr)control = 01, din0 = 01100, din1 = 01000, out = 01000 # 170 (Control) ADDU # 170 (CTRL)RegDst=01 ALUSrc=0 MemToReg=00 RegWrite=1 MemWrite=0 PCSrc=0 ExtOp=00 ALUctr=010 j_ctr=0 jr_ctr=0 DMSrc=0 # 170 (EXT)EXTOp = 00; EXTin = 0100000000100001 EXTout = 00000000000000000100000000100001 # 170 (ALU)(sub)A = 00000000000000000000000000000000, B = 00000000000000000000000000000001, Result = 11111111111111111111111111111111 # 170 (NPC)CurPCAddr:00000000000000000000000000100100 NextPcAddr:00000000000000000000000000101000 # 170 (ALU)(add)A = 00000000000000000000000000000000, B = 00000000000000000000000000000001, Result = 00000000000000000000000000000001 # 170 (MUX DataTo DM/ALU)control = 0, din0 = 00000000000000000000000000000001, din1 = 00000000000000000100000000100001, out = 00000000000000000000000000000001 # 170 (MUX RegWriteData)control = 00, din0 = 11111111111111111111111111111111, din1 = 00000000000000000000000000000000, din2 = 00000000000000000000000000101000, out = 11111111111111111111111111111111 # 170 (MUX RegWriteData)control = 00, din0 = 00000000000000000000000000000001, din1 = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, din2 = 00000000000000000000000000101000, out = 00000000000000000000000000000001 # 170 (mips_tb)clk = 1 # 171 (Show GPR) # 171 GPR 0 = 00000000 # 171 GPR 1 = 00000000 # 171 GPR 2 = 00000000 # 171 GPR 3 = 00000000 # 171 GPR 4 = 00000000 # 171 GPR 5 = 00000000 # 171 GPR 6 = 00000000 # 171 GPR 7 = 00000000 # 171 GPR 8 = 00ff0000 # 171 GPR 9 = 00010000 # 171 GPR 10 = 00ff0000 # 171 GPR 11 = 00ff5555 # 171 GPR 12 = 00000001 # 171 GPR 13 = 00010001 # 171 GPR 14 = 00000000 # 171 GPR 15 = 00000000 # 171 GPR 16 = 00000000 # 171 GPR 17 = 00000000 # 171 GPR 18 = 00000000 # 171 GPR 19 = 00000000 # 171 GPR 20 = 00000000 # 171 GPR 21 = 00000000 # 171 GPR 22 = 00000000 # 171 GPR 23 = 00000000 # 171 GPR 24 = 00000000 # 171 GPR 25 = 00000000 # 171 GPR 26 = 00000000 # 171 GPR 27 = 00000000 # 171 GPR 28 = 00000000 # 171 GPR 29 = 00000000 # 171 GPR 30 = 00000000 # 171 GPR 31 = 00000000 # 180 (mips_tb)clk = 0 # 190 (Write GPR)PC00000000000000000000000000100100: WriteAddress01000 <= Data00000000000000000000000000000001 # 190 (PC)NextPcAddr00000000000000000000000000100100 # 190 (MUX RegWriteData)control = 00, din0 = 00000000000000000000000000000001, din1 = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, din2 = 00000000000000000000000000101100, out = 00000000000000000000000000000001 # 190 (IM)Current Code:000000 01000 01000 01000 00000 100001 ; TheAddrOfCurCode = 00000000000000000000000000101000 # 190 (NPC)CurPCAddr:00000000000000000000000000101000 NextPcAddr:00000000000000000000000000101100 # 190 (MUX RegWriteAddr)control = 01, din0 = 01000, din1 = 01000, out = 01000 # 190 (ALU)(add)A = 00000000000000000000000000000001, B = 00000000000000000000000000000001, Result = 00000000000000000000000000000010 # 190 (NPC)CurPCAddr:00000000000000000000000000101000 NextPcAddr:00000000000000000000000000101100 # 190 (Control) ADDU # 190 (CTRL)RegDst=01 ALUSrc=0 MemToReg=00 RegWrite=1 MemWrite=0 PCSrc=0 ExtOp=00 ALUctr=010 j_ctr=0 jr_ctr=0 DMSrc=0 # 190 (MUX RegWriteData)control = 00, din0 = 00000000000000000000000000000010, din1 = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, din2 = 00000000000000000000000000101100, out = 00000000000000000000000000000010 # 190 (mips_tb)clk = 1 # 191 (Show GPR) # 191 GPR 0 = 00000000 # 191 GPR 1 = 00000000 # 191 GPR 2 = 00000000 # 191 GPR 3 = 00000000 # 191 GPR 4 = 00000000 # 191 GPR 5 = 00000000 # 191 GPR 6 = 00000000 # 191 GPR 7 = 00000000 # 191 GPR 8 = 00000001 # 191 GPR 9 = 00010000 # 191 GPR 10 = 00ff0000 # 191 GPR 11 = 00ff5555 # 191 GPR 12 = 00000001 # 191 GPR 13 = 00010001 # 191 GPR 14 = 00000000 # 191 GPR 15 = 00000000 # 191 GPR 16 = 00000000 # 191 GPR 17 = 00000000 # 191 GPR 18 = 00000000 # 191 GPR 19 = 00000000 # 191 GPR 20 = 00000000 # 191 GPR 21 = 00000000 # 191 GPR 22 = 00000000 # 191 GPR 23 = 00000000 # 191 GPR 24 = 00000000 # 191 GPR 25 = 00000000 # 191 GPR 26 = 00000000 # 191 GPR 27 = 00000000 # 191 GPR 28 = 00000000 # 191 GPR 29 = 00000000 # 191 GPR 30 = 00000000 # 191 GPR 31 = 00000000 # 200 (mips_tb)clk = 0 # 210 (Write GPR)PC00000000000000000000000000101000: WriteAddress01000 <= Data00000000000000000000000000000010 # 210 (PC)NextPcAddr00000000000000000000000000101000 # 210 (MUX RegWriteData)control = 00, din0 = 00000000000000000000000000000010, din1 = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, din2 = 00000000000000000000000000110000, out = 00000000000000000000000000000010 # 210 (MUX DataTo DM/ALU)control = 0, din0 = 00000000000000000000000000000010, din1 = 00000000000000000000000000000000, out = 00000000000000000000000000000010 # 210 (MUX DataTo DM/ALU)control = 0, din0 = 00000000000000000000000000000010, din1 = 00000000000000000100000000100001, out = 00000000000000000000000000000010 # 210 (ALU)(add)A = 00000000000000000000000000000010, B = 00000000000000000000000000000001, Result = 00000000000000000000000000000011 # 210 (IM)Current Code:000000 01000 01000 01000 00000 100001 ; TheAddrOfCurCode = 00000000000000000000000000101100 # 210 (NPC)CurPCAddr:00000000000000000000000000101100 NextPcAddr:00000000000000000000000000110000 # 210 (Control) ADDU # 210 (CTRL)RegDst=01 ALUSrc=0 MemToReg=00 RegWrite=1 MemWrite=0 PCSrc=0 ExtOp=00 ALUctr=010 j_ctr=0 jr_ctr=0 DMSrc=0 # 210 (ALU)(add)A = 00000000000000000000000000000010, B = 00000000000000000000000000000010, Result = 00000000000000000000000000000100 # 210 (MUX RegWriteData)control = 00, din0 = 00000000000000000000000000000011, din1 = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, din2 = 00000000000000000000000000110000, out = 00000000000000000000000000000011 # 210 (Control) ADDU # 210 (CTRL)RegDst=01 ALUSrc=0 MemToReg=00 RegWrite=1 MemWrite=0 PCSrc=0 ExtOp=00 ALUctr=010 j_ctr=0 jr_ctr=0 DMSrc=0 # 210 (MUX RegWriteData)control = 00, din0 = 00000000000000000000000000000100, din1 = 00000000000000000000000000000000, din2 = 00000000000000000000000000110000, out = 00000000000000000000000000000100 # 210 (mips_tb)clk = 1 # 211 (Show GPR) # 211 GPR 0 = 00000000 # 211 GPR 1 = 00000000 # 211 GPR 2 = 00000000 # 211 GPR 3 = 00000000 # 211 GPR 4 = 00000000 # 211 GPR 5 = 00000000 # 211 GPR 6 = 00000000 # 211 GPR 7 = 00000000 # 211 GPR 8 = 00000002 # 211 GPR 9 = 00010000 # 211 GPR 10 = 00ff0000 # 211 GPR 11 = 00ff5555 # 211 GPR 12 = 00000001 # 211 GPR 13 = 00010001 # 211 GPR 14 = 00000000 # 211 GPR 15 = 00000000 # 211 GPR 16 = 00000000 # 211 GPR 17 = 00000000 # 211 GPR 18 = 00000000 # 211 GPR 19 = 00000000 # 211 GPR 20 = 00000000 # 211 GPR 21 = 00000000 # 211 GPR 22 = 00000000 # 211 GPR 23 = 00000000 # 211 GPR 24 = 00000000 # 211 GPR 25 = 00000000 # 211 GPR 26 = 00000000 # 211 GPR 27 = 00000000 # 211 GPR 28 = 00000000 # 211 GPR 29 = 00000000 # 211 GPR 30 = 00000000 # 211 GPR 31 = 00000000 # 220 (mips_tb)clk = 0 # 230 (Write GPR)PC00000000000000000000000000101100: WriteAddress01000 <= Data00000000000000000000000000000100 # 230 (PC)NextPcAddr00000000000000000000000000101100 # 230 (MUX RegWriteData)control = 00, din0 = 00000000000000000000000000000100, din1 = 00000000000000000000000000000000, din2 = 00000000000000000000000000110100, out = 00000000000000000000000000000100 # 230 (MUX DataTo DM/ALU)control = 0, din0 = 00000000000000000000000000000100, din1 = 00000000000000000000000000000000, out = 00000000000000000000000000000100 # 230 (MUX DataTo DM/ALU)control = 0, din0 = 00000000000000000000000000000100, din1 = 00000000000000000100000000100001, out = 00000000000000000000000000000100 # 230 (ALU)(add)A = 00000000000000000000000000000100, B = 00000000000000000000000000000010, Result = 00000000000000000000000000000110 # 230 (IM)Current Code:000000 01111 01111 01001 00000 100001 ; TheAddrOfCurCode = 00000000000000000000000000110000 # 230 (NPC)CurPCAddr:00000000000000000000000000110000 NextPcAddr:00000000000000000000000000110100 # 230 (MUX DataTo DM/ALU)control = 0, din0 = 00000000000000000000000000000000, din1 = 00000000000000000000000000000000, out = 00000000000000000000000000000000 # 230 (MUX DataTo DM/ALU)control = 0, din0 = 00000000000000000000000000000000, din1 = 00000000000000000100000000100001, out = 00000000000000000000000000000000 # 230 (MUX RegWriteData)control = 00, din0 = 00000000000000000000000000000110, din1 = 00000000000000000000000000000000, din2 = 00000000000000000000000000110100, out = 00000000000000000000000000000110 # 230 (MUX RegWriteAddr)control = 01, din0 = 01111, din1 = 01001, out = 01001 # 230 (EXT)EXTOp = 00; EXTin = 0100100000100001 EXTout = 00000000000000000100100000100001 # 230 (ALU)(add)A = 00000000000000000000000000000000, B = 00000000000000000000000000000100, Result = 00000000000000000000000000000100 # 230 (NPC)CurPCAddr:00000000000000000000000000110000 NextPcAddr:00000000000000000000000000110100 # 230 (Control) ADDU # 230 (CTRL)RegDst=01 ALUSrc=0 MemToReg=00 RegWrite=1 MemWrite=0 PCSrc=0 ExtOp=00 ALUctr=010 j_ctr=0 jr_ctr=0 DMSrc=0 # 230 (ALU)(add)A = 00000000000000000000000000000000, B = 00000000000000000000000000000000, Result = 00000000000000000000000000000000 # 230 (MUX DataTo DM/ALU)control = 0, din0 = 00000000000000000000000000000000, din1 = 00000000000000000100100000100001, out = 00000000000000000000000000000000 # 230 (MUX RegWriteData)control = 00, din0 = 00000000000000000000000000000100, din1 = 00000000000000000000000000000000, din2 = 00000000000000000000000000110100, out = 00000000000000000000000000000100 # 230 (Control) ADDU # 230 (CTRL)RegDst=01 ALUSrc=0 MemToReg=00 RegWrite=1 MemWrite=0 PCSrc=0 ExtOp=00 ALUctr=010 j_ctr=0 jr_ctr=0 DMSrc=0 # 230 (MUX RegWriteData)control = 00, din0 = 00000000000000000000000000000000, din1 = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, din2 = 00000000000000000000000000110100, out = 00000000000000000000000000000000 # 230 (mips_tb)clk = 1 # 231 (Show GPR) # 231 GPR 0 = 00000000 # 231 GPR 1 = 00000000 # 231 GPR 2 = 00000000 # 231 GPR 3 = 00000000 # 231 GPR 4 = 00000000 # 231 GPR 5 = 00000000 # 231 GPR 6 = 00000000 # 231 GPR 7 = 00000000 # 231 GPR 8 = 00000004 # 231 GPR 9 = 00010000 # 231 GPR 10 = 00ff0000 # 231 GPR 11 = 00ff5555 # 231 GPR 12 = 00000001 # 231 GPR 13 = 00010001 # 231 GPR 14 = 00000000 # 231 GPR 15 = 00000000 # 231 GPR 16 = 00000000 # 231 GPR 17 = 00000000 # 231 GPR 18 = 00000000 # 231 GPR 19 = 00000000 # 231 GPR 20 = 00000000 # 231 GPR 21 = 00000000 # 231 GPR 22 = 00000000 # 231 GPR 23 = 00000000 # 231 GPR 24 = 00000000 # 231 GPR 25 = 00000000 # 231 GPR 26 = 00000000 # 231 GPR 27 = 00000000 # 231 GPR 28 = 00000000 # 231 GPR 29 = 00000000 # 231 GPR 30 = 00000000 # 231 GPR 31 = 00000000 # 240 (mips_tb)clk = 0 # 250 (Write GPR)PC00000000000000000000000000110000: WriteAddress01001 <= Data00000000000000000000000000000000 # 250 (PC)NextPcAddr00000000000000000000000000110000 # 250 (MUX RegWriteData)control = 00, din0 = 00000000000000000000000000000000, din1 = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, din2 = 00000000000000000000000000111000, out = 00000000000000000000000000000000 # 250 (IM)Current Code:000000 01100 01100 01101 00000 100001 ; TheAddrOfCurCode = 00000000000000000000000000110100 # 250 (NPC)CurPCAddr:00000000000000000000000000110100 NextPcAddr:00000000000000000000000000111000 # 250 (MUX DataTo DM/ALU)control = 0, din0 = 00000000000000000000000000000001, din1 = 00000000000000000000000000000000, out = 00000000000000000000000000000001 # 250 (MUX DataTo DM/ALU)control = 0, din0 = 00000000000000000000000000000001, din1 = 00000000000000000100100000100001, out = 00000000000000000000000000000001 # 250 (MUX RegWriteAddr)control = 01, din0 = 01100, din1 = 01101, out = 01101 # 250 (EXT)EXTOp = 00; EXTin = 0110100000100001 EXTout = 00000000000000000110100000100001 # 250 (ALU)(add)A = 00000000000000000000000000000001, B = 00000000000000000000000000000000, Result = 00000000000000000000000000000001 # 250 (NPC)CurPCAddr:00000000000000000000000000110100 NextPcAddr:00000000000000000000000000111000 # 250 (Control) ADDU # 250 (CTRL)RegDst=01 ALUSrc=0 MemToReg=00 RegWrite=1 MemWrite=0 PCSrc=0 ExtOp=00 ALUctr=010 j_ctr=0 jr_ctr=0 DMSrc=0 # 250 (ALU)(add)A = 00000000000000000000000000000001, B = 00000000000000000000000000000001, Result = 00000000000000000000000000000010 # 250 (MUX DataTo DM/ALU)control = 0, din0 = 00000000000000000000000000000001, din1 = 00000000000000000110100000100001, out = 00000000000000000000000000000001 # 250 (MUX RegWriteData)control = 00, din0 = 00000000000000000000000000000001, din1 = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, din2 = 00000000000000000000000000111000, out = 00000000000000000000000000000001 # 250 (Control) ADDU # 250 (CTRL)RegDst=01 ALUSrc=0 MemToReg=00 RegWrite=1 MemWrite=0 PCSrc=0 ExtOp=00 ALUctr=010 j_ctr=0 jr_ctr=0 DMSrc=0 # 250 (MUX RegWriteData)control = 00, din0 = 00000000000000000000000000000010, din1 = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, din2 = 00000000000000000000000000111000, out = 00000000000000000000000000000010 # 250 (mips_tb)clk = 1 # 251 (Show GPR) # 251 GPR 0 = 00000000 # 251 GPR 1 = 00000000 # 251 GPR 2 = 00000000 # 251 GPR 3 = 00000000 # 251 GPR 4 = 00000000 # 251 GPR 5 = 00000000 # 251 GPR 6 = 00000000 # 251 GPR 7 = 00000000 # 251 GPR 8 = 00000004 # 251 GPR 9 = 00000000 # 251 GPR 10 = 00ff0000 # 251 GPR 11 = 00ff5555 # 251 GPR 12 = 00000001 # 251 GPR 13 = 00010001 # 251 GPR 14 = 00000000 # 251 GPR 15 = 00000000 # 251 GPR 16 = 00000000 # 251 GPR 17 = 00000000 # 251 GPR 18 = 00000000 # 251 GPR 19 = 00000000 # 251 GPR 20 = 00000000 # 251 GPR 21 = 00000000 # 251 GPR 22 = 00000000 # 251 GPR 23 = 00000000 # 251 GPR 24 = 00000000 # 251 GPR 25 = 00000000 # 251 GPR 26 = 00000000 # 251 GPR 27 = 00000000 # 251 GPR 28 = 00000000 # 251 GPR 29 = 00000000 # 251 GPR 30 = 00000000 # 251 GPR 31 = 00000000 # 260 (mips_tb)clk = 0 # 270 (Write GPR)PC00000000000000000000000000110100: WriteAddress01101 <= Data00000000000000000000000000000010 # 270 (PC)NextPcAddr00000000000000000000000000110100 # 270 (MUX RegWriteData)control = 00, din0 = 00000000000000000000000000000010, din1 = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, din2 = 00000000000000000000000000111100, out = 00000000000000000000000000000010 # 270 (IM)Current Code:000000 01101 01101 01101 00000 100001 ; TheAddrOfCurCode = 00000000000000000000000000111000 # 270 (NPC)CurPCAddr:00000000000000000000000000111000 NextPcAddr:00000000000000000000000000111100 # 270 (MUX DataTo DM/ALU)control = 0, din0 = 00000000000000000000000000000010, din1 = 00000000000000000000000000000000, out = 00000000000000000000000000000010 # 270 (MUX DataTo DM/ALU)control = 0, din0 = 00000000000000000000000000000010, din1 = 00000000000000000110100000100001, out = 00000000000000000000000000000010 # 270 (MUX RegWriteAddr)control = 01, din0 = 01101, din1 = 01101, out = 01101 # 270 (ALU)(add)A = 00000000000000000000000000000010, B = 00000000000000000000000000000001, Result = 00000000000000000000000000000011 # 270 (NPC)CurPCAddr:00000000000000000000000000111000 NextPcAddr:00000000000000000000000000111100 # 270 (Control) ADDU # 270 (CTRL)RegDst=01 ALUSrc=0 MemToReg=00 RegWrite=1 MemWrite=0 PCSrc=0 ExtOp=00 ALUctr=010 j_ctr=0 jr_ctr=0 DMSrc=0 # 270 (ALU)(add)A = 00000000000000000000000000000010, B = 00000000000000000000000000000010, Result = 00000000000000000000000000000100 # 270 (MUX RegWriteData)control = 00, din0 = 00000000000000000000000000000011, din1 = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, din2 = 00000000000000000000000000111100, out = 00000000000000000000000000000011 # 270 (Control) ADDU # 270 (CTRL)RegDst=01 ALUSrc=0 MemToReg=00 RegWrite=1 MemWrite=0 PCSrc=0 ExtOp=00 ALUctr=010 j_ctr=0 jr_ctr=0 DMSrc=0 # 270 (MUX RegWriteData)control = 00, din0 = 00000000000000000000000000000100, din1 = 00000000000000000000000000000000, din2 = 00000000000000000000000000111100, out = 00000000000000000000000000000100 # 270 (mips_tb)clk = 1 # 271 (Show GPR) # 271 GPR 0 = 00000000 # 271 GPR 1 = 00000000 # 271 GPR 2 = 00000000 # 271 GPR 3 = 00000000 # 271 GPR 4 = 00000000 # 271 GPR 5 = 00000000 # 271 GPR 6 = 00000000 # 271 GPR 7 = 00000000 # 271 GPR 8 = 00000004 # 271 GPR 9 = 00000000 # 271 GPR 10 = 00ff0000 # 271 GPR 11 = 00ff5555 # 271 GPR 12 = 00000001 # 271 GPR 13 = 00000002 # 271 GPR 14 = 00000000 # 271 GPR 15 = 00000000 # 271 GPR 16 = 00000000 # 271 GPR 17 = 00000000 # 271 GPR 18 = 00000000 # 271 GPR 19 = 00000000 # 271 GPR 20 = 00000000 # 271 GPR 21 = 00000000 # 271 GPR 22 = 00000000 # 271 GPR 23 = 00000000 # 271 GPR 24 = 00000000 # 271 GPR 25 = 00000000 # 271 GPR 26 = 00000000 # 271 GPR 27 = 00000000 # 271 GPR 28 = 00000000 # 271 GPR 29 = 00000000 # 271 GPR 30 = 00000000 # 271 GPR 31 = 00000000 # 280 (mips_tb)clk = 0 # 290 (Write GPR)PC00000000000000000000000000111000: WriteAddress01101 <= Data00000000000000000000000000000100 # 290 (PC)NextPcAddr00000000000000000000000000111000 # 290 (MUX RegWriteData)control = 00, din0 = 00000000000000000000000000000100, din1 = 00000000000000000000000000000000, din2 = 00000000000000000000000001000000, out = 00000000000000000000000000000100 # 290 (MUX DataTo DM/ALU)control = 0, din0 = 00000000000000000000000000000100, din1 = 00000000000000000000000000000000, out = 00000000000000000000000000000100 # 290 (MUX DataTo DM/ALU)control = 0, din0 = 00000000000000000000000000000100, din1 = 00000000000000000110100000100001, out = 00000000000000000000000000000100 # 290 (ALU)(add)A = 00000000000000000000000000000100, B = 00000000000000000000000000000010, Result = 00000000000000000000000000000110 # 290 (IM)Current Code:000000 01101 01100 01101 00000 100001 ; TheAddrOfCurCode = 00000000000000000000000000111100 # 290 (NPC)CurPCAddr:00000000000000000000000000111100 NextPcAddr:00000000000000000000000001000000 # 290 (MUX DataTo DM/ALU)control = 0, din0 = 00000000000000000000000000000001, din1 = 00000000000000000000000000000000, out = 00000000000000000000000000000001 # 290 (MUX DataTo DM/ALU)control = 0, din0 = 00000000000000000000000000000001, din1 = 00000000000000000110100000100001, out = 00000000000000000000000000000001 # 290 (ALU)(add)A = 00000000000000000000000000000100, B = 00000000000000000000000000000100, Result = 00000000000000000000000000001000 # 290 (MUX RegWriteData)control = 00, din0 = 00000000000000000000000000000110, din1 = 00000000000000000000000000000000, din2 = 00000000000000000000000001000000, out = 00000000000000000000000000000110 # 290 (MUX RegWriteAddr)control = 01, din0 = 01100, din1 = 01101, out = 01101 # 290 (NPC)CurPCAddr:00000000000000000000000000111100 NextPcAddr:00000000000000000000000001000000 # 290 (Control) ADDU # 290 (CTRL)RegDst=01 ALUSrc=0 MemToReg=00 RegWrite=1 MemWrite=0 PCSrc=0 ExtOp=00 ALUctr=010 j_ctr=0 jr_ctr=0 DMSrc=0 # 290 (Control) ADDU # 290 (CTRL)RegDst=01 ALUSrc=0 MemToReg=00 RegWrite=1 MemWrite=0 PCSrc=0 ExtOp=00 ALUctr=010 j_ctr=0 jr_ctr=0 DMSrc=0 # 290 (ALU)(add)A = 00000000000000000000000000000100, B = 00000000000000000000000000000001, Result = 00000000000000000000000000000101 # 290 (MUX RegWriteData)control = 00, din0 = 00000000000000000000000000001000, din1 = 00000000000000000000000000000000, din2 = 00000000000000000000000001000000, out = 00000000000000000000000000001000 # 290 (Control) ADDU # 290 (CTRL)RegDst=01 ALUSrc=0 MemToReg=00 RegWrite=1 MemWrite=0 PCSrc=0 ExtOp=00 ALUctr=010 j_ctr=0 jr_ctr=0 DMSrc=0 # 290 (MUX RegWriteData)control = 00, din0 = 00000000000000000000000000000101, din1 = 00000000000000000000000000000000, din2 = 00000000000000000000000001000000, out = 00000000000000000000000000000101 # 290 (mips_tb)clk = 1 # 291 (Show GPR) # 291 GPR 0 = 00000000 # 291 GPR 1 = 00000000 # 291 GPR 2 = 00000000 # 291 GPR 3 = 00000000 # 291 GPR 4 = 00000000 # 291 GPR 5 = 00000000 # 291 GPR 6 = 00000000 # 291 GPR 7 = 00000000 # 291 GPR 8 = 00000004 # 291 GPR 9 = 00000000 # 291 GPR 10 = 00ff0000 # 291 GPR 11 = 00ff5555 # 291 GPR 12 = 00000001 # 291 GPR 13 = 00000004 # 291 GPR 14 = 00000000 # 291 GPR 15 = 00000000 # 291 GPR 16 = 00000000 # 291 GPR 17 = 00000000 # 291 GPR 18 = 00000000 # 291 GPR 19 = 00000000 # 291 GPR 20 = 00000000 # 291 GPR 21 = 00000000 # 291 GPR 22 = 00000000 # 291 GPR 23 = 00000000 # 291 GPR 24 = 00000000 # 291 GPR 25 = 00000000 # 291 GPR 26 = 00000000 # 291 GPR 27 = 00000000 # 291 GPR 28 = 00000000 # 291 GPR 29 = 00000000 # 291 GPR 30 = 00000000 # 291 GPR 31 = 00000000 # 300 (mips_tb)clk = 0 # 310 (Write GPR)PC00000000000000000000000000111100: WriteAddress01101 <= Data00000000000000000000000000000101 # 310 (PC)NextPcAddr00000000000000000000000000111100 # 310 (MUX RegWriteData)control = 00, din0 = 00000000000000000000000000000101, din1 = 00000000000000000000000000000000, din2 = 00000000000000000000000001000100, out = 00000000000000000000000000000101 # 310 (ALU)(add)A = 00000000000000000000000000000101, B = 00000000000000000000000000000001, Result = 00000000000000000000000000000110 # 310 (IM)Current Code:000000 01101 01100 01110 00000 100001 ; TheAddrOfCurCode = 00000000000000000000000001000000 # 310 (NPC)CurPCAddr:00000000000000000000000001000000 NextPcAddr:00000000000000000000000001000100 # 310 (MUX RegWriteData)control = 00, din0 = 00000000000000000000000000000110, din1 = 00000000000000000000000000000000, din2 = 00000000000000000000000001000100, out = 00000000000000000000000000000110 # 310 (MUX RegWriteAddr)control = 01, din0 = 01100, din1 = 01110, out = 01110 # 310 (EXT)EXTOp = 00; EXTin = 0111000000100001 EXTout = 00000000000000000111000000100001 # 310 (NPC)CurPCAddr:00000000000000000000000001000000 NextPcAddr:00000000000000000000000001000100 # 310 (MUX DataTo DM/ALU)control = 0, din0 = 00000000000000000000000000000001, din1 = 00000000000000000111000000100001, out = 00000000000000000000000000000001 # 310 (mips_tb)clk = 1 # 311 (Show GPR) # 311 GPR 0 = 00000000 # 311 GPR 1 = 00000000 # 311 GPR 2 = 00000000 # 311 GPR 3 = 00000000 # 311 GPR 4 = 00000000 # 311 GPR 5 = 00000000 # 311 GPR 6 = 00000000 # 311 GPR 7 = 00000000 # 311 GPR 8 = 00000004 # 311 GPR 9 = 00000000 # 311 GPR 10 = 00ff0000 # 311 GPR 11 = 00ff5555 # 311 GPR 12 = 00000001 # 311 GPR 13 = 00000005 # 311 GPR 14 = 00000000 # 311 GPR 15 = 00000000 # 311 GPR 16 = 00000000 # 311 GPR 17 = 00000000 # 311 GPR 18 = 00000000 # 311 GPR 19 = 00000000 # 311 GPR 20 = 00000000 # 311 GPR 21 = 00000000 # 311 GPR 22 = 00000000 # 311 GPR 23 = 00000000 # 311 GPR 24 = 00000000 # 311 GPR 25 = 00000000 # 311 GPR 26 = 00000000 # 311 GPR 27 = 00000000 # 311 GPR 28 = 00000000 # 311 GPR 29 = 00000000 # 311 GPR 30 = 00000000 # 311 GPR 31 = 00000000 # 320 (mips_tb)clk = 0 # 330 (Write GPR)PC00000000000000000000000001000000: WriteAddress01110 <= Data00000000000000000000000000000110 # 330 (PC)NextPcAddr00000000000000000000000001000000 # 330 (MUX RegWriteData)control = 00, din0 = 00000000000000000000000000000110, din1 = 00000000000000000000000000000000, din2 = 00000000000000000000000001001000, out = 00000000000000000000000000000110 # 330 (IM)Current Code:000000 01110 01100 01111 00000 100001 ; TheAddrOfCurCode = 00000000000000000000000001000100 # 330 (NPC)CurPCAddr:00000000000000000000000001000100 NextPcAddr:00000000000000000000000001001000 # 330 (MUX RegWriteAddr)control = 01, din0 = 01100, din1 = 01111, out = 01111 # 330 (EXT)EXTOp = 00; EXTin = 0111100000100001 EXTout = 00000000000000000111100000100001 # 330 (ALU)(add)A = 00000000000000000000000000000110, B = 00000000000000000000000000000001, Result = 00000000000000000000000000000111 # 330 (NPC)CurPCAddr:00000000000000000000000001000100 NextPcAddr:00000000000000000000000001001000 # 330 (MUX DataTo DM/ALU)control = 0, din0 = 00000000000000000000000000000001, din1 = 00000000000000000111100000100001, out = 00000000000000000000000000000001 # 330 (MUX RegWriteData)control = 00, din0 = 00000000000000000000000000000111, din1 = 00000000000000000000000000000000, din2 = 00000000000000000000000001001000, out = 00000000000000000000000000000111 # 330 (mips_tb)clk = 1 # 331 (Show GPR) # 331 GPR 0 = 00000000 # 331 GPR 1 = 00000000 # 331 GPR 2 = 00000000 # 331 GPR 3 = 00000000 # 331 GPR 4 = 00000000 # 331 GPR 5 = 00000000 # 331 GPR 6 = 00000000 # 331 GPR 7 = 00000000 # 331 GPR 8 = 00000004 # 331 GPR 9 = 00000000 # 331 GPR 10 = 00ff0000 # 331 GPR 11 = 00ff5555 # 331 GPR 12 = 00000001 # 331 GPR 13 = 00000005 # 331 GPR 14 = 00000006 # 331 GPR 15 = 00000000 # 331 GPR 16 = 00000000 # 331 GPR 17 = 00000000 # 331 GPR 18 = 00000000 # 331 GPR 19 = 00000000 # 331 GPR 20 = 00000000 # 331 GPR 21 = 00000000 # 331 GPR 22 = 00000000 # 331 GPR 23 = 00000000 # 331 GPR 24 = 00000000 # 331 GPR 25 = 00000000 # 331 GPR 26 = 00000000 # 331 GPR 27 = 00000000 # 331 GPR 28 = 00000000 # 331 GPR 29 = 00000000 # 331 GPR 30 = 00000000 # 331 GPR 31 = 00000000 # 340 (mips_tb)clk = 0 # 350 (Write GPR)PC00000000000000000000000001000100: WriteAddress01111 <= Data00000000000000000000000000000111 # 350 (PC)NextPcAddr00000000000000000000000001000100 # 350 (MUX RegWriteData)control = 00, din0 = 00000000000000000000000000000111, din1 = 00000000000000000000000000000000, din2 = 00000000000000000000000001001100, out = 00000000000000000000000000000111 # 350 (IM)Current Code:000000 01001 01100 01001 00000 100001 ; TheAddrOfCurCode = 00000000000000000000000001001000 # 350 (NPC)CurPCAddr:00000000000000000000000001001000 NextPcAddr:00000000000000000000000001001100 # 350 (MUX RegWriteAddr)control = 01, din0 = 01100, din1 = 01001, out = 01001 # 350 (EXT)EXTOp = 00; EXTin = 0100100000100001 EXTout = 00000000000000000100100000100001 # 350 (ALU)(add)A = 00000000000000000000000000000000, B = 00000000000000000000000000000001, Result = 00000000000000000000000000000001 # 350 (NPC)CurPCAddr:00000000000000000000000001001000 NextPcAddr:00000000000000000000000001001100 # 350 (MUX DataTo DM/ALU)control = 0, din0 = 00000000000000000000000000000001, din1 = 00000000000000000100100000100001, out = 00000000000000000000000000000001 # 350 (MUX RegWriteData)control = 00, din0 = 00000000000000000000000000000001, din1 = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, din2 = 00000000000000000000000001001100, out = 00000000000000000000000000000001 # 350 (mips_tb)clk = 1 # 351 (Show GPR) # 351 GPR 0 = 00000000 # 351 GPR 1 = 00000000 # 351 GPR 2 = 00000000 # 351 GPR 3 = 00000000 # 351 GPR 4 = 00000000 # 351 GPR 5 = 00000000 # 351 GPR 6 = 00000000 # 351 GPR 7 = 00000000 # 351 GPR 8 = 00000004 # 351 GPR 9 = 00000000 # 351 GPR 10 = 00ff0000 # 351 GPR 11 = 00ff5555 # 351 GPR 12 = 00000001 # 351 GPR 13 = 00000005 # 351 GPR 14 = 00000006 # 351 GPR 15 = 00000007 # 351 GPR 16 = 00000000 # 351 GPR 17 = 00000000 # 351 GPR 18 = 00000000 # 351 GPR 19 = 00000000 # 351 GPR 20 = 00000000 # 351 GPR 21 = 00000000 # 351 GPR 22 = 00000000 # 351 GPR 23 = 00000000 # 351 GPR 24 = 00000000 # 351 GPR 25 = 00000000 # 351 GPR 26 = 00000000 # 351 GPR 27 = 00000000 # 351 GPR 28 = 00000000 # 351 GPR 29 = 00000000 # 351 GPR 30 = 00000000 # 351 GPR 31 = 00000000 # 360 (mips_tb)clk = 0 # 370 (Write GPR)PC00000000000000000000000001001000: WriteAddress01001 <= Data00000000000000000000000000000001 # 370 (PC)NextPcAddr00000000000000000000000001001000 # 370 (MUX RegWriteData)control = 00, din0 = 00000000000000000000000000000001, din1 = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, din2 = 00000000000000000000000001010000, out = 00000000000000000000000000000001 # 370 (ALU)(add)A = 00000000000000000000000000000001, B = 00000000000000000000000000000001, Result = 00000000000000000000000000000010 # 370 (IM)Current Code:000100 01000 01001 00000 00000 000001 ; TheAddrOfCurCode = 00000000000000000000000001001100 # 370 (NPC)CurPCAddr:00000000000000000000000001001100 NextPcAddr:00000000000000000000000001010000 # 370 (MUX RegWriteData)control = 00, din0 = 00000000000000000000000000000010, din1 = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, din2 = 00000000000000000000000001010000, out = 00000000000000000000000000000010 # 370 (MUX RegWriteAddr)control = 01, din0 = 01001, din1 = 00000, out = 00000 # 370 (EXT)EXTOp = 00; EXTin = 0000000000000001 EXTout = 00000000000000000000000000000001 # 370 (ALU)(add)A = 00000000000000000000000000000100, B = 00000000000000000000000000000001, Result = 00000000000000000000000000000101 # 370 (NPC)CurPCAddr:00000000000000000000000001001100 NextPcAddr:00000000000000000000000001010000 # 370 (Control) BEQ # 370 (CTRL)RegDst=00 ALUSrc=0 MemToReg=00 RegWrite=0 MemWrite=0 PCSrc=1 ExtOp=01 ALUctr=111 j_ctr=0 jr_ctr=0 DMSrc=0 # 370 (MUX DataTo DM/ALU)control = 0, din0 = 00000000000000000000000000000001, din1 = 00000000000000000000000000000001, out = 00000000000000000000000000000001 # 370 (MUX RegWriteData)control = 00, din0 = 00000000000000000000000000000101, din1 = 00000000000000000000000000000000, din2 = 00000000000000000000000001010000, out = 00000000000000000000000000000101 # 370 (MUX RegWriteAddr)control = 00, din0 = 01001, din1 = 00000, out = 01001 # 370 (EXT)EXTOp = 01; EXTin = 0000000000000001 EXTout = 00000000000000000000000000000001 # 370 (ALU)(DEFAULT) # 370 (NPC)CurPCAddr:00000000000000000000000001001100 NextPcAddr:00000000000000000000000001010000 # 370 (Control) BEQ # 370 (CTRL)RegDst=00 ALUSrc=0 MemToReg=00 RegWrite=0 MemWrite=0 PCSrc=0 ExtOp=01 ALUctr=111 j_ctr=0 jr_ctr=0 DMSrc=0 # 370 (NPC)CurPCAddr:00000000000000000000000001001100 NextPcAddr:00000000000000000000000001010000 # 370 (MUX RegWriteData)control = 00, din0 = 00000000000000000000000000000000, din1 = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, din2 = 00000000000000000000000001010000, out = 00000000000000000000000000000000 # 370 (NPC)CurPCAddr:00000000000000000000000001001100 NextPcAddr:00000000000000000000000001010000 # 370 (ALU)(DEFAULT) # 370 (mips_tb)clk = 1 # 371 (Show GPR) # 371 GPR 0 = 00000000 # 371 GPR 1 = 00000000 # 371 GPR 2 = 00000000 # 371 GPR 3 = 00000000 # 371 GPR 4 = 00000000 # 371 GPR 5 = 00000000 # 371 GPR 6 = 00000000 # 371 GPR 7 = 00000000 # 371 GPR 8 = 00000004 # 371 GPR 9 = 00000001 # 371 GPR 10 = 00ff0000 # 371 GPR 11 = 00ff5555 # 371 GPR 12 = 00000001 # 371 GPR 13 = 00000005 # 371 GPR 14 = 00000006 # 371 GPR 15 = 00000007 # 371 GPR 16 = 00000000 # 371 GPR 17 = 00000000 # 371 GPR 18 = 00000000 # 371 GPR 19 = 00000000 # 371 GPR 20 = 00000000 # 371 GPR 21 = 00000000 # 371 GPR 22 = 00000000 # 371 GPR 23 = 00000000 # 371 GPR 24 = 00000000 # 371 GPR 25 = 00000000 # 371 GPR 26 = 00000000 # 371 GPR 27 = 00000000 # 371 GPR 28 = 00000000 # 371 GPR 29 = 00000000 # 371 GPR 30 = 00000000 # 371 GPR 31 = 00000000 # 380 (mips_tb)clk = 0 # 390 (GPR)Write:false # 390 (PC)NextPcAddr00000000000000000000000001001100 # 390 (MUX RegWriteData)control = 00, din0 = 00000000000000000000000000000000, din1 = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, din2 = 00000000000000000000000001010100, out = 00000000000000000000000000000000 # 390 (IM)Current Code:000010 00000 10000 00000 00000 001111 ; TheAddrOfCurCode = 00000000000000000000000001010000 # 390 (NPC)CurPCAddr:00000000000000000000000001010000 NextPcAddr:00000000000000000000000001010100 # 390 (MUX DataTo DM/ALU)control = 0, din0 = 00000000000000000000000000000000, din1 = 00000000000000000000000000000000, out = 00000000000000000000000000000000 # 390 (MUX DataTo DM/ALU)control = 0, din0 = 00000000000000000000000000000000, din1 = 00000000000000000000000000000001, out = 00000000000000000000000000000000 # 390 (MUX RegWriteAddr)control = 00, din0 = 10000, din1 = 00000, out = 10000 # 390 (Control) J # 390 (CTRL)RegDst=00 ALUSrc=0 MemToReg=00 RegWrite=0 MemWrite=0 PCSrc=0 ExtOp=00 ALUctr=111 j_ctr=1 jr_ctr=0 DMSrc=0 # 390 (EXT)EXTOp = 01; EXTin = 0000000000001111 EXTout = 00000000000000000000000000000001 # 390 (ALU)(DEFAULT) # 390 (NPC)CurPCAddr:00000000000000000000000001010000 NextPcAddr:00000000000000000000000001010100 # 390 (ALU)(DEFAULT) # 390 (EXT)EXTOp = 00; EXTin = 0000000000001111 EXTout = 00000000000000000000000000001111 # 390 (MUX DataTo DM/ALU)control = 0, din0 = 00000000000000000000000000000000, din1 = 00000000000000000000000000001111, out = 00000000000000000000000000000000 # 390 (NPC)CurPCAddr:00000000000000000000000001010000 NextPcAddr:00000000000000000000000001010100 # 390 (Control) J # 390 (CTRL)RegDst=00 ALUSrc=0 MemToReg=00 RegWrite=0 MemWrite=0 PCSrc=0 ExtOp=00 ALUctr=111 j_ctr=1 jr_ctr=0 DMSrc=0 # 390 (NPC)CurPCAddr:00000000000000000000000001010000 NextPcAddr:00000000010000000000000000111100 # 390 (mips_tb)clk = 1 # 400 (mips_tb)clk = 0 # 410 (GPR)Write:false # 410 (PC)NextPcAddr00000000000000000000000001010000 # 410 (MUX RegWriteData)control = 00, din0 = 00000000000000000000000000000000, din1 = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, din2 = 00000000010000000000000001000000, out = 00000000000000000000000000000000 # 410 (IM)Current Code:000000 01101 01100 01101 00000 100001 ; TheAddrOfCurCode = 00000000010000000000000000111100 # 410 (NPC)CurPCAddr:00000000010000000000000000111100 NextPcAddr:00000000010000000000000000111100 # 410 (MUX DataTo DM/ALU)control = 0, din0 = 00000000000000000000000000000001, din1 = 00000000000000000000000000000000, out = 00000000000000000000000000000001 # 410 (MUX DataTo DM/ALU)control = 0, din0 = 00000000000000000000000000000001, din1 = 00000000000000000000000000001111, out = 00000000000000000000000000000001 # 410 (MUX RegWriteAddr)control = 00, din0 = 01100, din1 = 01101, out = 01100 # 410 (Control) ADDU # 410 (CTRL)RegDst=01 ALUSrc=0 MemToReg=00 RegWrite=1 MemWrite=0 PCSrc=0 ExtOp=00 ALUctr=010 j_ctr=0 jr_ctr=0 DMSrc=0 # 410 (EXT)EXTOp = 00; EXTin = 0110100000100001 EXTout = 00000000000000000110100000100001 # 410 (ALU)(DEFAULT) # 410 (NPC)CurPCAddr:00000000010000000000000000111100 NextPcAddr:00000000010000000000000000111100 # 410 (Control) ADDU # 410 (CTRL)RegDst=01 ALUSrc=0 MemToReg=00 RegWrite=1 MemWrite=0 PCSrc=0 ExtOp=00 ALUctr=010 j_ctr=0 jr_ctr=0 DMSrc=0 # 410 (MUX RegWriteAddr)control = 01, din0 = 01100, din1 = 01101, out = 01101 # 410 (ALU)(add)A = 00000000000000000000000000000101, B = 00000000000000000000000000000001, Result = 00000000000000000000000000000110 # 410 (MUX DataTo DM/ALU)control = 0, din0 = 00000000000000000000000000000001, din1 = 00000000000000000110100000100001, out = 00000000000000000000000000000001 # 410 (NPC)CurPCAddr:00000000010000000000000000111100 NextPcAddr:00000000010000000000000001000000 # 410 (MUX RegWriteData)control = 00, din0 = 00000000000000000000000000000110, din1 = 00000000000000000000000000000000, din2 = 00000000010000000000000001000000, out = 00000000000000000000000000000110 # 410 (MUX RegWriteData)control = 00, din0 = 00000000000000000000000000000000, din1 = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, din2 = 00000000010000000000000001000000, out = 00000000000000000000000000000000 # 410 (ALU)(add)A = 00000000000000000000000000000101, B = 00000000000000000000000000000001, Result = 00000000000000000000000000000110 # 410 (NPC)CurPCAddr:00000000010000000000000000111100 NextPcAddr:00000000010000000000000001000000 # 410 (MUX RegWriteData)control = 00, din0 = 00000000000000000000000000000110, din1 = 00000000000000000000000000000000, din2 = 00000000010000000000000001000000, out = 00000000000000000000000000000110 # 410 (mips_tb)clk = 1 # 420 (mips_tb)clk = 0 # 430 (Write GPR)PC00000000010000000000000000111100: WriteAddress01101 <= Data00000000000000000000000000000110 # 430 (PC)NextPcAddr00000000010000000000000000111100 # 430 (MUX RegWriteData)control = 00, din0 = 00000000000000000000000000000110, din1 = 00000000000000000000000000000000, din2 = 00000000010000000000000001000100, out = 00000000000000000000000000000110 # 430 (ALU)(add)A = 00000000000000000000000000000110, B = 00000000000000000000000000000001, Result = 00000000000000000000000000000111 # 430 (IM)Current Code:000000 01101 01100 01110 00000 100001 ; TheAddrOfCurCode = 00000000010000000000000001000000 # 430 (NPC)CurPCAddr:00000000010000000000000001000000 NextPcAddr:00000000010000000000000001000100 # 430 (MUX RegWriteData)control = 00, din0 = 00000000000000000000000000000111, din1 = 00000000000000000000000000000000, din2 = 00000000010000000000000001000100, out = 00000000000000000000000000000111 # 430 (MUX RegWriteAddr)control = 01, din0 = 01100, din1 = 01110, out = 01110 # 430 (EXT)EXTOp = 00; EXTin = 0111000000100001 EXTout = 00000000000000000111000000100001 # 430 (NPC)CurPCAddr:00000000010000000000000001000000 NextPcAddr:00000000010000000000000001000100 # 430 (MUX DataTo DM/ALU)control = 0, din0 = 00000000000000000000000000000001, din1 = 00000000000000000111000000100001, out = 00000000000000000000000000000001 # 430 (mips_tb)clk = 1 # 431 (Show GPR) # 431 GPR 0 = 00000000 # 431 GPR 1 = 00000000 # 431 GPR 2 = 00000000 # 431 GPR 3 = 00000000 # 431 GPR 4 = 00000000 # 431 GPR 5 = 00000000 # 431 GPR 6 = 00000000 # 431 GPR 7 = 00000000 # 431 GPR 8 = 00000004 # 431 GPR 9 = 00000001 # 431 GPR 10 = 00ff0000 # 431 GPR 11 = 00ff5555 # 431 GPR 12 = 00000001 # 431 GPR 13 = 00000006 # 431 GPR 14 = 00000006 # 431 GPR 15 = 00000007 # 431 GPR 16 = 00000000 # 431 GPR 17 = 00000000 # 431 GPR 18 = 00000000 # 431 GPR 19 = 00000000 # 431 GPR 20 = 00000000 # 431 GPR 21 = 00000000 # 431 GPR 22 = 00000000 # 431 GPR 23 = 00000000 # 431 GPR 24 = 00000000 # 431 GPR 25 = 00000000 # 431 GPR 26 = 00000000 # 431 GPR 27 = 00000000 # 431 GPR 28 = 00000000 # 431 GPR 29 = 00000000 # 431 GPR 30 = 00000000 # 431 GPR 31 = 00000000 # 440 (mips_tb)clk = 0 # 450 (Write GPR)PC00000000010000000000000001000000: WriteAddress01110 <= Data00000000000000000000000000000111 # 450 (PC)NextPcAddr00000000010000000000000001000000 # 450 (MUX RegWriteData)control = 00, din0 = 00000000000000000000000000000111, din1 = 00000000000000000000000000000000, din2 = 00000000010000000000000001001000, out = 00000000000000000000000000000111 # 450 (IM)Current Code:000000 01110 01100 01111 00000 100001 ; TheAddrOfCurCode = 00000000010000000000000001000100 # 450 (NPC)CurPCAddr:00000000010000000000000001000100 NextPcAddr:00000000010000000000000001001000 # 450 (MUX RegWriteAddr)control = 01, din0 = 01100, din1 = 01111, out = 01111 # 450 (EXT)EXTOp = 00; EXTin = 0111100000100001 EXTout = 00000000000000000111100000100001 # 450 (ALU)(add)A = 00000000000000000000000000000111, B = 00000000000000000000000000000001, Result = 00000000000000000000000000001000 # 450 (NPC)CurPCAddr:00000000010000000000000001000100 NextPcAddr:00000000010000000000000001001000 # 450 (MUX DataTo DM/ALU)control = 0, din0 = 00000000000000000000000000000001, din1 = 00000000000000000111100000100001, out = 00000000000000000000000000000001 # 450 (MUX RegWriteData)control = 00, din0 = 00000000000000000000000000001000, din1 = 00000000000000000000000000000000, din2 = 00000000010000000000000001001000, out = 00000000000000000000000000001000 # 450 (mips_tb)clk = 1 # 451 (Show GPR) # 451 GPR 0 = 00000000 # 451 GPR 1 = 00000000 # 451 GPR 2 = 00000000 # 451 GPR 3 = 00000000 # 451 GPR 4 = 00000000 # 451 GPR 5 = 00000000 # 451 GPR 6 = 00000000 # 451 GPR 7 = 00000000 # 451 GPR 8 = 00000004 # 451 GPR 9 = 00000001 # 451 GPR 10 = 00ff0000 # 451 GPR 11 = 00ff5555 # 451 GPR 12 = 00000001 # 451 GPR 13 = 00000006 # 451 GPR 14 = 00000007 # 451 GPR 15 = 00000007 # 451 GPR 16 = 00000000 # 451 GPR 17 = 00000000 # 451 GPR 18 = 00000000 # 451 GPR 19 = 00000000 # 451 GPR 20 = 00000000 # 451 GPR 21 = 00000000 # 451 GPR 22 = 00000000 # 451 GPR 23 = 00000000 # 451 GPR 24 = 00000000 # 451 GPR 25 = 00000000 # 451 GPR 26 = 00000000 # 451 GPR 27 = 00000000 # 451 GPR 28 = 00000000 # 451 GPR 29 = 00000000 # 451 GPR 30 = 00000000 # 451 GPR 31 = 00000000 # 460 (mips_tb)clk = 0 # 470 (Write GPR)PC00000000010000000000000001000100: WriteAddress01111 <= Data00000000000000000000000000001000 # 470 (PC)NextPcAddr00000000010000000000000001000100 # 470 (MUX RegWriteData)control = 00, din0 = 00000000000000000000000000001000, din1 = 00000000000000000000000000000000, din2 = 00000000010000000000000001001100, out = 00000000000000000000000000001000 # 470 (IM)Current Code:000000 01001 01100 01001 00000 100001 ; TheAddrOfCurCode = 00000000010000000000000001001000 # 470 (NPC)CurPCAddr:00000000010000000000000001001000 NextPcAddr:00000000010000000000000001001100 # 470 (MUX RegWriteAddr)control = 01, din0 = 01100, din1 = 01001, out = 01001 # 470 (EXT)EXTOp = 00; EXTin = 0100100000100001 EXTout = 00000000000000000100100000100001 # 470 (ALU)(add)A = 00000000000000000000000000000001, B = 00000000000000000000000000000001, Result = 00000000000000000000000000000010 # 470 (NPC)CurPCAddr:00000000010000000000000001001000 NextPcAddr:00000000010000000000000001001100 # 470 (Control) ADDU # 470 (CTRL)RegDst=01 ALUSrc=0 MemToReg=00 RegWrite=1 MemWrite=0 PCSrc=0 ExtOp=00 ALUctr=010 j_ctr=0 jr_ctr=0 DMSrc=0 # 470 (MUX DataTo DM/ALU)control = 0, din0 = 00000000000000000000000000000001, din1 = 00000000000000000100100000100001, out = 00000000000000000000000000000001 # 470 (MUX RegWriteData)control = 00, din0 = 00000000000000000000000000000010, din1 = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, din2 = 00000000010000000000000001001100, out = 00000000000000000000000000000010 # 470 (mips_tb)clk = 1 # 471 (Show GPR) # 471 GPR 0 = 00000000 # 471 GPR 1 = 00000000 # 471 GPR 2 = 00000000 # 471 GPR 3 = 00000000 # 471 GPR 4 = 00000000 # 471 GPR 5 = 00000000 # 471 GPR 6 = 00000000 # 471 GPR 7 = 00000000 # 471 GPR 8 = 00000004 # 471 GPR 9 = 00000001 # 471 GPR 10 = 00ff0000 # 471 GPR 11 = 00ff5555 # 471 GPR 12 = 00000001 # 471 GPR 13 = 00000006 # 471 GPR 14 = 00000007 # 471 GPR 15 = 00000008 # 471 GPR 16 = 00000000 # 471 GPR 17 = 00000000 # 471 GPR 18 = 00000000 # 471 GPR 19 = 00000000 # 471 GPR 20 = 00000000 # 471 GPR 21 = 00000000 # 471 GPR 22 = 00000000 # 471 GPR 23 = 00000000 # 471 GPR 24 = 00000000 # 471 GPR 25 = 00000000 # 471 GPR 26 = 00000000 # 471 GPR 27 = 00000000 # 471 GPR 28 = 00000000 # 471 GPR 29 = 00000000 # 471 GPR 30 = 00000000 # 471 GPR 31 = 00000000 # 480 (mips_tb)clk = 0 # 490 (Write GPR)PC00000000010000000000000001001000: WriteAddress01001 <= Data00000000000000000000000000000010 # 490 (PC)NextPcAddr00000000010000000000000001001000 # 490 (MUX RegWriteData)control = 00, din0 = 00000000000000000000000000000010, din1 = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, din2 = 00000000010000000000000001010000, out = 00000000000000000000000000000010 # 490 (ALU)(add)A = 00000000000000000000000000000010, B = 00000000000000000000000000000001, Result = 00000000000000000000000000000011 # 490 (IM)Current Code:000100 01000 01001 00000 00000 000001 ; TheAddrOfCurCode = 00000000010000000000000001001100 # 490 (NPC)CurPCAddr:00000000010000000000000001001100 NextPcAddr:00000000010000000000000001010000 # 490 (MUX DataTo DM/ALU)control = 0, din0 = 00000000000000000000000000000010, din1 = 00000000000000000000000000000000, out = 00000000000000000000000000000010 # 490 (MUX DataTo DM/ALU)control = 0, din0 = 00000000000000000000000000000010, din1 = 00000000000000000100100000100001, out = 00000000000000000000000000000010 # 490 (MUX RegWriteData)control = 00, din0 = 00000000000000000000000000000011, din1 = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, din2 = 00000000010000000000000001010000, out = 00000000000000000000000000000011 # 490 (MUX RegWriteAddr)control = 01, din0 = 01001, din1 = 00000, out = 00000 # 490 (EXT)EXTOp = 00; EXTin = 0000000000000001 EXTout = 00000000000000000000000000000001 # 490 (ALU)(add)A = 00000000000000000000000000000100, B = 00000000000000000000000000000001, Result = 00000000000000000000000000000101 # 490 (NPC)CurPCAddr:00000000010000000000000001001100 NextPcAddr:00000000010000000000000001010000 # 490 (Control) BEQ # 490 (CTRL)RegDst=00 ALUSrc=0 MemToReg=00 RegWrite=0 MemWrite=0 PCSrc=0 ExtOp=01 ALUctr=111 j_ctr=0 jr_ctr=0 DMSrc=0 # 490 (MUX DataTo DM/ALU)control = 0, din0 = 00000000000000000000000000000010, din1 = 00000000000000000000000000000001, out = 00000000000000000000000000000010 # 490 (MUX RegWriteData)control = 00, din0 = 00000000000000000000000000000101, din1 = 00000000000000000000000000000000, din2 = 00000000010000000000000001010000, out = 00000000000000000000000000000101 # 490 (MUX RegWriteAddr)control = 00, din0 = 01001, din1 = 00000, out = 01001 # 490 (EXT)EXTOp = 01; EXTin = 0000000000000001 EXTout = 00000000000000000000000000000001 # 490 (ALU)(DEFAULT) # 490 (MUX RegWriteData)control = 00, din0 = 00000000000000000000000000000000, din1 = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, din2 = 00000000010000000000000001010000, out = 00000000000000000000000000000000 # 490 (ALU)(DEFAULT) # 490 (mips_tb)clk = 1 # 491 (Show GPR) # 491 GPR 0 = 00000000 # 491 GPR 1 = 00000000 # 491 GPR 2 = 00000000 # 491 GPR 3 = 00000000 # 491 GPR 4 = 00000000 # 491 GPR 5 = 00000000 # 491 GPR 6 = 00000000 # 491 GPR 7 = 00000000 # 491 GPR 8 = 00000004 # 491 GPR 9 = 00000002 # 491 GPR 10 = 00ff0000 # 491 GPR 11 = 00ff5555 # 491 GPR 12 = 00000001 # 491 GPR 13 = 00000006 # 491 GPR 14 = 00000007 # 491 GPR 15 = 00000008 # 491 GPR 16 = 00000000 # 491 GPR 17 = 00000000 # 491 GPR 18 = 00000000 # 491 GPR 19 = 00000000 # 491 GPR 20 = 00000000 # 491 GPR 21 = 00000000 # 491 GPR 22 = 00000000 # 491 GPR 23 = 00000000 # 491 GPR 24 = 00000000 # 491 GPR 25 = 00000000 # 491 GPR 26 = 00000000 # 491 GPR 27 = 00000000 # 491 GPR 28 = 00000000 # 491 GPR 29 = 00000000 # 491 GPR 30 = 00000000 # 491 GPR 31 = 00000000 # 500 (mips_tb)clk = 0 # 510 (GPR)Write:false # 510 (PC)NextPcAddr00000000010000000000000001001100 # 510 (MUX RegWriteData)control = 00, din0 = 00000000000000000000000000000000, din1 = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, din2 = 00000000010000000000000001010100, out = 00000000000000000000000000000000 # 510 (IM)Current Code:000010 00000 10000 00000 00000 001111 ; TheAddrOfCurCode = 00000000010000000000000001010000 # 510 (NPC)CurPCAddr:00000000010000000000000001010000 NextPcAddr:00000000010000000000000001010100 # 510 (MUX DataTo DM/ALU)control = 0, din0 = 00000000000000000000000000000000, din1 = 00000000000000000000000000000000, out = 00000000000000000000000000000000 # 510 (MUX DataTo DM/ALU)control = 0, din0 = 00000000000000000000000000000000, din1 = 00000000000000000000000000000001, out = 00000000000000000000000000000000 # 510 (MUX RegWriteAddr)control = 00, din0 = 10000, din1 = 00000, out = 10000 # 510 (Control) J # 510 (CTRL)RegDst=00 ALUSrc=0 MemToReg=00 RegWrite=0 MemWrite=0 PCSrc=0 ExtOp=00 ALUctr=111 j_ctr=1 jr_ctr=0 DMSrc=0 # 510 (EXT)EXTOp = 01; EXTin = 0000000000001111 EXTout = 00000000000000000000000000000001 # 510 (ALU)(DEFAULT) # 510 (NPC)CurPCAddr:00000000010000000000000001010000 NextPcAddr:00000000010000000000000001010100 # 510 (ALU)(DEFAULT) # 510 (EXT)EXTOp = 00; EXTin = 0000000000001111 EXTout = 00000000000000000000000000001111 # 510 (MUX DataTo DM/ALU)control = 0, din0 = 00000000000000000000000000000000, din1 = 00000000000000000000000000001111, out = 00000000000000000000000000000000 # 510 (NPC)CurPCAddr:00000000010000000000000001010000 NextPcAddr:00000000010000000000000001010100 # 510 (Control) J # 510 (CTRL)RegDst=00 ALUSrc=0 MemToReg=00 RegWrite=0 MemWrite=0 PCSrc=0 ExtOp=00 ALUctr=111 j_ctr=1 jr_ctr=0 DMSrc=0 # 510 (NPC)CurPCAddr:00000000010000000000000001010000 NextPcAddr:00000000010000000000000000111100 # 510 (mips_tb)clk = 1 # 520 (mips_tb)clk = 0 # 530 (GPR)Write:false # 530 (PC)NextPcAddr00000000010000000000000001010000 # 530 (MUX RegWriteData)control = 00, din0 = 00000000000000000000000000000000, din1 = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, din2 = 00000000010000000000000001000000, out = 00000000000000000000000000000000 # 530 (IM)Current Code:000000 01101 01100 01101 00000 100001 ; TheAddrOfCurCode = 00000000010000000000000000111100 # 530 (NPC)CurPCAddr:00000000010000000000000000111100 NextPcAddr:00000000010000000000000000111100 # 530 (MUX DataTo DM/ALU)control = 0, din0 = 00000000000000000000000000000001, din1 = 00000000000000000000000000000000, out = 00000000000000000000000000000001 # 530 (MUX DataTo DM/ALU)control = 0, din0 = 00000000000000000000000000000001, din1 = 00000000000000000000000000001111, out = 00000000000000000000000000000001 # 530 (MUX RegWriteAddr)control = 00, din0 = 01100, din1 = 01101, out = 01100 # 530 (Control) ADDU # 530 (CTRL)RegDst=01 ALUSrc=0 MemToReg=00 RegWrite=1 MemWrite=0 PCSrc=0 ExtOp=00 ALUctr=010 j_ctr=0 jr_ctr=0 DMSrc=0 # 530 (EXT)EXTOp = 00; EXTin = 0110100000100001 EXTout = 00000000000000000110100000100001 # 530 (ALU)(DEFAULT) # 530 (NPC)CurPCAddr:00000000010000000000000000111100 NextPcAddr:00000000010000000000000000111100 # 530 (Control) ADDU # 530 (CTRL)RegDst=01 ALUSrc=0 MemToReg=00 RegWrite=1 MemWrite=0 PCSrc=0 ExtOp=00 ALUctr=010 j_ctr=0 jr_ctr=0 DMSrc=0 # 530 (MUX RegWriteAddr)control = 01, din0 = 01100, din1 = 01101, out = 01101 # 530 (ALU)(add)A = 00000000000000000000000000000110, B = 00000000000000000000000000000001, Result = 00000000000000000000000000000111 # 530 (MUX DataTo DM/ALU)control = 0, din0 = 00000000000000000000000000000001, din1 = 00000000000000000110100000100001, out = 00000000000000000000000000000001 # 530 (NPC)CurPCAddr:00000000010000000000000000111100 NextPcAddr:00000000010000000000000001000000 # 530 (MUX RegWriteData)control = 00, din0 = 00000000000000000000000000000111, din1 = 00000000000000000000000000000000, din2 = 00000000010000000000000001000000, out = 00000000000000000000000000000111 # 530 (MUX RegWriteData)control = 00, din0 = 00000000000000000000000000000000, din1 = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, din2 = 00000000010000000000000001000000, out = 00000000000000000000000000000000 # 530 (ALU)(add)A = 00000000000000000000000000000110, B = 00000000000000000000000000000001, Result = 00000000000000000000000000000111 # 530 (NPC)CurPCAddr:00000000010000000000000000111100 NextPcAddr:00000000010000000000000001000000 # 530 (MUX RegWriteData)control = 00, din0 = 00000000000000000000000000000111, din1 = 00000000000000000000000000000000, din2 = 00000000010000000000000001000000, out = 00000000000000000000000000000111 # 530 (mips_tb)clk = 1 # 540 (mips_tb)clk = 0 # 550 (Write GPR)PC00000000010000000000000000111100: WriteAddress01101 <= Data00000000000000000000000000000111 # 550 (PC)NextPcAddr00000000010000000000000000111100 # 550 (MUX RegWriteData)control = 00, din0 = 00000000000000000000000000000111, din1 = 00000000000000000000000000000000, din2 = 00000000010000000000000001000100, out = 00000000000000000000000000000111 # 550 (ALU)(add)A = 00000000000000000000000000000111, B = 00000000000000000000000000000001, Result = 00000000000000000000000000001000 # 550 (IM)Current Code:000000 01101 01100 01110 00000 100001 ; TheAddrOfCurCode = 00000000010000000000000001000000 # 550 (NPC)CurPCAddr:00000000010000000000000001000000 NextPcAddr:00000000010000000000000001000100 # 550 (MUX RegWriteData)control = 00, din0 = 00000000000000000000000000001000, din1 = 00000000000000000000000000000000, din2 = 00000000010000000000000001000100, out = 00000000000000000000000000001000 # 550 (MUX RegWriteAddr)control = 01, din0 = 01100, din1 = 01110, out = 01110 # 550 (EXT)EXTOp = 00; EXTin = 0111000000100001 EXTout = 00000000000000000111000000100001 # 550 (NPC)CurPCAddr:00000000010000000000000001000000 NextPcAddr:00000000010000000000000001000100 # 550 (MUX DataTo DM/ALU)control = 0, din0 = 00000000000000000000000000000001, din1 = 00000000000000000111000000100001, out = 00000000000000000000000000000001 # 550 (mips_tb)clk = 1 # 551 (Show GPR) # 551 GPR 0 = 00000000 # 551 GPR 1 = 00000000 # 551 GPR 2 = 00000000 # 551 GPR 3 = 00000000 # 551 GPR 4 = 00000000 # 551 GPR 5 = 00000000 # 551 GPR 6 = 00000000 # 551 GPR 7 = 00000000 # 551 GPR 8 = 00000004 # 551 GPR 9 = 00000002 # 551 GPR 10 = 00ff0000 # 551 GPR 11 = 00ff5555 # 551 GPR 12 = 00000001 # 551 GPR 13 = 00000007 # 551 GPR 14 = 00000007 # 551 GPR 15 = 00000008 # 551 GPR 16 = 00000000 # 551 GPR 17 = 00000000 # 551 GPR 18 = 00000000 # 551 GPR 19 = 00000000 # 551 GPR 20 = 00000000 # 551 GPR 21 = 00000000 # 551 GPR 22 = 00000000 # 551 GPR 23 = 00000000 # 551 GPR 24 = 00000000 # 551 GPR 25 = 00000000 # 551 GPR 26 = 00000000 # 551 GPR 27 = 00000000 # 551 GPR 28 = 00000000 # 551 GPR 29 = 00000000 # 551 GPR 30 = 00000000 # 551 GPR 31 = 00000000 # 560 (mips_tb)clk = 0 # 570 (Write GPR)PC00000000010000000000000001000000: WriteAddress01110 <= Data00000000000000000000000000001000 # 570 (PC)NextPcAddr00000000010000000000000001000000 # 570 (MUX RegWriteData)control = 00, din0 = 00000000000000000000000000001000, din1 = 00000000000000000000000000000000, din2 = 00000000010000000000000001001000, out = 00000000000000000000000000001000 # 570 (IM)Current Code:000000 01110 01100 01111 00000 100001 ; TheAddrOfCurCode = 00000000010000000000000001000100 # 570 (NPC)CurPCAddr:00000000010000000000000001000100 NextPcAddr:00000000010000000000000001001000 # 570 (MUX RegWriteAddr)control = 01, din0 = 01100, din1 = 01111, out = 01111 # 570 (EXT)EXTOp = 00; EXTin = 0111100000100001 EXTout = 00000000000000000111100000100001 # 570 (ALU)(add)A = 00000000000000000000000000001000, B = 00000000000000000000000000000001, Result = 00000000000000000000000000001001 # 570 (NPC)CurPCAddr:00000000010000000000000001000100 NextPcAddr:00000000010000000000000001001000 # 570 (MUX DataTo DM/ALU)control = 0, din0 = 00000000000000000000000000000001, din1 = 00000000000000000111100000100001, out = 00000000000000000000000000000001 # 570 (MUX RegWriteData)control = 00, din0 = 00000000000000000000000000001001, din1 = 00000000000000000000000000000000, din2 = 00000000010000000000000001001000, out = 00000000000000000000000000001001 # 570 (mips_tb)clk = 1 # 571 (Show GPR) # 571 GPR 0 = 00000000 # 571 GPR 1 = 00000000 # 571 GPR 2 = 00000000 # 571 GPR 3 = 00000000 # 571 GPR 4 = 00000000 # 571 GPR 5 = 00000000 # 571 GPR 6 = 00000000 # 571 GPR 7 = 00000000 # 571 GPR 8 = 00000004 # 571 GPR 9 = 00000002 # 571 GPR 10 = 00ff0000 # 571 GPR 11 = 00ff5555 # 571 GPR 12 = 00000001 # 571 GPR 13 = 00000007 # 571 GPR 14 = 00000008 # 571 GPR 15 = 00000008 # 571 GPR 16 = 00000000 # 571 GPR 17 = 00000000 # 571 GPR 18 = 00000000 # 571 GPR 19 = 00000000 # 571 GPR 20 = 00000000 # 571 GPR 21 = 00000000 # 571 GPR 22 = 00000000 # 571 GPR 23 = 00000000 # 571 GPR 24 = 00000000 # 571 GPR 25 = 00000000 # 571 GPR 26 = 00000000 # 571 GPR 27 = 00000000 # 571 GPR 28 = 00000000 # 571 GPR 29 = 00000000 # 571 GPR 30 = 00000000 # 571 GPR 31 = 00000000 # 580 (mips_tb)clk = 0 # 590 (Write GPR)PC00000000010000000000000001000100: WriteAddress01111 <= Data00000000000000000000000000001001 # 590 (PC)NextPcAddr00000000010000000000000001000100 # 590 (MUX RegWriteData)control = 00, din0 = 00000000000000000000000000001001, din1 = 00000000000000000000000000000000, din2 = 00000000010000000000000001001100, out = 00000000000000000000000000001001 # 590 (IM)Current Code:000000 01001 01100 01001 00000 100001 ; TheAddrOfCurCode = 00000000010000000000000001001000 # 590 (NPC)CurPCAddr:00000000010000000000000001001000 NextPcAddr:00000000010000000000000001001100 # 590 (MUX RegWriteAddr)control = 01, din0 = 01100, din1 = 01001, out = 01001 # 590 (EXT)EXTOp = 00; EXTin = 0100100000100001 EXTout = 00000000000000000100100000100001 # 590 (ALU)(add)A = 00000000000000000000000000000010, B = 00000000000000000000000000000001, Result = 00000000000000000000000000000011 # 590 (NPC)CurPCAddr:00000000010000000000000001001000 NextPcAddr:00000000010000000000000001001100 # 590 (MUX DataTo DM/ALU)control = 0, din0 = 00000000000000000000000000000001, din1 = 00000000000000000100100000100001, out = 00000000000000000000000000000001 # 590 (MUX RegWriteData)control = 00, din0 = 00000000000000000000000000000011, din1 = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, din2 = 00000000010000000000000001001100, out = 00000000000000000000000000000011 # 590 (mips_tb)clk = 1 # 591 (Show GPR) # 591 GPR 0 = 00000000 # 591 GPR 1 = 00000000 # 591 GPR 2 = 00000000 # 591 GPR 3 = 00000000 # 591 GPR 4 = 00000000 # 591 GPR 5 = 00000000 # 591 GPR 6 = 00000000 # 591 GPR 7 = 00000000 # 591 GPR 8 = 00000004 # 591 GPR 9 = 00000002 # 591 GPR 10 = 00ff0000 # 591 GPR 11 = 00ff5555 # 591 GPR 12 = 00000001 # 591 GPR 13 = 00000007 # 591 GPR 14 = 00000008 # 591 GPR 15 = 00000009 # 591 GPR 16 = 00000000 # 591 GPR 17 = 00000000 # 591 GPR 18 = 00000000 # 591 GPR 19 = 00000000 # 591 GPR 20 = 00000000 # 591 GPR 21 = 00000000 # 591 GPR 22 = 00000000 # 591 GPR 23 = 00000000 # 591 GPR 24 = 00000000 # 591 GPR 25 = 00000000 # 591 GPR 26 = 00000000 # 591 GPR 27 = 00000000 # 591 GPR 28 = 00000000 # 591 GPR 29 = 00000000 # 591 GPR 30 = 00000000 # 591 GPR 31 = 00000000 # 600 (mips_tb)clk = 0 # 610 (Write GPR)PC00000000010000000000000001001000: WriteAddress01001 <= Data00000000000000000000000000000011 # 610 (PC)NextPcAddr00000000010000000000000001001000 # 610 (MUX RegWriteData)control = 00, din0 = 00000000000000000000000000000011, din1 = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, din2 = 00000000010000000000000001010000, out = 00000000000000000000000000000011 # 610 (ALU)(add)A = 00000000000000000000000000000011, B = 00000000000000000000000000000001, Result = 00000000000000000000000000000100 # 610 (IM)Current Code:000100 01000 01001 00000 00000 000001 ; TheAddrOfCurCode = 00000000010000000000000001001100 # 610 (NPC)CurPCAddr:00000000010000000000000001001100 NextPcAddr:00000000010000000000000001010000 # 610 (MUX DataTo DM/ALU)control = 0, din0 = 00000000000000000000000000000011, din1 = 00000000000000000000000000000000, out = 00000000000000000000000000000011 # 610 (MUX DataTo DM/ALU)control = 0, din0 = 00000000000000000000000000000011, din1 = 00000000000000000100100000100001, out = 00000000000000000000000000000011 # 610 (MUX RegWriteData)control = 00, din0 = 00000000000000000000000000000100, din1 = 00000000000000000000000000000000, din2 = 00000000010000000000000001010000, out = 00000000000000000000000000000100 # 610 (MUX RegWriteAddr)control = 01, din0 = 01001, din1 = 00000, out = 00000 # 610 (Control) BEQ # 610 (CTRL)RegDst=00 ALUSrc=0 MemToReg=00 RegWrite=0 MemWrite=0 PCSrc=0 ExtOp=01 ALUctr=111 j_ctr=0 jr_ctr=0 DMSrc=0 # 610 (EXT)EXTOp = 00; EXTin = 0000000000000001 EXTout = 00000000000000000000000000000001 # 610 (ALU)(add)A = 00000000000000000000000000000100, B = 00000000000000000000000000000001, Result = 00000000000000000000000000000101 # 610 (NPC)CurPCAddr:00000000010000000000000001001100 NextPcAddr:00000000010000000000000001010000 # 610 (MUX RegWriteAddr)control = 00, din0 = 01001, din1 = 00000, out = 01001 # 610 (EXT)EXTOp = 01; EXTin = 0000000000000001 EXTout = 00000000000000000000000000000001 # 610 (ALU)(DEFAULT) # 610 (MUX DataTo DM/ALU)control = 0, din0 = 00000000000000000000000000000011, din1 = 00000000000000000000000000000001, out = 00000000000000000000000000000011 # 610 (MUX RegWriteData)control = 00, din0 = 00000000000000000000000000000101, din1 = 00000000000000000000000000000000, din2 = 00000000010000000000000001010000, out = 00000000000000000000000000000101 # 610 (MUX RegWriteData)control = 00, din0 = 00000000000000000000000000000000, din1 = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, din2 = 00000000010000000000000001010000, out = 00000000000000000000000000000000 # 610 (ALU)(DEFAULT) # 610 (mips_tb)clk = 1 # 611 (Show GPR) # 611 GPR 0 = 00000000 # 611 GPR 1 = 00000000 # 611 GPR 2 = 00000000 # 611 GPR 3 = 00000000 # 611 GPR 4 = 00000000 # 611 GPR 5 = 00000000 # 611 GPR 6 = 00000000 # 611 GPR 7 = 00000000 # 611 GPR 8 = 00000004 # 611 GPR 9 = 00000003 # 611 GPR 10 = 00ff0000 # 611 GPR 11 = 00ff5555 # 611 GPR 12 = 00000001 # 611 GPR 13 = 00000007 # 611 GPR 14 = 00000008 # 611 GPR 15 = 00000009 # 611 GPR 16 = 00000000 # 611 GPR 17 = 00000000 # 611 GPR 18 = 00000000 # 611 GPR 19 = 00000000 # 611 GPR 20 = 00000000 # 611 GPR 21 = 00000000 # 611 GPR 22 = 00000000 # 611 GPR 23 = 00000000 # 611 GPR 24 = 00000000 # 611 GPR 25 = 00000000 # 611 GPR 26 = 00000000 # 611 GPR 27 = 00000000 # 611 GPR 28 = 00000000 # 611 GPR 29 = 00000000 # 611 GPR 30 = 00000000 # 611 GPR 31 = 00000000 # 620 (mips_tb)clk = 0 # 630 (GPR)Write:false # 630 (PC)NextPcAddr00000000010000000000000001001100 # 630 (MUX RegWriteData)control = 00, din0 = 00000000000000000000000000000000, din1 = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, din2 = 00000000010000000000000001010100, out = 00000000000000000000000000000000 # 630 (IM)Current Code:000010 00000 10000 00000 00000 001111 ; TheAddrOfCurCode = 00000000010000000000000001010000 # 630 (NPC)CurPCAddr:00000000010000000000000001010000 NextPcAddr:00000000010000000000000001010100 # 630 (MUX DataTo DM/ALU)control = 0, din0 = 00000000000000000000000000000000, din1 = 00000000000000000000000000000000, out = 00000000000000000000000000000000 # 630 (MUX DataTo DM/ALU)control = 0, din0 = 00000000000000000000000000000000, din1 = 00000000000000000000000000000001, out = 00000000000000000000000000000000 # 630 (MUX RegWriteAddr)control = 00, din0 = 10000, din1 = 00000, out = 10000 # 630 (Control) J # 630 (CTRL)RegDst=00 ALUSrc=0 MemToReg=00 RegWrite=0 MemWrite=0 PCSrc=0 ExtOp=00 ALUctr=111 j_ctr=1 jr_ctr=0 DMSrc=0 # 630 (EXT)EXTOp = 01; EXTin = 0000000000001111 EXTout = 00000000000000000000000000000001 # 630 (ALU)(DEFAULT) # 630 (NPC)CurPCAddr:00000000010000000000000001010000 NextPcAddr:00000000010000000000000001010100 # 630 (ALU)(DEFAULT) # 630 (EXT)EXTOp = 00; EXTin = 0000000000001111 EXTout = 00000000000000000000000000001111 # 630 (MUX DataTo DM/ALU)control = 0, din0 = 00000000000000000000000000000000, din1 = 00000000000000000000000000001111, out = 00000000000000000000000000000000 # 630 (NPC)CurPCAddr:00000000010000000000000001010000 NextPcAddr:00000000010000000000000001010100 # 630 (Control) J # 630 (CTRL)RegDst=00 ALUSrc=0 MemToReg=00 RegWrite=0 MemWrite=0 PCSrc=0 ExtOp=00 ALUctr=111 j_ctr=1 jr_ctr=0 DMSrc=0 # 630 (NPC)CurPCAddr:00000000010000000000000001010000 NextPcAddr:00000000010000000000000000111100 # 630 (mips_tb)clk = 1 # 640 (mips_tb)clk = 0 # 650 (GPR)Write:false # 650 (PC)NextPcAddr00000000010000000000000001010000 # 650 (MUX RegWriteData)control = 00, din0 = 00000000000000000000000000000000, din1 = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, din2 = 00000000010000000000000001000000, out = 00000000000000000000000000000000 # 650 (IM)Current Code:000000 01101 01100 01101 00000 100001 ; TheAddrOfCurCode = 00000000010000000000000000111100 # 650 (NPC)CurPCAddr:00000000010000000000000000111100 NextPcAddr:00000000010000000000000000111100 # 650 (MUX DataTo DM/ALU)control = 0, din0 = 00000000000000000000000000000001, din1 = 00000000000000000000000000000000, out = 00000000000000000000000000000001 # 650 (MUX DataTo DM/ALU)control = 0, din0 = 00000000000000000000000000000001, din1 = 00000000000000000000000000001111, out = 00000000000000000000000000000001 # 650 (MUX RegWriteAddr)control = 00, din0 = 01100, din1 = 01101, out = 01100 # 650 (Control) ADDU # 650 (CTRL)RegDst=01 ALUSrc=0 MemToReg=00 RegWrite=1 MemWrite=0 PCSrc=0 ExtOp=00 ALUctr=010 j_ctr=0 jr_ctr=0 DMSrc=0 # 650 (EXT)EXTOp = 00; EXTin = 0110100000100001 EXTout = 00000000000000000110100000100001 # 650 (ALU)(DEFAULT) # 650 (NPC)CurPCAddr:00000000010000000000000000111100 NextPcAddr:00000000010000000000000000111100 # 650 (Control) ADDU # 650 (CTRL)RegDst=01 ALUSrc=0 MemToReg=00 RegWrite=1 MemWrite=0 PCSrc=0 ExtOp=00 ALUctr=010 j_ctr=0 jr_ctr=0 DMSrc=0 # 650 (MUX RegWriteAddr)control = 01, din0 = 01100, din1 = 01101, out = 01101 # 650 (ALU)(add)A = 00000000000000000000000000000111, B = 00000000000000000000000000000001, Result = 00000000000000000000000000001000 # 650 (MUX DataTo DM/ALU)control = 0, din0 = 00000000000000000000000000000001, din1 = 00000000000000000110100000100001, out = 00000000000000000000000000000001 # 650 (NPC)CurPCAddr:00000000010000000000000000111100 NextPcAddr:00000000010000000000000001000000 # 650 (MUX RegWriteData)control = 00, din0 = 00000000000000000000000000001000, din1 = 00000000000000000000000000000000, din2 = 00000000010000000000000001000000, out = 00000000000000000000000000001000 # 650 (MUX RegWriteData)control = 00, din0 = 00000000000000000000000000000000, din1 = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, din2 = 00000000010000000000000001000000, out = 00000000000000000000000000000000 # 650 (ALU)(add)A = 00000000000000000000000000000111, B = 00000000000000000000000000000001, Result = 00000000000000000000000000001000 # 650 (NPC)CurPCAddr:00000000010000000000000000111100 NextPcAddr:00000000010000000000000001000000 # 650 (MUX RegWriteData)control = 00, din0 = 00000000000000000000000000001000, din1 = 00000000000000000000000000000000, din2 = 00000000010000000000000001000000, out = 00000000000000000000000000001000 # 650 (mips_tb)clk = 1 # 660 (mips_tb)clk = 0 # 670 (Write GPR)PC00000000010000000000000000111100: WriteAddress01101 <= Data00000000000000000000000000001000 # 670 (PC)NextPcAddr00000000010000000000000000111100 # 670 (MUX RegWriteData)control = 00, din0 = 00000000000000000000000000001000, din1 = 00000000000000000000000000000000, din2 = 00000000010000000000000001000100, out = 00000000000000000000000000001000 # 670 (ALU)(add)A = 00000000000000000000000000001000, B = 00000000000000000000000000000001, Result = 00000000000000000000000000001001 # 670 (IM)Current Code:000000 01101 01100 01110 00000 100001 ; TheAddrOfCurCode = 00000000010000000000000001000000 # 670 (NPC)CurPCAddr:00000000010000000000000001000000 NextPcAddr:00000000010000000000000001000100 # 670 (MUX RegWriteData)control = 00, din0 = 00000000000000000000000000001001, din1 = 00000000000000000000000000000000, din2 = 00000000010000000000000001000100, out = 00000000000000000000000000001001 # 670 (MUX RegWriteAddr)control = 01, din0 = 01100, din1 = 01110, out = 01110 # 670 (EXT)EXTOp = 00; EXTin = 0111000000100001 EXTout = 00000000000000000111000000100001 # 670 (NPC)CurPCAddr:00000000010000000000000001000000 NextPcAddr:00000000010000000000000001000100 # 670 (MUX DataTo DM/ALU)control = 0, din0 = 00000000000000000000000000000001, din1 = 00000000000000000111000000100001, out = 00000000000000000000000000000001 # 670 (mips_tb)clk = 1 # 671 (Show GPR) # 671 GPR 0 = 00000000 # 671 GPR 1 = 00000000 # 671 GPR 2 = 00000000 # 671 GPR 3 = 00000000 # 671 GPR 4 = 00000000 # 671 GPR 5 = 00000000 # 671 GPR 6 = 00000000 # 671 GPR 7 = 00000000 # 671 GPR 8 = 00000004 # 671 GPR 9 = 00000003 # 671 GPR 10 = 00ff0000 # 671 GPR 11 = 00ff5555 # 671 GPR 12 = 00000001 # 671 GPR 13 = 00000008 # 671 GPR 14 = 00000008 # 671 GPR 15 = 00000009 # 671 GPR 16 = 00000000 # 671 GPR 17 = 00000000 # 671 GPR 18 = 00000000 # 671 GPR 19 = 00000000 # 671 GPR 20 = 00000000 # 671 GPR 21 = 00000000 # 671 GPR 22 = 00000000 # 671 GPR 23 = 00000000 # 671 GPR 24 = 00000000 # 671 GPR 25 = 00000000 # 671 GPR 26 = 00000000 # 671 GPR 27 = 00000000 # 671 GPR 28 = 00000000 # 671 GPR 29 = 00000000 # 671 GPR 30 = 00000000 # 671 GPR 31 = 00000000 # 680 (mips_tb)clk = 0 # 690 (Write GPR)PC00000000010000000000000001000000: WriteAddress01110 <= Data00000000000000000000000000001001 # 690 (PC)NextPcAddr00000000010000000000000001000000 # 690 (MUX RegWriteData)control = 00, din0 = 00000000000000000000000000001001, din1 = 00000000000000000000000000000000, din2 = 00000000010000000000000001001000, out = 00000000000000000000000000001001 # 690 (IM)Current Code:000000 01110 01100 01111 00000 100001 ; TheAddrOfCurCode = 00000000010000000000000001000100 # 690 (NPC)CurPCAddr:00000000010000000000000001000100 NextPcAddr:00000000010000000000000001001000 # 690 (MUX RegWriteAddr)control = 01, din0 = 01100, din1 = 01111, out = 01111 # 690 (EXT)EXTOp = 00; EXTin = 0111100000100001 EXTout = 00000000000000000111100000100001 # 690 (ALU)(add)A = 00000000000000000000000000001001, B = 00000000000000000000000000000001, Result = 00000000000000000000000000001010 # 690 (NPC)CurPCAddr:00000000010000000000000001000100 NextPcAddr:00000000010000000000000001001000 # 690 (MUX DataTo DM/ALU)control = 0, din0 = 00000000000000000000000000000001, din1 = 00000000000000000111100000100001, out = 00000000000000000000000000000001 # 690 (MUX RegWriteData)control = 00, din0 = 00000000000000000000000000001010, din1 = 00000000000000000000000000000000, din2 = 00000000010000000000000001001000, out = 00000000000000000000000000001010 # 690 (mips_tb)clk = 1 # 691 (Show GPR) # 691 GPR 0 = 00000000 # 691 GPR 1 = 00000000 # 691 GPR 2 = 00000000 # 691 GPR 3 = 00000000 # 691 GPR 4 = 00000000 # 691 GPR 5 = 00000000 # 691 GPR 6 = 00000000 # 691 GPR 7 = 00000000 # 691 GPR 8 = 00000004 # 691 GPR 9 = 00000003 # 691 GPR 10 = 00ff0000 # 691 GPR 11 = 00ff5555 # 691 GPR 12 = 00000001 # 691 GPR 13 = 00000008 # 691 GPR 14 = 00000009 # 691 GPR 15 = 00000009 # 691 GPR 16 = 00000000 # 691 GPR 17 = 00000000 # 691 GPR 18 = 00000000 # 691 GPR 19 = 00000000 # 691 GPR 20 = 00000000 # 691 GPR 21 = 00000000 # 691 GPR 22 = 00000000 # 691 GPR 23 = 00000000 # 691 GPR 24 = 00000000 # 691 GPR 25 = 00000000 # 691 GPR 26 = 00000000 # 691 GPR 27 = 00000000 # 691 GPR 28 = 00000000 # 691 GPR 29 = 00000000 # 691 GPR 30 = 00000000 # 691 GPR 31 = 00000000 # 700 (mips_tb)clk = 0 # 710 (Write GPR)PC00000000010000000000000001000100: WriteAddress01111 <= Data00000000000000000000000000001010 # 710 (PC)NextPcAddr00000000010000000000000001000100 # 710 (MUX RegWriteData)control = 00, din0 = 00000000000000000000000000001010, din1 = 00000000000000000000000000000000, din2 = 00000000010000000000000001001100, out = 00000000000000000000000000001010 # 710 (IM)Current Code:000000 01001 01100 01001 00000 100001 ; TheAddrOfCurCode = 00000000010000000000000001001000 # 710 (NPC)CurPCAddr:00000000010000000000000001001000 NextPcAddr:00000000010000000000000001001100 # 710 (MUX RegWriteAddr)control = 01, din0 = 01100, din1 = 01001, out = 01001 # 710 (EXT)EXTOp = 00; EXTin = 0100100000100001 EXTout = 00000000000000000100100000100001 # 710 (ALU)(add)A = 00000000000000000000000000000011, B = 00000000000000000000000000000001, Result = 00000000000000000000000000000100 # 710 (NPC)CurPCAddr:00000000010000000000000001001000 NextPcAddr:00000000010000000000000001001100 # 710 (MUX DataTo DM/ALU)control = 0, din0 = 00000000000000000000000000000001, din1 = 00000000000000000100100000100001, out = 00000000000000000000000000000001 # 710 (MUX RegWriteData)control = 00, din0 = 00000000000000000000000000000100, din1 = 00000000000000000000000000000000, din2 = 00000000010000000000000001001100, out = 00000000000000000000000000000100 # 710 (mips_tb)clk = 1 # 711 (Show GPR) # 711 GPR 0 = 00000000 # 711 GPR 1 = 00000000 # 711 GPR 2 = 00000000 # 711 GPR 3 = 00000000 # 711 GPR 4 = 00000000 # 711 GPR 5 = 00000000 # 711 GPR 6 = 00000000 # 711 GPR 7 = 00000000 # 711 GPR 8 = 00000004 # 711 GPR 9 = 00000003 # 711 GPR 10 = 00ff0000 # 711 GPR 11 = 00ff5555 # 711 GPR 12 = 00000001 # 711 GPR 13 = 00000008 # 711 GPR 14 = 00000009 # 711 GPR 15 = 0000000a # 711 GPR 16 = 00000000 # 711 GPR 17 = 00000000 # 711 GPR 18 = 00000000 # 711 GPR 19 = 00000000 # 711 GPR 20 = 00000000 # 711 GPR 21 = 00000000 # 711 GPR 22 = 00000000 # 711 GPR 23 = 00000000 # 711 GPR 24 = 00000000 # 711 GPR 25 = 00000000 # 711 GPR 26 = 00000000 # 711 GPR 27 = 00000000 # 711 GPR 28 = 00000000 # 711 GPR 29 = 00000000 # 711 GPR 30 = 00000000 # 711 GPR 31 = 00000000 # 720 (mips_tb)clk = 0 # 730 (Write GPR)PC00000000010000000000000001001000: WriteAddress01001 <= Data00000000000000000000000000000100 # 730 (PC)NextPcAddr00000000010000000000000001001000 # 730 (MUX RegWriteData)control = 00, din0 = 00000000000000000000000000000100, din1 = 00000000000000000000000000000000, din2 = 00000000010000000000000001010000, out = 00000000000000000000000000000100 # 730 (ALU)(add)A = 00000000000000000000000000000100, B = 00000000000000000000000000000001, Result = 00000000000000000000000000000101 # 730 (IM)Current Code:000100 01000 01001 00000 00000 000001 ; TheAddrOfCurCode = 00000000010000000000000001001100 # 730 (NPC)CurPCAddr:00000000010000000000000001001100 NextPcAddr:00000000010000000000000001010000 # 730 (MUX DataTo DM/ALU)control = 0, din0 = 00000000000000000000000000000100, din1 = 00000000000000000000000000000000, out = 00000000000000000000000000000100 # 730 (MUX DataTo DM/ALU)control = 0, din0 = 00000000000000000000000000000100, din1 = 00000000000000000100100000100001, out = 00000000000000000000000000000100 # 730 (MUX RegWriteData)control = 00, din0 = 00000000000000000000000000000101, din1 = 00000000000000000000000000000000, din2 = 00000000010000000000000001010000, out = 00000000000000000000000000000101 # 730 (MUX RegWriteAddr)control = 01, din0 = 01001, din1 = 00000, out = 00000 # 730 (Control) BEQ # 730 (CTRL)RegDst=00 ALUSrc=0 MemToReg=00 RegWrite=0 MemWrite=0 PCSrc=0 ExtOp=01 ALUctr=111 j_ctr=0 jr_ctr=0 DMSrc=0 # 730 (EXT)EXTOp = 00; EXTin = 0000000000000001 EXTout = 00000000000000000000000000000001 # 730 (NPC)CurPCAddr:00000000010000000000000001001100 NextPcAddr:00000000010000000000000001010000 # 730 (MUX RegWriteAddr)control = 00, din0 = 01001, din1 = 00000, out = 01001 # 730 (EXT)EXTOp = 01; EXTin = 0000000000000001 EXTout = 00000000000000000000000000000001 # 730 (ALU)(DEFAULT) # 730 (MUX DataTo DM/ALU)control = 0, din0 = 00000000000000000000000000000100, din1 = 00000000000000000000000000000001, out = 00000000000000000000000000000100 # 730 (Control) BEQ # 730 (CTRL)RegDst=00 ALUSrc=0 MemToReg=00 RegWrite=0 MemWrite=0 PCSrc=1 ExtOp=01 ALUctr=111 j_ctr=0 jr_ctr=0 DMSrc=0 # 730 (NPC)CurPCAddr:00000000010000000000000001001100 NextPcAddr:00000000010000000000000001010000 # 730 (MUX RegWriteData)control = 00, din0 = 00000000000000000000000000000000, din1 = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, din2 = 00000000010000000000000001010000, out = 00000000000000000000000000000000 # 730 (NPC)CurPCAddr:00000000010000000000000001001100 NextPcAddr:00000000010000000000000001010100 # 730 (ALU)(DEFAULT) # 730 (mips_tb)clk = 1 # 731 (Show GPR) # 731 GPR 0 = 00000000 # 731 GPR 1 = 00000000 # 731 GPR 2 = 00000000 # 731 GPR 3 = 00000000 # 731 GPR 4 = 00000000 # 731 GPR 5 = 00000000 # 731 GPR 6 = 00000000 # 731 GPR 7 = 00000000 # 731 GPR 8 = 00000004 # 731 GPR 9 = 00000004 # 731 GPR 10 = 00ff0000 # 731 GPR 11 = 00ff5555 # 731 GPR 12 = 00000001 # 731 GPR 13 = 00000008 # 731 GPR 14 = 00000009 # 731 GPR 15 = 0000000a # 731 GPR 16 = 00000000 # 731 GPR 17 = 00000000 # 731 GPR 18 = 00000000 # 731 GPR 19 = 00000000 # 731 GPR 20 = 00000000 # 731 GPR 21 = 00000000 # 731 GPR 22 = 00000000 # 731 GPR 23 = 00000000 # 731 GPR 24 = 00000000 # 731 GPR 25 = 00000000 # 731 GPR 26 = 00000000 # 731 GPR 27 = 00000000 # 731 GPR 28 = 00000000 # 731 GPR 29 = 00000000 # 731 GPR 30 = 00000000 # 731 GPR 31 = 00000000 # 740 (mips_tb)clk = 0 # 750 (GPR)Write:false # 750 (PC)NextPcAddr00000000010000000000000001001100 # 750 (MUX RegWriteData)control = 00, din0 = 00000000000000000000000000000000, din1 = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, din2 = 00000000010000000000000001011000, out = 00000000000000000000000000000000 # 750 (IM)Current Code:001111 00000 01000 00000 00000 000000 ; TheAddrOfCurCode = 00000000010000000000000001010100 # 750 (NPC)CurPCAddr:00000000010000000000000001010100 NextPcAddr:00000000010000000000000001010100 # 750 (MUX RegWriteAddr)control = 00, din0 = 01000, din1 = 00000, out = 01000 # 750 (Control) LUI # 750 (CTRL)RegDst=00 ALUSrc=1 MemToReg=00 RegWrite=1 MemWrite=0 PCSrc=0 ExtOp=00 ALUctr=011 j_ctr=0 jr_ctr=0 DMSrc=0 # 750 (EXT)EXTOp = 01; EXTin = 0000000000000000 EXTout = 00000000000000000000000000000001 # 750 (ALU)(DEFAULT) # 750 (NPC)CurPCAddr:00000000010000000000000001010100 NextPcAddr:00000000010000000000000001010100 # 750 (Control) LUI # 750 (CTRL)RegDst=00 ALUSrc=1 MemToReg=00 RegWrite=1 MemWrite=0 PCSrc=0 ExtOp=00 ALUctr=011 j_ctr=0 jr_ctr=0 DMSrc=0 # 750 (EXT)EXTOp = 00; EXTin = 0000000000000000 EXTout = 00000000000000000000000000000000 # 750 (ALU)(16toUp32)A = 00000000000000000000000000000000, B = 00000000000000000000000000000100, Result = 00000000000001000000000000000000 # 750 (NPC)CurPCAddr:00000000010000000000000001010100 NextPcAddr:00000000010000000000000001011000 # 750 (MUX DataTo DM/ALU)control = 1, din0 = 00000000000000000000000000000100, din1 = 00000000000000000000000000000000, out = 00000000000000000000000000000000 # 750 (MUX RegWriteData)control = 00, din0 = 00000000000001000000000000000000, din1 = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, din2 = 00000000010000000000000001011000, out = 00000000000001000000000000000000 # 750 (ALU)(16toUp32)A = 00000000000000000000000000000000, B = 00000000000000000000000000000000, Result = 00000000000000000000000000000000 # 750 (Control) LUI # 750 (CTRL)RegDst=00 ALUSrc=1 MemToReg=00 RegWrite=1 MemWrite=0 PCSrc=0 ExtOp=00 ALUctr=011 j_ctr=0 jr_ctr=0 DMSrc=0 # 750 (MUX RegWriteData)control = 00, din0 = 00000000000000000000000000000000, din1 = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, din2 = 00000000010000000000000001011000, out = 00000000000000000000000000000000 # 750 (NPC)CurPCAddr:00000000010000000000000001010100 NextPcAddr:00000000010000000000000001011000 # 750 (mips_tb)clk = 1 # 760 (mips_tb)clk = 0 # 770 (Write GPR)PC00000000010000000000000001010100: WriteAddress01000 <= Data00000000000000000000000000000000 # 770 (PC)NextPcAddr00000000010000000000000001010100 # 770 (MUX RegWriteData)control = 00, din0 = 00000000000000000000000000000000, din1 = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, din2 = 00000000010000000000000001011100, out = 00000000000000000000000000000000 # 770 (MUX DataTo DM/ALU)control = 0, din0 = 00000000000000000000000000000000, din1 = 00000000000000000000000000000000, out = 00000000000000000000000000000000 # 770 (MUX DataTo DM/ALU)control = 1, din0 = 00000000000000000000000000000000, din1 = 00000000000000000000000000000000, out = 00000000000000000000000000000000 # 770 (IM)Current Code:xxxxxx xxxxx xxxxx xxxxx xxxxx xxxxxx ; TheAddrOfCurCode = 00000000010000000000000001011000 # 770 (NPC)CurPCAddr:00000000010000000000000001011000 NextPcAddr:00000000010000000000000001011100 # 770 (MUX DataTo DM/ALU)control = 0, din0 = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, din1 = 00000000000000000000000000000000, out = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx # 770 (MUX DataTo DM/ALU)control = 1, din0 = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, din1 = 00000000000000000000000000000000, out = 00000000000000000000000000000000 # 770 (MUX RegWriteAddr)control = 00, din0 = xxxxx, din1 = xxxxx, out = xxxxx # 770 (Control) DEFAULT2 # 770 (CTRL)RegDst=00 ALUSrc=0 MemToReg=00 RegWrite=0 MemWrite=0 PCSrc=0 ExtOp=00 ALUctr=111 j_ctr=0 jr_ctr=0 DMSrc=0 # 770 (EXT)EXTOp = 00; EXTin = xxxxxxxxxxxxxxxx EXTout = 0000000000000000xxxxxxxxxxxxxxxx # 770 (ALU)(16toUp32)A = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, B = 00000000000000000000000000000000, Result = 00000000000000000000000000000000 # 770 (NPC)CurPCAddr:00000000010000000000000001011000 NextPcAddr:00000000010000000000000001011100 # 770 (Control) DEFAULT2 # 770 (CTRL)RegDst=00 ALUSrc=0 MemToReg=00 RegWrite=0 MemWrite=0 PCSrc=0 ExtOp=00 ALUctr=111 j_ctr=0 jr_ctr=0 DMSrc=0 # 770 (ALU)(DEFAULT) # 770 (MUX DataTo DM/ALU)control = 0, din0 = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, din1 = 0000000000000000xxxxxxxxxxxxxxxx, out = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx # 770 (ALU)(DEFAULT) # 770 (mips_tb)clk = 1 # 771 (Show GPR) # 771 GPR 0 = 00000000 # 771 GPR 1 = 00000000 # 771 GPR 2 = 00000000 # 771 GPR 3 = 00000000 # 771 GPR 4 = 00000000 # 771 GPR 5 = 00000000 # 771 GPR 6 = 00000000 # 771 GPR 7 = 00000000 # 771 GPR 8 = 00000000 # 771 GPR 9 = 00000004 # 771 GPR 10 = 00ff0000 # 771 GPR 11 = 00ff5555 # 771 GPR 12 = 00000001 # 771 GPR 13 = 00000008 # 771 GPR 14 = 00000009 # 771 GPR 15 = 0000000a # 771 GPR 16 = 00000000 # 771 GPR 17 = 00000000 # 771 GPR 18 = 00000000 # 771 GPR 19 = 00000000 # 771 GPR 20 = 00000000 # 771 GPR 21 = 00000000 # 771 GPR 22 = 00000000 # 771 GPR 23 = 00000000 # 771 GPR 24 = 00000000 # 771 GPR 25 = 00000000 # 771 GPR 26 = 00000000 # 771 GPR 27 = 00000000 # 771 GPR 28 = 00000000 # 771 GPR 29 = 00000000 # 771 GPR 30 = 00000000 # 771 GPR 31 = 00000000 # 780 (mips_tb)clk = 0 # 790 (GPR)Write:false # 790 (PC)NextPcAddr00000000010000000000000001011000 # 790 (MUX RegWriteData)control = 00, din0 = 00000000000000000000000000000000, din1 = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, din2 = 00000000010000000000000001100000, out = 00000000000000000000000000000000# ** Note: $finish : C:/modeltech64_10.4/examples/work/MyCPU/mips_tb.v(20) # Time: 2 us Iteration: 0 Instance: /mips_tb # 1 # Break in Module mips_tb at C:/modeltech64_10.4/examples/work/MyCPU/mips_tb.v line 20總結(jié)
以上是生活随笔為你收集整理的【计组实验】P2 Modelsim Verilog单周期处理器开发 MIPS指令集的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 【verilog 语法】always 和
- 下一篇: 【Verilog语法】PC-relatv