he pipeline is a way to improve the performance of the processor by increasing the throughput. As you learned in the class, the instruction execution is divided to 5 stages: IF, ID, EX, WB, and MEM. At each stage the processor can pipeline more than one instruction so that they execute at the same cycle. Recall that some stage cannot be overlapped. For instance, you cannot issue to memory reads at the same stage. Write a program using your favorite programming language that reads assembly code like the following: LW $0, $1(20) –load instruction at address $1 + 20 and put the result in register $0. ADD $3, $0, $2 –add the content of register $0 to register $2 and store the outcome in register $3. Your program must simulate the pipeline by creating an execution schedule. The program must determine the dependencies between the instructions, if any, and stall the pipeline as necessary. The program must show the execution table including the stalls if any. Finally, the program must also output the number of cycles needed to execute the input program. To simplify matters, restrict the accepted instruction to only: ADD (add two values), LW (load from memory), SW (store a word in memory), SUB (subtract). IMPORTANT : THE CODE NEED TO ASK THE USER TO INPUT : LW $0, $1(20) AND ADD $3, $0, $2 AND THE OUT PUT NEED TO BE LIKE THIS: F DE EX MEM WB F S S DE MEM WB WRITE A PROGRAMMING LANGUAGE THAT IMPLEMENTS PIPELINE AND ASKS THE USER TO INPUT LW $0, $1(20) AND ADD $3, $0, $2 IN A WAY THAT THAT OUTPUT LOOKS LIKE THIS F DE EX MEM WB F S S DE MEM WB
he pipeline is a way to improve the performance of the processor by increasing the
throughput. As you learned in the class, the instruction execution is divided to 5
stages: IF, ID, EX, WB, and MEM. At each stage the processor can pipeline more
than one instruction so that they execute at the same cycle. Recall that some stage
cannot be overlapped. For instance, you cannot issue to memory reads at the same
stage.
Write a program using your favorite
like the following:
LW $0, $1(20) –load instruction at address $1 + 20 and put the result in register $0.
ADD $3, $0, $2 –add the content of register $0 to register $2 and store the outcome in
register $3.
Your program must simulate the pipeline by creating an execution schedule. The
program must determine the dependencies between the instructions, if any, and stall
the pipeline as necessary. The program must show the execution table including the
stalls if any. Finally, the program must also output the number of cycles needed to
execute the input program.
To simplify matters, restrict the accepted instruction to only: ADD (add two values),
LW (load from memory), SW (store a word in memory), SUB (subtract).
IMPORTANT : THE CODE NEED TO ASK THE USER TO INPUT : LW $0, $1(20) AND ADD $3, $0, $2
AND THE OUT PUT NEED TO BE LIKE THIS:
F DE EX MEM WB
F S S DE MEM WB
WRITE A PROGRAMMING LANGUAGE THAT IMPLEMENTS PIPELINE AND ASKS THE USER TO INPUT LW $0, $1(20) AND ADD $3, $0, $2 IN A WAY THAT THAT OUTPUT LOOKS LIKE THIS
F DE EX MEM WB
F S S DE MEM WB
![](/static/compass_v2/shared-icons/check-mark.png)
Step by step
Solved in 2 steps with 4 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Concepts of Database Management](https://www.bartleby.com/isbn_cover_images/9781337093422/9781337093422_smallCoverImage.gif)
![Prelude to Programming](https://www.bartleby.com/isbn_cover_images/9780133750423/9780133750423_smallCoverImage.jpg)
![Sc Business Data Communications and Networking, T…](https://www.bartleby.com/isbn_cover_images/9781119368830/9781119368830_smallCoverImage.gif)