Unformatted text preview:

1Edgar GabrielCOSC 6385 Computer Architecture - Exercises Edgar GabrielSpring 2011COSC 6385 – Computer ArchitectureEdgar GabrielExercise (I)1. Given a code sequence1. LD R1, 50(R2)2. ADD R3, R1, R43. LD R5, 100(R3)4. MUL R6, R5, R75. S R6, 50(R2)6. ADD R1, R1, #1007. SUB R2, R2, #82COSC 6385 – Computer ArchitectureEdgar GabrielExercises (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 Gabriel3COSC 6385 – Computer ArchitectureEdgar GabrielExercises (III)d) 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)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 Gabriel4COSC 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 */DADDI R2, 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: …COSC 6385 – Computer ArchitectureEdgar GabrielExercises (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 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 NT.5COSC 6385 – Computer ArchitectureEdgar GabrielFor part a)Predict taken11Predict taken10Predict not taken01Predict not taken00TakenTakenNot takenTakenNot takenNot takenTakenNot takenCOSC 6385 – Computer ArchitectureEdgar GabrielR1 R2 R3 R4 b1 act. b2 pred b2 act. R1 R2 b3 pred b3 act0 0 0 5 NT NT/NT NT 2 1 NT/NT T1 0 1 5 NT T 1 0 NT0 1 2 5 NT NT 2 1 T1 0 3 5 NT T 1 0 NT0 1 4 5 NT NT 2 1 T1 0 5 5 TFor part b)6COSC 6385 – Computer ArchitectureEdgar GabrielR1 R2 R3 R4 b1 act. b2 pred b2 act. R1 R2 b3 pred b3 act0 0 0 5 NT 00/00 NT 2 1 00/00 T1 0 1 5 NT T 1 0 NT0 1 2 5 NT NT 2 1 T1 0 3 5 NT T 1 0 NT0 1 4 5 NT NT 2 1 T1 0 5 5 TFor part


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?