InClassActivity13-sol

# InClassActivity13-sol - 3/6/03 11:47 AM Activity #13...

This preview shows pages 1–2. Sign up to view the full content.

3/6/03 11:47 AM ECSE-2660 Computer Architecture, Networks, & Operating Systems, Spring 2003 Page 1 of 4 Activity #13 (Solution) 3/6/2003 11:47 AM Activity 13.1 Branch prediction 1a. (15 points) Redo question 1(a) from Activity 12.1 (below) with the following changed assumptions: the CPU proceeds with branch instructions assuming that they are not taken Branches are actually taken 25% of the time. By a branch being “taken” we mean that the next instruction comes from the branch target, not (PC + 4). Improved hardware is used that reduces the branch penalty from 3 cycles to just 1 cycle. 75% of the conditional branches belong to loops, for which the CPU can predict correctly 80% of the time. The remaining 25% of the conditional branches are predicted correctly 70% of the time. Instruction Weight Cycles Weighted cycles Loads 0.15 Hazard 0.35 2 0.15 x 0.35 x 2 = 0.1050 No Hazard 0.65 1 0.15 x 0.65 x 1 = 0.0975 Stores 0.11 Hazard 0.40 2 0.11 x 0.40 x 2 = 0.0880 No Hazard 0.60 1 0.11 x 0.60 x 1 = 0.0660 R-type 0.50 1 0.50 x 1 = 0.5000 Jumps 0.09 3 0.09 x 3 = 0.2700 Conditional Branches 0.15 loops 0.75 predicted 0.80 1 0.15 x 0.75 x 0.80 x 1 0.0900 mispredicted 0.20 1+1=2 0.15 x 0.75 x 0.20 x 2 0.0450 non-loops 0.25 predicted 0.70 1 0.15 x 0.25 x 0.70 x 1 0.02625 mispredicted 0.30 1+1=2 0.15 x 0.25 x 0.30 x 2 0.0225 A v e r a g e C P I = 1 . 3 1 0 2 5 What matters is how often branches are predicted correctly, not how often they are taken. Grading: 5 off for wrong weighting, 3 points off for each new arithmetic error. 1(b). (5 points) Calculate the speed of the above machine in units of millions of instructions per second (MIPS). How much faster is it compared to the machine in question 1(a) of Activity 12.1? (1.31025 cycles/instruction x 1.5 ns/cycle)

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 04/25/2010 for the course ECSE ecse-2340 taught by Professor Wozny during the Spring '09 term at Rensselaer Polytechnic Institute.

### Page1 / 4

InClassActivity13-sol - 3/6/03 11:47 AM Activity #13...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online