• retagged by
1,801 views
1 1 vote
add \$so,\$to,\$t1

sub \$t2,\$S0,\$t3  

Num of stall cyles i am getting 2 stall but the books says 3

1.No data data forwarding

2.Write to register file in first half and read from second half in clock cycle  my timing dig goes like this

add  IF ID EX MEM WB     

             NOP        

                   NOP           

                            IF ID  EXE .....

1 Answer

0 0 votes

This will be the timing diagram. Three stall cycles are needed to ensure WB is completed before the ID stage of the SUB instruction. This assumes Register File read is performed during the ID stage of the pipeline.

  Clk1 Clk2 Clk3 Clk4 Clk5 Clk6 Clk7 Clk8 Clk9
ADD IF ID EX MEM WB        
SUB   IF Stall Stall Stall ID EX MEM WB


        

Position:
Show:

Related questions

79 79 votes
11 answers 11 answers
34.1k
34.1k views
go_editor asked Sep 28, 2014
34,081 views
Consider a $6$-stage instruction pipeline, where all stages are perfectly balanced. Assume that there is no cycle-time overhead of pipelining. When an application is exec...
200 200 votes
9 answers 9 answers
79.3k
79.3k views
Kathleen asked Sep 22, 2014
79,251 views
A $5$ stage pipelined CPU has the following sequence of stages:IF – instruction fetch from instruction memoryRD – Instruction decode and register readEX – Execute: ALU op...
74 74 votes
4 answers 4 answers
36.1k
36.1k views
Kathleen asked Sep 12, 2014
36,052 views
Which of the following are NOT true in a pipelined processor?Bypassing can handle all RAW hazardsRegister renaming can eliminate all register carried WAR hazardsControl h...