asked 20.4k views
2 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

asked
User Saad Ali
by
8.5k points

1 Answer

3 votes

Answer:

0.0051825 ms

Step-by-step explanation:

From the given information:

The clock time is =
(1)/(clok \ rate)


=(1)/(6) Ghz


=(1)/(6)* 10^9

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:
\Bigg[Sum \ of \ all \Big(instruction \ type * (cycles taken )/(instruction) \Big) \Bigg] * cycle \ time

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

answered
User Fabio Vitale
by
8.3k points
Welcome to Qamnty — a place to ask, share, and grow together. Join our community and get real answers from real people.