CS274: Computer Architecture - In-Class Assessment: The Single Cycle Datapath (10 Points)

Assignment Goals

The goals of this assignment are:
  1. To trace an instruction through the single cycle datapath
  2. To determine the control signal values required to execute a MIPS instruction

Background Reading and References

Please refer to the following readings and examples offering templates to help get you started:

The Assignment

This is a short, low-stakes in-class assessment, completed individually on paper during class and graded on the basis of demonstrated reasoning (showing your work earns credit even when an arithmetic slip occurs). It counts toward the Class Participation and Quizzes portion of your grade.

What to Expect

You will be given a copy of the single cycle datapath diagram and one or two MIPS instructions (for example, an R-type instruction like add, and a memory or branch instruction like lw or beq). In roughly 15 minutes, you will:

  1. Highlight the path each instruction takes through the datapath (which components are used, and which are ignored).
  2. Fill in a table of the control signal values (RegDst, RegWrite, ALUSrc, ALUOp, MemRead, MemWrite, MemtoReg, Branch) for each instruction.
  3. For a branch instruction, compute the branch target address from the PC and the encoded offset, showing each step of the arithmetic.

How to Prepare

  • Re-work the traces from the single cycle activity and lab without looking at your notes, then check yourself against them.
  • For each control signal, be able to say in one sentence what question it answers (for example, ALUSrc answers: “does the ALU’s second input come from a register, or from the sign-extended immediate?”).
  • Practice the branch offset arithmetic: offset = (target − (PC + 4)) / 4, and target = PC + 4 + (offset × 4).

Grading

Full credit requires a legible trace, a complete control signal table with a brief justification for each value, and branch arithmetic with the steps shown. Partial credit is given for partially correct tables and traces that demonstrate understanding of the datapath’s structure.

Submission

In your submission, please include answers to any questions asked on the assignment page, as well as the questions listed below, in your README file. If you wrote code as part of this assignment, please describe your design, approach, and implementation in a separate document prepared using a word processor or typesetting program such as LaTeX. This document should include specific instructions on how to build and run your code, and a description of each code module or function that you created suitable for re-use by a colleague. In your README, please include answers to the following questions:
  • Describe what you did, how you did it, what challenges you encountered, and how you solved them.
  • Please answer any questions found throughout the narrative of this assignment.
  • If collaboration with a buddy was permitted, did you work with a buddy on this assignment? If so, who? If not, do you certify that this submission represents your own original work?
  • Please identify any and all portions of your submission that were not originally written by you (for example, code originally written by your buddy, or anything taken or adapted from a non-classroom resource). It is always OK to use your textbook and instructor notes; however, you are certifying that any portions not designated as coming from an outside person or source are your own original work.
  • Approximately how many hours it took you to finish this assignment (I will not judge you for this at all...I am simply using it to gauge if the assignments are too easy or hard)?
  • Your overall impression of the assignment. Did you love it, hate it, or were you neutral? One word answers are fine, but if you have any suggestions for the future let me know.
  • Using the grading specifications on this page, discuss briefly the grade you would give yourself and why. Discuss each item in the grading specification.
  • Any other concerns that you have. For instance, if you have a bug that you were unable to solve but you made progress, write that here. The more you articulate the problem the more partial credit you will receive (it is fine to leave this blank).

Please refer to the Style Guide for code quality examples and guidelines.