Course No: CS F342 TUTORIAL 2 Week: #02 Course Title: Computer Architecture Solution 1 Sl.No 1 2 3 4 Instr Class Arith Load Store Branch No of Instr(ICi) 500 150 100 250 1000 CPU Clock = A Total Instruction Count(B) = B i) Avg CPI (C) = C ii) Total Exec Time (Sec)= %Time (us) Arith Load Store Branch CPIi * ICi 1 4 4 2 %Time (S) 500 0.00000025 600 0.0000003 400 0.0000002 500 0.00000025 2000 0.000001 2GHz 4 CPU Clock Cycles = iii) CPIi ∑ πΆππΌπ × πΆπ π=1 2000 4 ∑ πΆπ 1000 π=1 A/B 2 2000/2GHz 0.000001 1us (us) 0.25 0.3 0.2 0.25 (us) 0.25 0.3 0.2 0.25 1 2. We have the instruction count: 109 instructions. The clock time can be computed quickly from the clock rate to be 0.5×10-9 seconds. So we only need to to compute clocks per instruction as an effective value: Value Frequency 3 0.5 1.5 4 0.3 1.2 5 0.2 1.0 CPI = 3.7 Then we have Product Execution time = 1.0×109 × 3.7 × 0.5×10-9 sec = 1.85 sec. 3. a) Which processor has the highest performance expressed in Instructions per second? πΌπΆ ∗ πΆππΌ πΆππ ππππ = πΆπ πΌπΆ πΆπ πΌππ π‘ππ’ππ‘πππ = = π ππ πΆππ ππππ πΆππΌ 3πΊπ»π§ πΉππ π1: = 2 × 109 = 2000 ππΌππ 1.5 P2: 2.5GHz / 1.0 = 2.5 * 10^9 instructions per second P3: 4GHz / 2.2 = 1.82 * 10^9 instructions per second So P2 has the highest performance among the three b) If the processor executes a program in 10 sec, find the no of cycles and no of instructions executed. πΆππ ππππ = πΆππ πΆπ¦ππππ ∗ πΆππππ πΆπ¦πππ ππππ πΆππ ππππ πΆππ πΆπ¦ππππ = = πΆππ ππππ × πΆπ πΆππππ πΆπ¦πππ ππππ πΉππ π1: πΆππ πΆπ¦ππππ = 10 π × 3 πΊπ»π§ = 30 πΊ πΆπ¦ππππ Cycles: πΆππ ππππ = πΌπΆ × πΆππΌ × πΆππππ πΆπ¦πππ ππππ πΆππ ππππ πΆππ ππππ πΌπΆ = = × πΆπ πΆππΌ × πΆππππ πΆπ¦πππ ππππ πΆππΌ 10 π πΉππ π1: πΌπΆ = × 3 πΊπ»π§ = 20 πΊ πΌππ π‘ππ’ππ‘ππππ 1.5 P2: 2.5GHz * 10 = 2.5 * 10^10 cycles P3: 4GHz * 10 = 4 * 10^10 cycles No. of instructions P2: 2.5GHz * 10 / 1.0 = 2.5 * 10^10 instructions P3: 4GHz * 10 / 2.2 = 1.82 * 10^10 instructions c) For each of the processors, what should be the clock rate, if the execution time reduced by 30%, but leads to an increase in CPI by 20%. πΌπΆ ∗ πΆππΌ , πΆπ πΆππ πππππππ€ = 0.7 × πΆππ πππππππ πΆππΌπππ€ = 1.2 × πΆππΌπππ πΌπΆ × πΆππΌπππ πΆππ πππππππ πΆπ πππ = πΌπΆ × πΆππΌπππ πΆππ πππππππ€ πΆπ πππ€ πΌπΆ × πΆππΌπππ πΆππ πππππππ 3πΊπ»π§ πΉππ π1: = πΌπΆ × 1.2 × πΆππΌπππ 0.7 × πΆππ πππππππ πΆπ πππ€ 1.2 × 3 πΊπ»π§ πΆπ πππ€ = = 5.14 πΊπ»π§ 0.7 πΆππ ππππ = P2: 2.5GHz * 1.71 = 4.27 GHz; P3: 4GHz * 1.71 = 6.84 GHz Percent increase = [(new value - original value)/original value] * 100 Percent decrease = [(original value - new value)/original value] * 100