



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




CS333: Computer Architecture – Spring 2008 Homework 2 Total Points: 38 Points (undergrad), 46 Points (graduate) Due Date: Feb. 14, 2008 by 2:00 pm (See course information handout for more details on late submissions) Directions:
Branch 1: Step Branch 1 Prediction Actual Branch 1 Action 1 N T 2 3 4 5 6 7 8 Branch 2: Step Branch Prediction Actual Branch 2 Action 1 N T 2 Part B [4 Points] Now assume that 4 bit saturation counters are used. When the processor starts to execute the above code, both counters contain value 7. What is the number of correct predictions? Use the following tables to record the prediction and action of each branch. The first entry is filled in for you. Branch 1: Step Counter Value Branch 1 Prediction Actual Branch 1 Action 1 0111 N T 2 3 4 5 6 7 8
Branch 2: Step Counter Value Branch 2 Prediction Actual Branch 2 Action 1 0111 N T 2 Part C: [4 points] Now assume that 2 level correlating predictors of the form (2,1) are used. When the processor starts to execute the above code, the outcome of the previous two branches is not taken (N). Also assume that the initial state of predictors of all branches is not taken (N). What is the number of correct predictions? Use the following table to record your steps. Record the "New State" of predictors in the form W/X/Y/Z where,
Problem 4 [4 points] Suppose we have a deeply pipelined processor for which we implement a branch target buffer (BTB) for conditional branches. Assume that the misprediction penalty is always 4 cycles and the buffer miss penalty is always 3 cycles. Assume 85% prediction accuracy and 20% frequency of conditional branches. What should the hit rate in the branch target buffer be for this processor to be faster than a processor that has a fixed 2 cycle branch penalty? (assume that the two processors are equivalent in every other respect.) Assume a base CPI of 1 when there are no conditional branch stalls. GRADUATE PROBLEM: Problem 5 (8 points) This problem concerns the implications of the reorder buffer size on performance. Consider a processor implementing Tomasulo’s algorithm with reservation stations and the reorder buffer scheme described in detail in the lecture notes. Assume infinite processor resources unless stated otherwise; e.g., infinite execution units and infinite reservation stations. Assume a perfect branch predictor and assume there are no data dependences in the instruction stream we are considering. Assume the maximum instruction fetch rate is 12 instructions per cycle. (The other stages in the pipeline have no constraints; e.g., the processor can decode an unbounded number of instructions per cycle.) Part (A): (2 points) Suppose all instructions take one cycle to execute and the processor has an infinite reorder buffer. What is the average instructions per cycle rate or IPC for this processor? Part (B): (2 points) Consider the system in part (a) except that now every 48th instruction is a load that misses in the cache and the miss latency is 500 cycles. What is the average instructions per cycle or IPC for this processor? Part (C): (4 points) Consider the system in part (b) except that now the reorder buffer size is 48 entries. What is the average IPC for this processor? If the IPC is less than 12, then what is the smallest reorder buffer size for which the IPC will be 12 again (assume the reorder buffer size can only be a multiple of 12).