CSE/EEE 230 – Assignment 6Important: This is an individual assignment. Please do not collaborate.
Make sure to follow the academic integrity policies. Using work done by someone else will be
considered a violation of the academic integrity and will result in a report to the Dean’s office.
Your work should not match with anything found online.
Copying any part of this assignment, and providing them to another person or posting them on
the Internet without a permission of the instructor will be a violation of its copyright.
http://www.asu.edu/copyright/
No late submissions will be accepted.
Show all the steps to receive full credit.
There are 3 questions. The score will be scaled down to a total of 3 points.
Make sure to segment your document for the 3 questions.
The following MIPS Code is executed using the single cycle MIPS architecture.
Start:
Loop:
addiu $t9, $0, 230
addi $t8, $0, 4
add $s1, $s0, $t8
slt $t0, $s0, $s1
beq $t0, $0, Exit
lbu $t1, 0($s0)
sub $t1, $t1, $t9
sb $t1, 0($s0)
addi $s0, $s0, 1
j Loop
Exit:
Question 1: Data Path – For the given code, write the Functional Units used in order. (10 points)
•
•
Specify if any Functional Units (FUs) are used in parallel for the same instruction, for
example PC+4 Adder is used in parallel to Instruction Memory.
For Multiplexors, if the output of the MUX is used, then it implies that the MUX is used
(i.e., if the select lines are 0 or 1 and not don’t cares, then the MUX is used). Similarly, if
any FU output is unused, we assume that the FU is unused.
• You may group the instructions with the same datapath.
• You may use the following notations for the Functional Units.
Instruction Memory (IM), Data Memory (DM), Register File (RF), Arithmetic and Logical Unit
(ALU), Program Counter Register (PC), Sign Extension block (SE), Control Unit (ctrl1), ALU control
unit (ctrl2), PC+4 Adder (add1), Branch PC target Adder (add2), Shift Left 2 (sll), Regdst MUX
(mux1), ALUSrc MUX (mux2), MemtoReg MUX (mux3), PCSrc MUX (mux4), Jump MUX (mux5).
Question 2: Control Path – For the given code, write the values of the control signals for each
instruction. For each control signal, explain where it is used. (10 points)
•
•
You may group the instructions with the same control signals.
The control signals to be included are: ALUOp, ALU control output (ALU ctrl), Branch,
Jump, PCSrc, Regdst, ALUSrc, MemtoReg, RegWrite, MemRead and MemWrite
Question 3: Execution Time – For the given code, compute the execution time for each instruction
and for the complete code based on the following information. (10 points)
(i) Given the following access times for the critical functional units, compute the time taken to
execute each instruction. You may group the instructions with the same execution time.
Memory Access = 0.26ns;
Register Access = 0.1ns;
ALU execution = 0.2ns
(ii) Assuming all instructions are executed using a fixed clock cycle length. What is the execution time
for the complete code/program?
(iii) Assuming instructions are executed using a variable length cycle, i.e., for an instruction, the cycle
length is the time it takes to complete that instruction. What is the execution time for the
complete code/program (including the loop execution)?