CSCI 2321 (Computer Design), Spring 2021:
Homework 1

Credit:
35 points.

Reading

Be sure you have read, or at least skimmed, the assigned readings from Chapter 1.

Problems

Answer the following questions. You may write out your answers by hand and scan them, or you may use a word processor or other program, but please submit a PDF or plain text via e-mail to my TMail address. (No links to shared files on Google Drive please.) Please use a subject line that mentions the course and the assignment (e.g., “csci 2321 hw 1” or “computer design hw 1”).

Tips:

End of tips

  1. (10 points) Suppose two processors implement a given instruction set architecture in which the instructions can be grouped into four classes A, B, C, and D. Processor P1 has a clock rate of 2.5GHz, and the CPIs (cycles per instruction) for the four classes are 1, 2, 3, and 3 respectively. Processor P2 has a clock rate of 3GHz and a CPI of 2 for all classes. Suppose a particular program at runtime executes 1E9 ($10^9$) instructions, of which 10% are class A, 20% class B, 50% class C, and 20% class D. Answer the following questions about this program:

    1. How many seconds does this program take on P1? on P2?

    2. If we define “global CPI” for a program as an average CPI for the program (i.e., one that takes into account the relative frequencies of the different classes of instructions), calculate global CPI for this program on both P1 and P2. (So this value is probably best computed using the total number of cycles and the total number of instructions.)

  2. (15 points) This question explores the effects of parallelism on execution time. Suppose you have a system on which instructions are grouped into three categoris: and the clock frequency is 2GHz.

    Suppose also you have a sequential (non-parallel) program that executes:

    (E9 indicates multiplication by ($10^9$)) and a parallel version of the same program that can take advantage of multiple cores. This parallel version must execute the same number of branch instructions, but counts for the other two groups of instructions are counts for the sequential version divided by $0.7 \times p$, where $p$ is the number of cores/processors.

    Answer the following questions about these programs:

    1. What is the execution time for the sequential version?

    2. What are execution times for the parallel version running on 1, 2, 4, and 8 cores?

    3. What are speedups (defined as parallel time divided by sequential time) for 1, 2, 4, and 8 cores?

    4. What would happen if the clock rate were changed to 2.5GHz but arithmetic instructions now had a CPI of 2? (Recalculate all times and speedups.)

    5. Optional: For up to 2 extra-credit points, plot the calculated speedups and a line showing what linear speedup would look like. (If you don't already have a favorite program for making plots, ask me about gnuplot.)

    Suggestion: The calculations here are pretty tedious. I really suggest that you write a short throw-away program to help you, in whatever language appeals to you. If you do, when you e-mail me your answers, attach a a copy of your source code; that will be the equivalent of “showing your work”.

  3. (10 points) The text observes that it can be a mistake to focus on only one or two of the three variables that define execution time and assume this subset tells you which is faster. Suppose you have two systems: and a program that on P1 requires 5E9 instructions and on P2 requires 1E9 instructions. Answer the following questions about this scenario:
    1. What are execution times for this program on both systems?
    2. Is it true that the system with the highest clock rate performs better?
    3. Is it true that the system that executes more instructions performs worse?
    4. If you define MIPS rate (millions of instructions per second) as number of executions divided by time, what is the MIPS rate for this program on both systems? Is it true that the system with the higher MIPS rate performs better?

Pledge

For programming assignments, this section should go in the body of the e-mail or in a plain-text file pledge.txt (no word-processor files please). For written assignments, please put it in the text or PDF file with your answers.

Include the Honor Code pledge or just the word “pledged”, plus at least one of the following about collaboration and help (as many as apply). Text in italics is explanatory or something for you to fill in.

Essay

For programming assignments, this section should go in the body of the e-mail or in a plain-text file pledge.txt (no word-processor files please). For written assignments, please put it in the text or PDF file with your answers.

Include a brief essay (a sentence or two is fine, though you can write as much as you like) telling me what if anything you think you learned from the assignment, and what if anything you found interesting, difficult, or otherwise noteworthy.




2021-02-05