Consider the following loop. LOOP: ld $s0, 0($s3) ld $s1, 8($s3) add $s2, $s0, $s1 addi $s3,

Question:

Consider the following loop.

LOOP: ld $s0, 0($s3)

ld $s1, 8($s3)

add $s2, $s0, $s1 

addi $s3, $s3, -16 

bnez $s2, LOOP

Assume that perfect branch prediction is used (no stalls due to control hazards), that there are no delay slots, that the pipeline has full forwarding support, and that branches are resolved in the EX (as opposed to the ID) stage.

1. Show a pipeline execution diagram for the first two iterations of this loop.

2. Mark pipeline stages that do not perform useful work. How often while the pipeline is full do we have a cycle in which all five pipeline stages are doing useful work? (Begin with the cycle during which the addi is in the IF stage. End with the cycle during which the bnez is in the IF stage.)

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: