During the execution of the above code, how many instru

Assignment Help C/C++ Programming
Reference no: EM13162701

1. Consider the following assembly code for parts 1 and 2.

 

r1 = 99 Loop:

r1 = r1 - 1

 

if r1 > 0, goto Loop

 

halt

 

(a) During the execution of the above code, how many instructions are executed?

 

(b) Assuming a standard unicycle machine (CPI = 1) running at 100 KHz, how long will the above code take to complete?

3.              Add comments to the following MIPS code and describe in one sentence what it computes. Assume that $a0 and $a1 are used for the input and both initially contain the integers a and b, respectively. Assume that $v0 is used for the output.

Can you re-write the code with less number of instructions? If yes, write the new code.

add $t0, $zero, $zero

loop:     finish:  

beq $a1, $zero, finish add $t0, $t0, $a0 addi $a1, $a1, -1 j loop addi $t0, $t0, 100 add $v0, $t0, $zero

 

 

Reference no: EM13162701

Questions Cloud

Wish to represent an n-vertex graph : Suppose we wish to represent an n-vertex graph G using the edge list structure, assuming we identify the vertices with the integers in the set {0,1,...,n?1}.
State diagram to recognize one form : Design a state diagram to recognize one form of the comments of the C-based programming languages, those that begin with /* and end with */. and also Write and test the code to implement the state diagram.
What is the public interface of the counter class : what is the public interface of the counter class in section instance variables and encapsulation? How does it differ from the implementation of the class?
How does it differ from the implementation of the class? : what is the public interface of the counter class in section instance variables and encapsulation?
During the execution of the above code, how many instru : (a) During the execution of the above code, how many instructions are executed? (b) Assuming a standard unicycle machine (CPI = 1) running at 100 KHz, how long will the above code take to complete?
Create an application user to enter the following employee : Create an application that allows the user to enter the following employee data: First Name, Middle Name, Last Name, Employee Number, Department, Telephone Number, Telephone Extension, and E- mail Address. The valid selections for depart-ment are Acc..
Control that programmee with key : Please control that programmee with key (left ,right ,up and down ) and also make a chain of snake when eat egg,and game over when snake strike with hurdel.
We wish to process survey results : Suppose we wish to process survey results that are stored in a file. This exercise requires twoseparate programs. First, create a program that prompts the user for survey responses and outputseach response to a file
Given a 3 millisecond seek time : Given a 3 millisecond seek time for a disk drive and assuming that once you reach the starting track you will write the file as contiguous sectors, how long will it take to write a 1 megabyte file? The disk rotates at 7200 rpm and each sector hold 1 ..

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Implement database having array of pointers

One way to implement this database is to have an array of pointers pointing to Employee objects. You will obviously require a function named Calculate_salary() which will be different for each employee class. Write code in c++

  You will create a linked list module

You will create a linked list module that exactly meets the specifications given in the supplied header (.h) file. The playlist program must accept a filename on the command line (argv).

  Stores a series of numbers in a binary tree.

Queue Converter, Write a program that stores a series of numbers in a binary tree. Then have the program insert the values into a queue in ascending order. Dequeue the values and display them on the screen to confirm that they were stored in the prop..

  Principle ofsuperposition to determine that system is linear

Apply the principle of superposition to determine whether the following systems are linear. Sketch what the plot of the function looks like.

  Demonstrate the construction and output of an array

In fluid mechanics, the Reynolds number (Re) is a dimensionless quantity that is used to help predict similar flow patterns in different fluid flow situations. For example, Reynolds numbers can be computed for different velocities of fluid flow over ..

  Write a function that will take in an array of integers

Write a function that will take in an array of integers, sum up all the values in the array, and return the result to the calling function.

  Initialize an array and fill the array with the gpa values.

Write a program in java that asks user input (using a loop) for name of 10 student and the corresponding grade point averages (GPAs). Initialize an array and fill the array with the GPA values.

  Grocery store program

This program draws upon several concepts that were covered in CptS 121 and should serve as a good refresher for CptS 122. Our store, Cougar Mart, maintains its inventory in a text file. Not being very tech savvy, the owner of Cougar Mart needs you to..

  Use the top-down modular approach to design program

Use the top-down modular approach and pseudocode to design a suitable program to solve it. Where appropriate, use defensive programming techniques.

  Write function that randomly produces maze

Write a function mazeGenerator that randomly produces a maze (in C++). The Function should take as arguments a two-dimensional 12-by-12 character array.

  Perform operations on arrays

Perform operations on arrays execute tests and repetitions

  Determine order in which constructors of class will execute

Suppose that an object of class three enters its scope, so the constructors of theses classes will execute. Determine the order in which the constructors of these classes will execute.

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