Assume CPU A can execute 1 instruction in 5 ns and CPU B can
Solution
Answer.
CPU A: Time taken for 1 instruction = 5 ns
CPU B: Time taken for 1 instruction = 16 ns
But CPU B can execute 4 instructions at the same time.
A.
Time taken by CPU A to execute 3 instructions = 3 * 5 ns = 15 ns.
Time taken by CPU B to execute 3 instructions = Time to execute 1 instruction = 16 ns.
It is because it can execute 3 instructions at once.
So, CPU A is preferred.
B.
When number of instructions increases to 16,
Time taken by CPU A to execute 16 instructions = 16 * 5 ns = 80 ns.
Time taken by CPU B to execute 16 instructions = 16 * (16 / 4) ns = 64 ns.
Hence, CPU B is preferred.
C.
When number of instruction to be executed are considerably high, we should choose use CPU B to execute them.
In our case, when number of instructions become more than 6, we should prefer CPU B.
