3,536 views
2 votes
2 votes
The instruction pipeline of RISC processor has 200 instructions in which 100 are performing addition, 25 performing division and 75 are performing multiplications, where Excution state for addition take 1 clock cycle, multiplication take 3 clock cycles and division take 5 clock cycles. Assume pipeline has 5 stages IF, ID, EX, MA and WB and their is no data and control hazard. The number of clock cycles required for execution of sequence of instructions are ________.

Ans. 454

3 Answers

2 votes
2 votes

Ok let me explain...

Here, we go by sequence...

  1. Now let's take 100 instructions, if you have drawn pipeline, then you know, very first instruction take all cycles then all consecutive instruction will be completed in every clock cycle so total cycles required by 100 instruction is =

                                           99*1 + 5(no. of pipeline stages)= 104
     
  2. Now then take division instructions which are total 25, now as in above point, consecutive instruction will be completed in every clock cycle from now onwards but this instructions take 5 more cycles so

                                          25*5=125
     
  3. Then take 75 multiplication instructions which take 3 more cycles, so

                                           75*3= 225

So total cycles needed is= 104+125+225 = 454

0 votes
0 votes

Case 1: Number of the clock Cycle 200 instruction In Normal case

     =  5*1 + 199 * 1 (CPI = 1).

   =  5 + 199 = 204.

Case 2 : For Execution Phase

100 instruction takes 1 cycles i.e. these instructions suffering from 0 stall cycle,
25 instruction takes 3 cycles i.e. these instructions suffering from 2 stall cycle,
75 instruction takes 5 cycles i.e. these instructions suffering from 4 stall cycle,

So, extra cycle would be = 100*0 + 25*2+ 75*4 = 350 Cycles.

 

Total cycles =  204 + 350 = 554 Cycles.

0 votes
0 votes

Addition =100 and 1 clock

Division=25 and 5 clock

Multiplication=75 and 3 clock

 

Total time = 100×1+ 25×5 + 75×3 + 2+2=100+125+225+4=554

Example

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

IF

ID

EX

M

W

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

IF

ID

EX

M

W

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

IF

ID

EX

M

W

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

IF

ID

EX

EX

EX

M

W

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

IF

ID

EX

EX

EX

M

W

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

IF

ID

EX

EX

EX

M

W

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

IF

ID

EX

EX

EX

EX

EX

M

W

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Total time= 2+ 3×1 + 3×3 + 1×5 + 2

                =2+3+9+5+2

                =21

Related questions

6.1k
views
3 answers
2 votes
sh!va asked Jan 30, 2017
6,133 views
An instruction pipeline has five stages with stage latencies 1 ns, 2ns, 5 ns, 2ns, and 0.5 ns, respectively. A program has 10% branch instructions ... pointer at the end of the fourth stage.Calculate the average instruction execution time:
378
views
0 answers
1 votes
Harsh Kumar asked Oct 2, 2018
378 views
The pipeline performance is reduced if the different stages of a pipeline have different delaysI know that in the pipeline, Tclock is taken as the Max( ... the different stages of the pipeline will affect the performance. Please explain ?
3.6k
views
3 answers
3 votes
shivanisrivarshini asked Jun 4, 2016
3,624 views
Consider a non- pipelined machine with 10 ns clock cycle. It uses 4 cycles for ALU operations and branches and 5 cycles for memory operations. Assume ... clock. How much speed in instruction execution rate will we gain from pipelining?
683
views
1 answers
0 votes
kathan Mistry asked Aug 9, 2022
683 views
In a pipelined architecture Static branch prediction is used with branch taken assumption. Assume that 30% of the instructions executed for a program are branch ... Execution time(in nsec) if 80 % of the instructions are taken?