Assume CPU A can execute 1 instruction in 5 ns and CPU B can

Assume CPU A can execute 1 instruction in 5 ns and CPU B can execute 1 instruction in 16 ns. CPU B can execute 4 instructions at the same time (A cannot do that). A. If there is a program that consists of only 3 instructions, which CPU do you prefer to use? B. What if there are 16 instructions? C. In which case would you want to choose CPU B over CPU A in order to execute instructions faster?

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.

 Assume CPU A can execute 1 instruction in 5 ns and CPU B can execute 1 instruction in 16 ns. CPU B can execute 4 instructions at the same time (A cannot do tha

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site