239,366 views
20 votes
20 votes
A processor operates at a clock rate of 1.6 GHz yet has a varying CPI for different instruction types. A given program has 400 ALU instructions which take the processor 7 cycles complete each instruction. It has 300 memory instructions that take 12 cycles to cycles to complete each instruction. It also has 90 branching operations that take 21 cycles to cycles to complete each instruction. How long does it take to execute this program

User Statguy
by
2.5k points

1 Answer

19 votes
19 votes

Answer:

0.0051825 ms

Step-by-step explanation:

From the given information:

The clock time is =
image


image


image

To milliseconds, we have;

= 0.000000625 ms

However, the execution time is the sum total of all instruction types multiplied by the ratio of cycles taken per instruction and cycle time.

Mathematically;

Execution time is:
image

Recall that:

the cycles taken according to the ALU = 400 × 7 =2800

cycles required according to the memory instructions = 300 × 12 = 3600

cycles for branching = 90×21 = 1890

THUS;

Total cycles = 2800 + 3600 + 1890

= 8290 cycles

Finally, execution time = 8290 cycles × 0.000000625 ms

= 0.0051825 ms

User Tarun Nagpal
by
2.8k points