Question

In: Computer Science

assume the following instruction frequencies/composition in the program: load (lw) 22% sub / compare 21% conditional...

assume the following instruction frequencies/composition in the

program:

load (lw) 22%

sub / compare 21%

conditional branch 20%

store (sw) 12%

add / move 12%

and 6%

4.

How long would it take to run a 100 instruction program on a single cycle datapath architecture, assuming a cycle time of 50ns?

(14)

5.

How long would it take to run the same 100 instruction program on a multi-cycle datapath architecture, assuming a cycle time of 8ns. Further assume that “lw” takes 6 cycles, “sw” takes 4 cycles, and all other instructions take 3 cycles to execute.
(14)

Solutions

Expert Solution

Total number of cycles needed to run a program will be equal to sum of product of number of instructions of each type and number of cycles needed to execute the instruction of that type.

4. In a single cycle datapath where every instruction will take only one cycle to execute, then since there are 100 instructions, therefore it will take 100*1 = 100 cycles to execute all the instructions.

Since cycle time is 50 ns, therefore time taken to execute all instructions = 100*50 ns = 5000 ns

5. Here "lw" instructions are total 22 in number where each of them takes 6 cycles, then "sw" instructions are total 12 in number and each takes 4 cycles. Remaining instructions are 100 - 22- 12 = 66 in number where each takes 3 cycles.

Hence total number of cycles needed to execute the program = 22*6 + 12*4 + 66*3 = 378 cycles.

Since cycle time is 8 ns, hence total time to execute = 378*8 ns = 3024 cycles.

Please comment for any clarification.


Related Solutions

Assume that for a given program 70% of the executed instruction are arithmetic, 10% are load/store,...
Assume that for a given program 70% of the executed instruction are arithmetic, 10% are load/store, and 20% are branch. i. Given the instruction mix and the assumption that an arithmetic instruction requires 2 cycles, a load/store instruction takes 6 cycles, and a branch instruction takes 3 cycles, ?nd the average CPI. ii. For a 25% improvement in performance, how many cycles, on average, may an arithmetic instruction take if load/store and branch instructions are not improved at all.
1). Assume that, for a program Pro, compiler A and B both generate 1.0E9 instructions (instruction...
1). Assume that, for a program Pro, compiler A and B both generate 1.0E9 instructions (instruction count=1.0E9). CPI_A= 1 and CPI_B=2 The processor A has a clock cycle time of 1 ns. And the processor B has a clock cycle time 2 ns. A).To execute the same program Pro, which processor is faster and by how much? B). To improve the slower processor in problem 1a, what can you do? (list all possible solutions)
For the following data set, 5, 9, 12, 15, 19, 21, 22, 22, 24, 26, 27,...
For the following data set, 5, 9, 12, 15, 19, 21, 22, 22, 24, 26, 27, 27, 31, 33, 33, 34, 37, 38, 60, 70 a) Find the quartiles Q1 Q2 Q3 b) Find the five number summary c) Find the interquartile range (IQR) IQR = d) Find the lower limit LL = e) Find the upper limit UL = f) Identify the potential outliers (Separate each outlier with a comma. Write NPO if there is no potential outlier) The...
Write a possible assembly language instruction or set of instructions to accomplish the following: a) Compare...
Write a possible assembly language instruction or set of instructions to accomplish the following: a) Compare the byte stored at the memory location pointed to by register R4 to the upper (higher) byte stored in register R5 b) Branch to instruction at label ‘ZERO’ if the lower byte of register R6 is zero c) Jump to the instruction at label ‘EVEN’ if the value in register R7 is an even number
Consider the following sample data: x 21 22 25 28 24 y 15 22 26 28...
Consider the following sample data: x 21 22 25 28 24 y 15 22 26 28 29 a. Calculate the covariance between the variables. (Negative value should be indicated by a minus sign. Round your intermediate calculations to at least 4 decimal places and final answer to 2 decimal places.) b. Calculate the correlation coefficient. (Round your intermediate calculations to 4 decimal places and final answer to 2 decimal places.)
Write a Java Program using the following instruction: Create the following 3 methods that calculate and...
Write a Java Program using the following instruction: Create the following 3 methods that calculate and display the sum or product of the integers from 1 to the number input. getNum Receives no input. Prompts the user to enter a number, use a loop to validate. Returns the result. calcSum Receives an integer as input. Calculates the sum of the integers from 1 to this number. Returns the result. calcProd Receives an integer as input. Calculates the product of the...
INSTRUCTION: Use “OptAll” program for the following questions. When you open “OptAll” program, be sure you...
INSTRUCTION: Use “OptAll” program for the following questions. When you open “OptAll” program, be sure you enable macro. The tabs of the worksheets indicate the corresponding option pricing models or exotic options. As demonstrated in the past two classes, the “OptAll” program is fairly straight forward to use. Enter the required inputs and the results will be automatically calculated. We have studied these options in Module 3. You may (and should) apply the “OptAll” program to the previous Module 3...
---------------------------------------------------------------------------------------------------------------- C++ //code a program for the following the given Instruction. Geometry Calculator 1. Calculate the...
---------------------------------------------------------------------------------------------------------------- C++ //code a program for the following the given Instruction. Geometry Calculator 1. Calculate the Area of a Circle 2. Calculate the Area of a Rectangle 3. Calculate the Area of a Triangle 4. Quit Enter your choice (1-4): If the user enters 1, the program should ask for the radius of the circle and then display its area. Use 3.14159 for pi. #03   If the user enters 2, the program should ask for the length and width of...
The following is a list of 29 Nascar racers, arranged in descending order. 18, 21, 22,...
The following is a list of 29 Nascar racers, arranged in descending order. 18, 21, 22, 25, 26, 27, 29, 30, 31, 33, 36, 37, 41, 42, 47, 52, 55, 57, 58, 62, 64, 67, 69, 71, 72, 73, 74, 76,77 -Find the % for the data value 74. -Find the % for the data value 30 -Calculate the 44th percentile -Calculate the 7th percentile
Purpose: Experiment the interactive mode with php Instruction: Implement the following two different requirements and compare...
Purpose: Experiment the interactive mode with php Instruction: Implement the following two different requirements and compare the results: Implementation 1: Create a html file (login.html) with a login form that contains two labels, two text boxes and one submit button as follows: User Name: ______________ Password: _______________ submit When a user enters values for user name and password text boxes and clicks the submit button, the values are sent to login_handle.php and the values are assigned to two variables: $username...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT