Write the mips-like assembly code for the given program

Assignment Help Computer Engineering
Reference no: EM131211542

Assignment-

(a) Write the MIPS-like assembly code for the following program segment to run on the 5-stage pipelined processor which you have developed.

sum=0;

for (i=0; i<=7; i=i+1)

{

sum = sum + x[i];

}

Convert that assembly code to machine language format, and execute them on the 5-stage pipelined processor which you have developed and Find the number of clock cycles and execution time to execute those machine instructions.

(b) Perform maximal loop unrolling as well as instruction reordering of the assembly code segment obtained for part (a). Convert that assembly code segment to machine language format, and run on the 5-stage pipelined processor to find the number of clock cycles and execution time.

(c) Compare the execution times found for part (a) and part (b), and explain the effect of loop-carried dependency on the execution time.

(d) Convert the assembly code in part (a) to machine language format and find the number of clock cycles and execution times to find sum of 4 arrays A, B, C, and D, where each of the arrays consists of 8 integer elements.

(e) Using loop fusion of the form given below and write another MIPS-like code for the program segment to run on the 5-stage pipelined processor which you have developed.

sum1=0; 

sum2=0; 

sum3=0; 

sum4=0;

for (i=0; i<=7; i=i+1)

{  

sum1 = sum1 + A[i];

sum2 = sum2 + B[i];

sum3 = sum3 + C[i];

sum4 = sum4 + D[i];  

}

Convert the assembly code to machine language format; perform necessary instruction reordering to minimize the pipeline stalls, execute them on the 5-stage pipelined processor, and find the number of clock cycles and execution time. 

(f) Compare the execution times found for part (d) and part (e). Explain the result.

CE/CZ 3001: Lab Project

For  the  rest  of  the  lab  work  after  Lab-3  you  are  required  to  do  a  project.  The project consists of 3 parts.  You are required to do coding and synthesis, and to demonstrate each part of the project. Write a project report to briefly describe the working of the design of each part. Report should also  include  the  timing  report and  the  waveform  generated  by  simulating  the  testbench  of  each  part  of  the project. For Part-3 you will be required to find the minimum execution time and the reduction in CPI which you achieve for the given program.

Project Part-1: Modify the 4-stage pipelined processor of Lab-3 to include BEQ, LW,  and  SW  instructions  and  convert  that  to  a  5-stage  pipelined  processor.

Project Part-2: Modify the processor designed in Part-1 of the project to include jump register (jr), jump (J), and jump & link (jal) instructions.

Project Part-3: Each group of students will be given a program which gets slowed due to pipeline stalls.  You are required to modify the program to remove the hazards so as to reduce the number of pipeline stalls. Finally, you will estimate the reduction in the CPI and execution time which you achieve.

PROJECT- GROUP REPORT FORMAT

Part 1

1. Provide the testbench screen shots for the execution of a program which involves LW, SW and BEQ instructions along with R & I instructions.

2. Explain the working of LW, SW, and BEQ instructions in the same program.

Part 2

1. Provide the testbench screen shots for the execution of a program involves J, JR, and JAL instructions along with R & I instructions and part 1 instructions.

2. Explain the working of J, JR, and JAL instructions in the same program.

Part 3

Section-1

1. Assembly code of the original program segment given in the assignment.

2. Machine code (The input to the Imem txt file)

3. Report the number of clock cycles taken for the execution of the program (where hazards are taken care of)

4. Execution time of the given program segment

Section- II

5. Modification of the given program segment (loop unrolling and loop fusion separately) as mentioned of the question.

a. Modified assembly code and Machine code (The input to the Imem txt file).

b. Report the number of clock cycles taken for the modified program segment (where hazards are taken care of).

c. Execution time of the modified code.

6. Speed up of modified code when compared to original code in Section-1

Bonus topics-

Any substantial improvement made in the hardware to improve the performance of the system.

a. Data forwarding

b. Control hazard removal

c. Cache implementation

Attachment:- Assignment.zip

Reference no: EM131211542

Questions Cloud

What is the instantaneous frequency : An MSK system has a carrier frequency of 10 MHz and transmits data at a rate of 50 kbps.
Describe the components of the selected financial statement : Describe the components of the selected financial statement. Explain how a company's growth is likely to impact this statement. Explain how this statement is related to the other two statements.
Use for shopping or researching items : 1. In what ways are the Internet and technology affecting people and businesses around the world? 2. What is causing the number and size of call centers in the United States to shrink? 3. Discuss one social media tool you use for shopping or research..
Write a short 250 word news story about your event. : You need to attend an event in your local area. This can be any event but you will need to ensure that it occurs within a time frame that allows you to meet the deadlines for this assessment.
Write the mips-like assembly code for the given program : Write the MIPS-like assembly code for the following program segment to run on the 5-stage pipelined processor which you have developed
Social media-promotions-advertising-marketing : In today's technological world, what should retailers do to bring customers into their stores and build customer loyalty? What marketing strategies such as social media, promotions, advertising, marketing, etc should they use to reach customers? E..
What do you notice about the price and the cost of debt : What do you notice about the price and the cost of debt? What is the cost of debt for Kenny Enterprises if the bond sells at the following prices?
Find and plot its periodic autocorrelation function : Consider a 15-bit, maximal-length PN code. It is generated by feeding back the last two stages of a fourstage shift register. Assuming a 1 1 1 1 initial state, find all the other possible states of the shift register (show details). What is the se..
Different from unstructured interviews : How are structured interviews different from unstructured interviews?

Reviews

Write a Review

Computer Engineering Questions & Answers

  How input from an html5 form is retrieved in a php program

Describe how input from an HTML5 form is retrieved in a PHP program.

  Create the following symbolic equations

Create the following symbolic equations.

  Design a combinational circuit with three inputs

Design a combinational circuit with three inputs, x, y, and z, and three outputs, A, B, and C. When the binary input is 0. I, 2. or 3. the binary output is one greater than the input.

  What are the parallel arrays

The memory address of the first array location is known as ?Java exception thrown if an array index is out of bounds.

  What is the role of statistical analysis in simulation

How do pseudo-random numbers affect an accuracy of a simulation.

  How to create a poster or presentation

For an on line poster presentation, you need to use PowerPoint, Visio, MS Word, or another program that allows you to use graphics and pictures along with words to tell a story. Posters are created to tell a visual story so the intent is to use le..

  Analyze the history of broadband and the emergence services

Analyze the history of broadband and the emergence of integrated services digital network (ISDN), Digital Subscriber Line (DSL), and digital mobile video broadcasts.

  Create a detailed diagram or set of diagrams to show how

there is a common misconception that analog technology is no longer used in the transmission of digital data. however

  Generating the printstream object

Generate a PrintStream object utilizing the dos and allocate the resulting reference to ps, a PrintStream variable which has already been declared.

  Describe some of the applications of stepper motors

Explain any errors you had and how you determined the errors and fixed them. Take a screenshot of the modified assembly codefor full stepping and half stepping mode

  Write an implementation of the set class

Write an implementation of the set class, with associated iterations using a binary search tree. Add to each node a link to the next smallest and next largest node.

  Explain what is meant by effective html code

Explain what is meant by effective HTML code. Decide if all HTML code should be the same (standardized) or at the discretion of the designer. Explain your decision.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd