Question

Consider a standard 5-stage MIPS pipeline of the type discussed during the class sessions: IF-
ID-EX-M-WB.

Assume that forwarding is not implemented and only the hazard detection and stall logic is
implemented so that all data dependencies are handled by having the pipeline stall until the
register fetch will result in the correct data being fetched.
Furthermore, assume that the memory is written/updated in the first half of the clock cycle
(i.e. on the rising edge of the clock) and is accessed for reading in the second half (i.e. on the
falling edge of the clock)


(a) How many stalls will be inserted during the execution of following sequence of instructions?
Justify your answer by providing a complete execution trace of instructions using a figure
similar to the one given at page # 381 (fig 6.8) of your book.
add r1, r2, r3
add r4, r1, r5
add r1, r2, r3
sw r1, 42(r8)
lw r1, 10(r7)
add r11, r1, r9

(b) Next assume that the register file has only one read port and hence we need to modify the
pipeline by adding one additional stage IF-ID-REG2-EX-M-WB into it. Description of various
pipeline stages is as follows

STAGE IF ID REG2 DESCRIPTION instruction is fetched from memory into the CPU control signals are generated and first operand

Making the same assumptions as given at the beginning of the question repeat the part a for
this pipeline implementation

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Please give thumbs up if you like the work

Iy - Iz T I - M/9 Prozot Med si aroy bette->Te -beti!TTA ppo. [te+01] → Te -(+130174 m Te[2n +813W --(80ch TANTS. #retret

Step 2 :- (a)Let every stage takes 1 cycles in 5 stage pipeline

IF------------Instruction Fetch

ID------------Instruction Decode

EX-----------Execution

MA-----------Memory Access

WB----------Write Back

IF ID EX MA WB
I1 1cycle 1cycle 1cycle 1cycle 1cycle
I2 1cycle 1cycle 1cycle 1cycle 1cycle
I3 1cycle 1cycle 1cycle 1cycle 1cycle
I4 1cycle 1cycle 1cycle 1cycle 1cycle
I5 1cycle 1cycle 1cycle 1cycle 1cycle
I6 1cycle 1cycle 1cycle 1cycle 1cycle

Steps Pipeline Stoucture 6 2 3 4 IF IDI EX MALL 7 19 110 111 112 13.114 IL 12 IF ID LEXMA WB Iz IF DEX MA LUB 14 LEID EXMA WB

Step 4 :- (b) Let every stage takes 1 cycles in 6 stage pipeline

IF------------Instruction Fetch

ID------------Instruction Decode

REG2-------Additional Stage For 2nd operand

EX-----------Execution

MA-----------Memory Access

WB----------Write Back

IF ID REG2 EX MA WB
I1 1cycle 1cycle 1cycle 1cycle 1cycle 1cycle
I2 1cycle 1cycle 1cycle 1cycle 1cycle 1cycle
I3 1cycle 1cycle 1cycle 1cycle 1cycle 1cycle
I4 1cycle 1cycle 1cycle 1cycle 1cycle 1cycle
I5 1cycle 1cycle 1cycle 1cycle 1cycle 1cycle
I6 1cycle 1cycle 1cycle 1cycle 1cycle 1cycle

Stepsib Pipeline with 6 stages I 5 13 Iy Ig 공 1 3 4 5 5 6 IF ID REG2 EX MA WB 7 8 9 10 IF IDD REG2 Ex MA WB IF ID REG2 EX MA

Add a comment
Know the answer?
Add Answer to:
Consider a standard 5-stage MIPS pipeline of the type discussed during the class sessions: IF- ID-EX-M-WB....
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • c. The classic five-stage pipeline MIPS architecture is used to execute the code fragments. Assume the...

    c. The classic five-stage pipeline MIPS architecture is used to execute the code fragments. Assume the followings: Register write is done in the first half of the clock cycle; register read is performed in the second half of the clock cycle, Branches are resolved in the second stage of the pipeline and the architecture does not utilize any branch prediction mechanism Forwarding is fully supported Clock Cycle à 1 2 3 4 5 6 7 8 9 10 11 12...

  • The datapath for 5-stage MIPS pipelined architecture is given below. IFAID ID/EX EX/MEM MEM/WB > Add...

    The datapath for 5-stage MIPS pipelined architecture is given below. IFAID ID/EX EX/MEM MEM/WB > Add Add Add result Shift left 2 Lo-o PC Address Read register 1 Read Read data Instruction memory register Registers Read SALU Zero ALU result Read Address data data 2 Write register Write data Data memory Write data 16 Sign- extend Choose all the components that generate a useful result during the execution of the following instruction: ADD R1, R2, R3 O 1. Program Counter...

  • The classic five-stage pipeline MIPS architecture is used to execute the code fragments in this problem....

    The classic five-stage pipeline MIPS architecture is used to execute the code fragments in this problem. Assume the followings: The architecture fully supports forwarding, Register write is done in the first half of the clock cycle; register read is performed in the second half of the clock cycle, Branches are resolved in the third stage of the pipeline and the architecture does not utilize any branch prediction mechanism, Register R4 is initially 100. L1:  lw    R1, 0(R4)   add   R3, R1, R2 sw   ...

  • The datapath for 5-stage MIPS pipelined architecture is given below. IF/D ID/EX EX/MEM MEM/WB >Add Add...

    The datapath for 5-stage MIPS pipelined architecture is given below. IF/D ID/EX EX/MEM MEM/WB >Add Add Add result Shift left 2 Address Instruction memory Read Read register 1 data Read register "Registers Read Write data 2 register Write data SALU ALU result Address Read data Data memory Write data 16 Sign- 32 extend Choose all the components that generate a useful result during the execution of the following instruction: Choose all the components that generate a useful result during the...

  • The latencies of individual stages in five-stage MIPS (Microprocessor without Interlocked Pipeline Stages) Architecture are given...

    The latencies of individual stages in five-stage MIPS (Microprocessor without Interlocked Pipeline Stages) Architecture are given below. Instruction Instruction Fetch Register Read Arithmetic Logic Unit (ALU) Memory Access Register Write Latency 200ps 100ps 200ps 300ps 100ps a. (10 pts) What is the clock cycle time in a pipelined and non-pipelined processor? Pipelined version : ______________ Non-pipelined version : ______________ b. The classic five-stage pipeline MIPS architecture is used to execute the code fragments. Assume the followings: Register write is done...

  • The classic five-stage pipeline MIPS architecture is used to execute the code fragments in this problem....

    The classic five-stage pipeline MIPS architecture is used to execute the code fragments in this problem. Assume the followings: • The architecture fully supports forwarding, • Register write is done in the first half of the clock cycle; register read is performed in the second half of the clock cycle, • Branches are resolved in the third stage of the pipeline and the architecture does not utilize any branch prediction mechanism, • Register R4 is initially 200. L1: lw lw...

  • A 5-Stage pipeline is composed of the following stages Instruction Fetch (IF), Decode (DE), Execute (EX), Memory Access...

    A 5-Stage pipeline is composed of the following stages Instruction Fetch (IF), Decode (DE), Execute (EX), Memory Access (ME) and Register Write-back (WB). Assume the pipeline does not have a branch prediction unit, does not have superscalar support and does not support out of order execution. Assume that all memory accesses are in the L1 cache and therefore do not introduce any stalls. Show a pipeline diagram that shows the execution of each stage for the assembly code below. Also...

  • help Question 11 The classic five-stage pipeline MIPS architecture is used to execute the code fragments...

    help Question 11 The classic five-stage pipeline MIPS architecture is used to execute the code fragments in this problem. Assume the followings: • The architecture fully supports forwarding, • Register write is done in the first half of the clock cycle; register read is performed in the second half of the clock cycle, • Branches are resolved in the third stage of the pipeline and the architecture does not utilize any branch prediction mechanism, • Register R4 is initially 200....

  • The classic five-stage pipeline MIPS architecture is used to execute the code fragments in this problem....

    The classic five-stage pipeline MIPS architecture is used to execute the code fragments in this problem. Assume the followings: • The architecture fully supports forwarding, • Register write is done in the first half of the clock cycle; register read is performed in the second half of the clock cycle, • Branches are resolved in the third stage of the pipeline and the architecture does not utilize any branch prediction mechanism, • Register R4 is initially 100. L1: lw add...

  • he classic five-stage pipeline MIPS architecture is used to execute the code fragments in this problem....

    he classic five-stage pipeline MIPS architecture is used to execute the code fragments in this problem. Assume the followings: The architecture fully supports forwarding, • Register write is done in the first half of the clock cycle; register read is performed in the second half of the clock cycle, • Branches are resolved in the third stage of the pipeline and the architecture does not utilize any branch prediction mechanism, • Register R4 is initially 100. Ll: lw add SW...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT