In: Computer Science
. In this exercise we will evaluate the performance difference between two CPU architectures: CISC (Complex Instruction Set Computing) and RISC (Reduced Instruction Set Computing). Generally speaking, CISC CPUs have more complex instructions than RISC CPUs and therefore need fewer instructions to perform the same tasks. However, typically one CISC instruction, since it is more complex, takes more time to complete than a RISC instruction. Assume that a certain task needs P CISC instructions and 2P RISC instructions, and that one CISC instruction takes 8T ns to complete, and one RISC instruction take 2T ns.
a: Under this assumption, calculate the time that the CISC CPU will take to complete the task?
b: Calculate the time that the RISC CPU will take to complete the task?
c: Which CPU would complete the task faster?
d: By what percentage should the clock frequency of the slower CPU change to catch up with the faster CPU for this task?
The solution for the given problem is provided below and if you feel any problem, feel free to ask:
Solution:- Given: P CISC instructions and 2P RISC instructions. Time for completion of one instruction for CISC is 8T ns and for RISC is 2T ns.
a. For the time(Tc) that CISC CPU will take to complete the task.
⇒ Tc = number of instruction in task * time to complete one instruction
⇒ Tc = P*8T
⇒ Tc = 8PT
b. For the time(Tr) that RISC CPU will take to complete the task.
⇒ Tr = number of instruction in task * time to complete one instruction
⇒ Tr = 2P * 2T
⇒ Tr = 4PT
c. From the above two parts, that are, part (a) and part(b) we get that the time for completion of the task in CISC CPU is 8TP and in RISC CPU it is 4PT. On comparing both times, the RISC CPU take less time to complete the task and will complete the task faster than the given CISC CPU.
d. The performance equation tells the complete time for the task to complete, to know how much you have to increase the clock frequency you can use the same formula of performance equation with required performance. Required performance(Rp) = 4PT, per instruction time = 8T and, number of instructions = P.
Rp = Number of instructions*time per instruction/clock frequency
⇒ 4PT = P*8T/Cf (taking the clock frequency as Cf)
⇒ 4PT = 8PT/Cf
⇒ Cf = 8PT/4PT
⇒ Cf = 2
Hence, you have to double the clock frequency of the slower CPU to match the clock frequency of the slower CPU with the faster CPU for this task.
In terms of percentage you have to increase the clock frequency of slower CPU by 100% which results in the doubling of value and the clock frequency becomes 2x(or 200%) of the previous frequency.