180 likes | 409 Views
ECE 369. Chapter 4. addi $29, $29, 16 Assume register $29 initially contains the number 129. addi $29, $29, 16 Assume register $29 initially contains the number 129. What happens at stuck at 0 for….?. RegWrite.
E N D
ECE 369 Chapter 4
addi $29, $29, 16Assume register $29 initially contains the number 129.
addi $29, $29, 16Assume register $29 initially contains the number 129.
What happens at stuck at 0 for….? RegWrite R-format instructions, in addition to lw: will not be able to write their results to the register file.
What happens at stuck at 0 for….? ALUop1 How about add or sub? All R-format instructions
What happens at stuck at 0 for….? ALUop0 Beq instruction will not work because the ALU will perform addition instead of subtraction
What happens at stuck at 1 for….? RegWrite Sw (beq) will overwrite a random register with either the store address (branch target) or random data from the memory data read
New inruction (l_inc)= lw $rs, ($rt) addi $rt, $rt,1 You can modify the datapath: a) Introduce new module(s) b) Introduce input(s)/output(s) to existing modules c) Add new control signal(s)
New instruction (l_inc)= lw $rs, ($rt) addi $rt, $rt,1 Auto incrementer unit Second write port (WriteData2) Write2 control signal Feed Inst[25-21] to second write port Write2 controls this write
Modify single cycle to implement Jump Register (Jr $rs) = PC<-$rs
Modify single cycle to implement Jump Register (Jr $rs) = PC<-$rs
bmez $rt, $rs, imm16 RegWrite reads the value of memory in address (R[$rs] + R[$rt]), compares it to zero and if zero then branches to the zero extended immediate, otherwise it goes on to the next instruction.
sw+ is a “store word, with post increment” M[R[rs]] = R[rt] R[rs] = R[rs] + imm
Modify the datapath to handle: lw rt, rs # R[rt] = M[R[rs]] sw rt, rs # M[R[rs]] = R[rt]