There are 200 instructions

Dark Mode

147 views

1 vote

The instruction pipeline of RISC processor has 200 instruction in which 100 are performing addition, 25 performing division and 75 are performing multiplication, where Execution state for addition take 1 clock, 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 instruction are ________.

my ans is 354 where iam wrong.

approch totel 200 in which (100 add having 1 cc) +(25*5-1) +(75*(3-1))=354

my ans is 354 where iam wrong.

approch totel 200 in which (100 add having 1 cc) +(25*5-1) +(75*(3-1))=354

0 votes

Best answer

Lets consider that every instruction takes one cycle for execution .

As there are 200 instructions and 5 stages so (k+n-1) clock cycles for the execution = 5+200-1 = 204 CC.

Now consider the fact that it requires 5 clock cycles for division and 3 clock cycles for multiplication . there are extra 4 clock cycles due to division and 2 clock cycles due to multiplication .

Hence there are 25*4 = 100 stall cycles due to Division and 75*2 = 150 stall cycles due to mutiplication.

Total Cycles = 204+100+150 = 454 .

As there are 200 instructions and 5 stages so (k+n-1) clock cycles for the execution = 5+200-1 = 204 CC.

Now consider the fact that it requires 5 clock cycles for division and 3 clock cycles for multiplication . there are extra 4 clock cycles due to division and 2 clock cycles due to multiplication .

Hence there are 25*4 = 100 stall cycles due to Division and 75*2 = 150 stall cycles due to mutiplication.

Total Cycles = 204+100+150 = 454 .