Unformatted text preview:

COSC 6385 Computer Architecture -Exercises Edgar Gabriel-Exercises Edgar GabrielSpring 2010Exercise (I)1. Given a code sequence1. LD R1, 50(R2)2. ADD R3, R1, R43. LD R5, 100(R3)COSC 6385 – Computer ArchitectureEdgar Gabriel4. MUL R6, R5, R75. S R6, 50(R2)6. ADD R1, R1, #1007. SUB R2, R2, #8Exercises (II)a) Find all dependencies in the code segment and list them by category (data dependence, output dependence, anti-dependence and control dependencies)b) How many cycles does it take to execute this code segment without forwarding on the regular 5 stage MIPS pipeline, assuming that we have dual-ported memory? Indicate the number of stall cycles.COSC 6385 – Computer ArchitectureEdgar Gabrielcycles.c) Instead of the 5 stage MIPS pipeline, assume that we have a 7 stage pipeline consisting of the following stages: IF ID ALU1 MEM1 MEM2 ALU2 WB ALU1 is used for effective address calculation for loads, stores and branches. ALU2 is used for other calculation and for branch resolution. Because we have a slow memory unit, access to memory is pipelined through two stages (MEM1 and MEM2)Exercises (III)I. How many cycles does it take to execute the code segment on this pipeline? II. How large is the branch penalty for this pipeline?COSC 6385 – Computer ArchitectureEdgar GabrielExercises (IV)3. Given a code segmentDADD R1, R0, R0 DADD R2, R0, R0 DADD R3, R0, R0DADDI R4, R0, #5 Loop: BEQ R3, R4, Done /* Branch b1*/BNEZ R1, Ilf2 /* Branch b2 */DADDIR2, R0, #1COSC 6385 – Computer ArchitectureEdgar GabrielDADDIR2, R0, #1DADDI R1, R0, #2Ilf2: BNEZ R2, End /* Branch b3 */DADDI R1, R0, #1DADDI R2, R0, #2End: DADDI R1, R1, #-1DADDI R2, R2, #-1DADDI R3, R3, #1J LoopDone: …Exercises (V)a) Use a 2-bit local predictor for branch b1. Show how the predictor state changes. Assume the initial state is 10b) Use a (1,1) correlating branch predictor for the branches b2 and b3. Show how the predictors state COSC 6385 – Computer ArchitectureEdgar Gabrielbranches b2 and b3. Show how the predictors state changes. Assume, that all initial states are NT.c) Use a (1,2) correlating branch predictor for the branches b2 and b3. Assume, that all initial states are NT.d) Use a (1,1) correlating branch predictor for the branches b1, b2 and b3. Show how the predictors state changes. Assume, that all initial states are


View Full Document

UH COSC 6385 - COSC 6385 Exercises

Download COSC 6385 Exercises
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view COSC 6385 Exercises and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view COSC 6385 Exercises 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?