CSCI 2321 (Computer Design), Spring 2018:
Homework 6

Credit:
40 points.

Reading

Be sure you have read, or at least skimmed, Chapter 4 up through section 4.4.

Honor Code Statement

Please include with each part of the assignment the Honor Code pledge or just the word ``pledged'', plus one or more of the following about collaboration and help (as many as apply).1Text in italics is explanatory or something for you to fill in. For written assignments, it should go right after your name and the assignment number; for programming assignments, it should go in comments at the start of your program(s).

Problems

Answer the following questions. You may write out your answers by hand or using a word processor or other program, but please submit hard copy, either in class or in one of my mailboxes (outside my office or in the ASO).

  1. (30 points) In this problem your mission is to trace through what happens during execution of different instructions using the single-cycle implementation of the MIPS ISA as represented in Figure 4.17 in the textbook. You are to assume that at the beginning of a clock cycle the following is true for each of the instructions. (As usual, a value of the form 0xN denotes a base-16 value of N, e.g., 0x10 denotes 16 in base 10.) At the point at which values are written into state elements, what values will the following have? For 32-bit values it's okay to just give the value in either base 10 or hexadecimal (e.g. for 10 you can either write 10 or 0xa); for all other values show the binary form with the correct number of bits. Or if a value doesn't make any difference to what is saved into the state elements, just write ``not used'' (e.g., if RegWrite is zero, the values of Write register and Write data are not used). (Unless otherwise noted, ``inputs'' or ``outputs'' here are the ones shown in black -- so you don't have to repeat the values of the control signals.) Text file p1-example.txt shows an example, showing exactly what information you're being asked for. See the ``Hint'' below for some ideas about how to proceed. Text file p2-example.txt shows another example.

    Note that in order to determine output of the ALU you have to know what the various values of ALU control mean. This information is shown in Figure 4.12, and also in Appendix B.

    Instructions to trace:

    Hint: My suggestion for how to proceed is as follows: First copy from the example the list of the various things you're supposed to provide and write down what you know (current PC, values of registers, anything in data memory). Then start filling in fields: Output of the PC element is its current value; this feeds into the instruction memory and lets you determine output from the instruction memory (the questions give you its machine-language form). You can now write down inputs and outputs of the top-left adder, some inputs to the register file (the two read registers), and the main control-logic block. From those you can get more values, continuing until everything is filled in. (Yes, this is all quite tedious, but I think tracing through exactly what the implementation does with representative instructions helps you understand how it works.) When you have everything filled in, what you have should be consistent with what the instruction does (e.g., if it's supposed to store $ n$ in register $ r$ RegWrite should be 1, the write register number should be $ r$, and the data input to the register file should be $ n$.

  2. (10 points) For this problem your mission is to describe what changes, if any, would be needed to the single-cycle implementation sketched in Figure 4.24 to allow it to execute additional instructions: Would you need additional logic blocks or state elements? Would you need additional control signals? What values would be needed for the existing control signals and any new ones? (``Existing control signals'' here refers to the outputs of the logic blocks labeled Control and ALU control.)

    Instructions to add:



Footnotes

... apply).1
Credit where credit is due: I based the wording of this list on a posting to a SIGCSE mailing list. SIGCSE is the ACM's Special Interest Group on CS Education.


Berna Massingill
2018-04-02