Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Objective: Review the operation of Single- and Multi-cycle MIPS for a subset of

ID: 2250032 • Letter: O

Question

Objective: Review the operation of Single- and Multi-cycle MIPS for a subset of instructions Assignments 1. For a single-cycle MIPS, determine the values on the wires marked by letters A.B,C...Q in Figure 1 (solution sheets) during the cycle of implementation of addi $s0, Ss1, 3. Assume the instruction address is 0x00400024, and S1-2. Fill in Table 1 Unit MemWrite PCSrc op ALUSre BogWrito CLK A CLK WE Instr-A1 RD1 ARD Instr ALURosult Instruction Data K Memory RD2 A2 A3 WD3 Register WriteData File PCPlus4 Fig.1 Single -cycle MIPS

Explanation / Answer

While addi $s0, $s1, -3 is getting executed (which is stored at memory loaction 0x00400024) the PC will point to the next instruction which will be at location 0x00400028 (since every increment adds 4 to the PC). This is the value seen at the signal A. The signal B is buffered value of signal A and is hence one increment behind A. Thus B has a value 0x00400024. It can be seen that the instructin is an I-type (Immediate operand) instruction. In this instruction bits 25-21 store the source register which in this case is $s1. Thus bits 25-21 will be 00001 which will be the value of signal C. Signal at D for I type instructions is the destination register which is $s0 in our case so bits 20-16 contains 00000. Since A3 allows us to write data to the destination register the value at input A3 must be that of register $s0 so E has the value 00000. F has the same value as well 00000 because it is connected to D. G will have the value of source register which is $s1 in this case so G will have the value 0x0002. H will have the value of sign extended operand which is -3. So H equals 0xFFFFFFFD. Since we are not reading anything from data memory K will have the data stored at the memory location pointed by ALU result (which is 2-3 = -1 = 0xFFFFFFFF)

The value of L will be the result of ALU which is -1 = 0xFFFFFFFF.

M has the sign extended value of immediate operand left shifted by two places. Hence M = -12 = 0xFFFFFFF4. N is sum of PC+4 and M which is 0x00400028+0x00000004+0xFFFFFFF4 = 0x00400020

Q is the value of 16 bit immediate which in this case is -3 which equals 0xFFFD.