Starting from:

$25

Homework 6 Link the object files above to form the executable file

Problem 1 [7 points]:

Link the object files above to form the executable file. Assume that Procedure A has a text size of 0x140, data size of 0x40 and Procedure B has a text size of 0x300 and data size of 0x50. Also assume r3 = 0x1000 0000, and the memory allocation strategy described in class.

2
Problem 2: [7 points] For the following, questions, assume for a given processor the CPI of arithmetic instructions is 1, the CPI of load/store instructions is 10, and the CPI of branch instructions is 3. Assume a program has the following instruction breakdowns: 500 million arithmetic instructions 300 million load/store instructions, 100 million branch instructions. a. Suppose that new, more powerful arithmetic instructions are added to the instruction set. On average, through the use of these more powerful arithmetic instructions, we can reduce the number of arithmetic instructions needed to execute a program by 25%, while increasing the clock cycle time by only 10%. Is this a good design choice? Why?
b. Suppose that we find a way to double the performance of arithmetic instructions. What is the overall speedup of our machine? What if we find a way to improve the performance of arithmetic instructions by 10 times?
Problem 3. [7 points] For the following questions, assume that for a given program 70% of the executed instructions are arithmetic, 10% are load/store, and 20% are branch.
a. Given this instruction mix and the assumption that an arithmetic instruction requires two cycles, a load/store instruction takes six cycles, and a branch instruction takes three cycles, find the average CPI.
b. 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?
c. For a 50% improvement in performance, how many cycles, on average, may an arithmetic instruction take if load/store and branch instructions are not improved at all? Problem 4. [4 points] Modify the following C code (from the midterm exam) so that the recursion is tail- recursion.
funct(int x) {
if (x <= 0) return 0; else if (x & 0x1) { return x + funct(x-1); } else { return x - funct(x-1);

More products