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

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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