Question

In: Computer Science

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)

Solutions

Expert Solution

Solution:

(1)

Given,

=>Compiler A: instruction count = 1*10^9, CPI_A = 1, clock cycle time = 1 ns

=>Compiler B: instruction count = 1*10^9, CPI_B = 2, clock cycle time = 2 ns

(a)

Explanation:

Calculating execution time of compiler A:

=>Execution time = instruction count*CPI*clock cycle time

=>Execution time = 1*10^9*1*1 ns

=>Execution time = 1*10^9*1*10^-9 sec as 1 ns = 10^-9 sec

=>Execution time = 1 sec

Calculating execution time of compiler B:

=>Execution time = instruction count*CPI*clock cycle time

=>Execution time = 1*10^9*2*2 ns

=>Execution time = 4*10^9*1*10^-9 sec as 1 ns = 10^-9 sec

=>Execution time = 4 sec

=>As execution time of compiler A is lesser so compiler A is faster.

Calculating speed up:

=>Speed up = execution time of compiler B/execution time of compiler A

=>Speed up = 4 sec/1 sec

=>Speed up = 4

=>As speed up = 4 so compiler A is 4 times faster than compiler B.

(b)

Explanation:

=>Slower processor = compiler B

Listing possible ways to improve solution:

=>We know that execution time = instruction count*CPI*clock cycle time

(i) As CPI decreases execution time also decreases so by decreasing the CPI of compiler B we can speed up compiler B.

(ii) As clock cycle time decreases execution time so by decreasing clock cycle time of compiler B we can speed up compiler B.

I have explained each and every part with the help of statements attached to the answer above.


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.
Write a Program using MPLAB IDE and XC8 compiler to do the followings: 1. When the...
Write a Program using MPLAB IDE and XC8 compiler to do the followings: 1. When the Program Starts it should send your Name and ID# to the Serial Port 2. Display the result on Tera Term. 3. Read PORTB buttons in an infinite loop (Main Loop which is the Read Buttons Loop), your program should not block when reading the Buttons except in De-bouncing.. But you need to de-bounce each button when pressed 3.1 If the user presses PORTB, RB0...
Example: A 3-address computer has 40 instructions, 16 Registers, and 256KB memory. Assume each instruction has...
Example: A 3-address computer has 40 instructions, 16 Registers, and 256KB memory. Assume each instruction has three operands. Two registers and the third operand is a direct address location of a memory. Find minimum size of PC, MAR, MDR, IR. Solution: OPCODE R1, R2, address OPCODE is 6 bits since 2^6>40 Register field is 4 bits since 2^4 =16 Memory field is 18 bits since 2^18=256K Instruction length =6+4+4+18=32 bits MDR=32 bits IR=32 bits MAR=18 PC=18 Please explain
Assume that the program counter (PC) is set to 0x00000000. Describe how each of the instructions...
Assume that the program counter (PC) is set to 0x00000000. Describe how each of the instructions below could be used to set the next value of PC to 0x0FFFFFF4 j, jr, bne, jal, beq
Assume a program requires the execution of 50 × 106 FP instructions, 110 × 106 INT...
Assume a program requires the execution of 50 × 106 FP instructions, 110 × 106 INT instructions, 80 × 106 L/S instructions, and 16 × 106 branch instructions. The CPI for each type of instruction is 1, 1, 4, and 2, respectively. Assume that the processor has a 2 GHz clock rate. a. Find the execution time? b. By how much must we improve the CPI of FP instructions if we want the program to run two times faster? c....
---------------------------------------------------------------------------------------------------------------- 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...
PART 1: Design a program (using only native MIPS instructions, no pseudo instructions) that will prompt...
PART 1: Design a program (using only native MIPS instructions, no pseudo instructions) that will prompt user to enter three decimal numbers. Each decimal number will not exceed six digits The program can't ask user how many digits will be entered. Both numbers must be stored in memory as NULL terminated strings. The first number must be stored at the memory address 0x10000000. The second number must be stored in the memory 0x10000008. The third number must be stored at...
Instructions: Write a program to calculate students’ average test scores and their grades. You may assume...
Instructions: Write a program to calculate students’ average test scores and their grades. You may assume the following input data: Johnson 85 83 77 91 76 Aniston 80 90 95 93 48 Cooper 78 81 11 90 73 Gupta 92 83 30 69 87 Blair 23 45 96 38 59 Clark 60 85 45 39 67 Kennedy 77 31 52 74 83 Bronson 93 94 89 77 97 Sunny 79 85 28 93 82 Smith 85 72 49 75 63...
Assume that there is a class named TestInterface that implements two interfaces A and B. Both...
Assume that there is a class named TestInterface that implements two interfaces A and B. Both the interfaces have a common method with the same signature (example int sampleMethod()). Explain how will the class define this method and how will the compiler identify, to which interface does this method belong to? Will the compiler give an error or will the program execute successfully. Give your code snippet to support your answer.
JAVA PROGRAM Write program that will prompt user generate two random integers with values from 1...
JAVA PROGRAM Write program that will prompt user generate two random integers with values from 1 to 10 then subtract the second integer from the first integer. Note, if the second integer is greater than the first integer, swap the two integers before making the subtraction.Then prompt user for the answer after the subtraction. If the answer is correct, display “Correct”otherwise display “Wrong”.You will need to do this in a loop FIVE times and keep a count of how many...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT