homework assignment 1

pdf

School

Rutgers University *

*We aren’t endorsed by this school

Course

3101

Subject

Computer Science

Date

Dec 6, 2023

Type

pdf

Pages

4

Uploaded by GeneralChinchilla3315

Report
Lynch 1 Caitlyn Lynch Dr. Linwei Niu Computer Organization 1 (CSCI 201-02) 21 September 2023 Homework Assignment 1 1. Consider three different processors P1, P2, and P3 executing the same instruction set. P1 has a 3 GHz clock rate and a CPI of 1.5. P2 has a 2.5 GHz clock rate and a CPI of 1.0. P3 has a 4.0 GHz clock rate and has a CPI of 2.2. a. Which processor has the highest performance expressed in instructions per second? - Calculate performance using Performance (IPC) = Clock Rate (GHz) / CPI - Performance (P1) = 3 GHz / 1.5 = 2 IPC - Performance (P2) = 2.5 GHz / 1.0 = 2.5 IPC - Performance (P3) = 4.0 GHz / 2.2 = 1.818 IPC Processor P2 has the highest performance in instructions per second. b. If the processors each execute a program in 10 seconds, find the number of cycles and the number of instructions. - Number of Cycles = 10 seconds * Clock Rate (GHz) - Number of Instructions = Number of Cycles / CPI - P1 | 30 billion cycles, 20 billion instructions Number of cycles = 10 seconds * 3 GHz = 30 billion cycles Number of instructions = 30 billion cycles / 1.5 = 20 billion instructions - P2 | 25 billion cycles, 25 billion instructions
Lynch 2 Number of cycles = 10 seconds * 2.5 GHz = 25 billion cycles Number of instructions = 25 billion cycles / 1.0 = 25 billion instructions - P3 | 40 billion cycles, 18.18 billion instructions Number of cycles = 10 seconds * 4.0 GHz = 40 billion cycles Number of instructions = 40 billion cycles / 2.2 = 18.18 billion instructions c. We are trying to reduce the execution time by 30% but this leads to an increase of 20% in the CPI. What clock rate should we have to get this time reduction? - We are trying to reduce execution by 30%, so the new execution time is 70% of the original. New Execution Time = 0.7 * Original Execution Time - We are also increasing CPI by 20%. New CPI = 1.2 * Original CPI - IPC is inversely proportional to CPI. New IPC = Original Clock Rate / New CPI - New IPC should be the same as the original IPC to maintain performance levels - New Clock Rate = Original Clock Rate / New CPI - Substitute values as, New Clock Rate = (Original Clock Rate) / 1.2 The new clock rate should be (Original Clock Rate) / 1.2 2. Consider two different implementations of the same instruction set architecture. The instructions can be divided into four classes according to their CPI (class A, B, C, and D). P1 with a clock rate of 2.5 GHz and CPIs of 1, 2, 3, and 3, and P2 with a clock rate of 3 GHz and CPIs of 2, 2, 2, and 2. a. Given a program with a dynamic instruction count of 1.06 instructions divided into classes as follows: 10% class A, 20% class B, 50% class C, and 20% class D, which implementation is faster?
Lynch 3 - To determine which implementation is faster, we must compare total execution times. Total Execution Time = (Dynamic Instruction Count * Global CPI) / Clock Rate. - P1 | Total Execution Time = 1.06 seconds (1.06 * (0.11 + 0.22 + 0.53 + 0.23)) / 2.5 GHz = (1.06 * 2.5) / 2.5 = 1.06 seconds - P2 | Total Execution Time = 0.7067 seconds (1.06 * (0.12 + 0.22 + 0.52 + 0.22)) / 3 GHz = (1.06 * 2) / 3 = 0.7067 seconds - P3 | Total Execution Time = 0.795 seconds (1.06 * (0.13 + 0.23 + 0.53 + 0.23)) / 4 GHz = (1.06 * 3) / 4 = 0.795 seconds - Substitute values as, New Clock Rate = (Original Clock Rate) / 1.2 Implementation P2 has the lowest execution time, making it the fastest. b. What is the global CPI for each implementation? - The global CPI is calculated as the weighted sum of CPIs for each instruction class for each processor. - P1 | Global CPI = 2.1 Global CPI = (1 * 0.1 + 2 * 0.2 + 3 * 0.5 + 3 * 0.2) = 0.1 + 0.4 + 1.5 + 0.6 = 2.1 - P2 | Global CPI = 2.0 Global CPI = (2 * 0.1 + 2 * 0.2 + 2 * 0.5 + 2 * 0.2) = 0.2 + 0.4 + 1.0 + 0.4 = 2.0 - P3 | Global CPI = 3.0 Global CPI = (3 * 0.1 + 3 * 0.2 + 3 * 0.5 + 3 * 0.2) = 0.3 + 0.6 + 1.5 + 0.6 = 3.0 c. Find the clock cycles required in both cases. - Clock Cycles = (Dynamic Instruction Count * Global CPI) / Clock Rate. - P1 | Approximately 2.65 million cycles
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
Lynch 4 Clock Cycles = (1.06 * 2.1) / 2.5 GHz = 2.65 million cycles - P2 | Approximately 2.12 million cycles Clock Cycles = (1.06 * 2.0) / 3 GHz = 2.12 million cycles - P3 | Approximately 2.12 million cycles Clock Cycles = (1.06 * 3.0) / 4 GHz = 2.12 million cycles