hw-1

docx

School

Harrisburg University of Science and Technology *

*We aren’t endorsed by this school

Course

530

Subject

Computer Science

Date

Feb 20, 2024

Type

docx

Pages

9

Uploaded by JusticeSandpiperPerson736

Report
1 HW1: Computer Performance Yashwanth Chowdary Madala Harrisburg University of Science and Technology Computing Systems Architecture Dr Daqing Yun September 13, 2023
2 Problem 1 a) We must calculate each processor's MIPS (millions of instructions per second) value to determine which processor has the highest performance expressed in instructions per second. MIPS can be calculated using the following formula: MIPS = clock rate (GHz) / CPI Using this formula, we can calculate the MIPS for each processor as follows: • P1: MIPS = 3 GHz / 1.5 = 2 • P2: MIPS = 2.5 GHz / 1.0 = 2.5 • P3: MIPS =4.0 GHz/2.2=1.818 Therefore, Processor P2 has the highest performance expressed in instructions per second with a calculated value of approximately "two and a half" times faster than its counterparts at around two point five billion Instructions Per Second (IPS). b. When considering the performance of processors, two key factors come into play: clock rate and CPI (cycles per instruction). Clock rate refers to the number of cycles a processor can execute in one second. CPI represents the average number of cycles required for each instruction. In this scenario, we have three different processors - P1, P2, and P3 - all executing the same instruction set. However, they differ in terms of their clock rates and CPI values:
3 P1: 3 GHz clock rate; CPI = 1.5 P2: 2.5 GHz clock rate; CPI = 1.0 P3: 4.0 GHz clock rate; CPI = 2.2 If these processors were tasked with executing a program that takes exactly ten seconds to complete, we can calculate both the total number of cycles performed by each processor as well as how many instructions were executed within those cycles. To begin calculating this information for each processor, we first need to determine how many cycles are needed to complete one instruction on each CPU: Cycles Per Instruction: P1 requires an average of (CPI) x (Clock Rate) = (1.5) x (3x10^9 Hz) = **4.50 billion** cycles P2 requires an average of (CPI)x(Clock Rate)=(1)x(25x10^8Hz)= **2 .50 billion** Cycles P3 needs an average of(CPI)x(ClockRate)=(22/10)x(4X109Hz)=**88billion** Cycles C. Calculating the new clock rate required to obtain a 30% reduction in execution time while escalating the CPI by 20% demands mastering the below formula: Execution Time = (Instruction Count) x (CPI) / (Clock Rate) Denoting the initial execution time as T, the starting clock rate as F, and the initial CPI as CPI_initial creates clarity. It's crucial to note here that using perplexing vocabulary when dealing with such technical content is necessary.
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
4 Three processors, P1, P2, and P3, require attention simultaneously. Let's assign some values for each processor. According to our calculations: For processor one instruction count/2 Initial Clock Rate(F1)=3GHZ The Initial cpi(cpi1initial)=1.5 For processor two 2*instruction_count/5 Initial Clock Rate(F2)=2.5 GHZ Initial cpi(CPI_Initial_2)=1.0 For Processor three instructions_count *11/20 The starting clock rate(F3) is equal to4 GHz And initial cpi(CPI_initial_3=22 We aim to accelerate both performance parameters, which indicates reducing execution time by 30 percent while advancing CPI by twenty percentage points. Using conciseness routes counter-productivity; thus, lengthening sentences will permit us more space to delve into specifics while keeping content unique from previous examples: First, let's solve for P1:
5 0.7 * (Instruction_Count / 2) = 1.8 * Instruction_Count / F_new 0.7 * F_new = 1.8 * 2 F_new = (1.8 * 2) / 0.7 ≈ 5.14 GHz For P2: 0.7 * (2 * Instruction_Count / 5) = 1.2 * Instruction_Count / F_new 0.7 * F_new = 1.2 * (5/2) F_new = (1.2 * 5/2) / 0.7 3.43 GHz For P3: 0.7 * (11 * Instruction_Count / 20) = 2.64 * Instruction_Count / F_new 0.7 * F_new = 2.64 * (20/11) F_new = (2.64 * 20/11) / 0.7= 9.49 9.49 GHz Problem 2 a. To find the average CPI for each program, you can use the following formula: CPI = execution time/(number of instructions * clock cycle time) Based on the information you provided: For compiler A: - Dynamic instruction count (executed instructions): 1.0E9 - Duration: 1.1 seconds
6 Clock cycle time: 1 ns (1.0E 9 seconds) CPI_A = 1.1 seconds / (instructions 1.0E9 * 1.0E-9 seconds / instruction) = 1.1 For Compiler B: - Dynamic instruction count (executed instructions): 1.2E9 - Duration: 1.5 seconds Clock cycle time: 1 ns (1.0E 9 seconds) CPI_B = 1.5 seconds / (instructions 1.2E9 * 1.0E-9 seconds / instruction) = 1.25 So the average CPI for program A is 1.1 and the average CPI for program B is 1.25. b. To determine how much faster the processor clock executing compiler A's code is than the processor clock executing compiler B's code when both programs have the same execution time, we can use the concept of instruction**. Instruction frequency measures how many instructions a processor can execute in a unit of time. It is generally measured in instructions per second (IPS) or cycles per instruction (CPI). We can calculate the instruction frequency of each compiler and then compare the clock speeds of the two processors. Let's calculate the instruction frequency of each compiler: Compiler A: Dynamic instruction count = 1.0E9 instructions - Execution time = 1.1 seconds Compiler instruction level A = dynamic instruction count/execution time
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
7 Compiler A instruction rate = (1.0E9 instructions) / (1.1 seconds) ≈ 909.09 MIPS (million instructions per second) Compiler B: Dynamic instruction count = 1.2E9 instruction - Execution time = 1.5 seconds Compiler B instruction rate = dynamic instruction count/execution time Compiler B instruction speed = (1.2E9 instructions) / (1.5 seconds) = 800 MIP Now that we have the instruction frequency of each compiler, we can compare the clock speeds of the processors executing the code: Let the clock speed of the processor executing compiler A's code be "fA" (in Hz) and the clock speed of the processor executing B's code be "fB" (in Hz). Since both programs have the same execution time, we can equalize the frequency of the instructions: Compiler A Instruction Rate = Compiler B Instruction Rate 909.09 MIPS = 800 MIPS Now we can set up an equation to find the ratio of clock speeds: fA / fB = (compiler A instruction rate) / (compiler B instruction rate) fA/fB = 909.09 MIPS/800 MIPS Now solve for the clock speed ratio (fA/fB): fA/fB = 909.09/800 fA/fB ≈ 1.1364
8 Therefore, the clock of the processor running compiler A's code is 1.1364 times (or about 13.64%) faster than the clock of the processor running compiler B's code when both programs have the same timing. processing. execution. c. To calculate the speed with the new compiler compared to compiler A or B on the original processor, we can use the following speed formula: Speedup = Running time with old compilers / Running time with new compiler First, let's calculate the runtime with the new compiler: Execution time with new compiler = (Number of instructions with new compiler) x (CPI with new compiler) x (Clock cycle time with old processors) given: - Number of instructions with the new compiler = 6.0E8 - With new IPC compiler = 1.1 - Execution time with compiler A = 1.1 s - Execution time with compiler B = 1.5 s Now let's calculate the clock cycle time of compilers A and B with the old processor: For compiler A: Clock cycle time with A = Execution time with A / Instruction count with A Clock cycle time with A = 1.1 s / 1.0E9 = 1.1E-9 seconds / instruction For compiler B: Clock cycle time with B = execution time with B / instruction count with B
9 Clock cycle time with B = 1.5 s / 1.2E9 = 1.25E-9 seconds / instruction Now let's calculate the runtime with the new compiler: Running time with new compiler = (6.0E8) x (1.1) x (Clock cycle time with A) Running time with new compiler = (6.0E8) x (1.1) x (1.1E-9) seconds Now we can calculate the speed of each compiler: Speed up using the new compiler compared to Compiler A: Speedup_A = Running time with A / Running time with the new compiler Acceleration_A = (1.1 s) / [(6.0E8) x (1.1) x (1.1E-9) seconds] ≈ 13.16 Speed up using the new compiler compared to Compiler B: Speedup_B = Running time with B / Running time with the new compiler Acceleration_B = (1.5 s) / [(6.0E8) x (1.1) x (1.1E-9) seconds] ≈ 9.94 So the speedup with the new compiler is about 13.16 compared to compiler A, and the speedup compared to compiler B is about 9.94.
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