# hw5_sol - CDA 3101 Assignment 5 Due in class on Friday,...

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

Due in class on Friday, Nov.6 Turn hardcopy in class, stapled, with your name and “CDA 3101 Assignment 5” clearly written on it. Assignments submitted after Nov. 6, 12:35 pm but before Nov. 9, 12:35 pm will be considered one day late. 1. (7 points) Consider the following MIPS assembly language code. bzero: beq \$a1, \$zero, end loop: sb \$zero, 0(\$a0) addi \$a0, \$a0, 1 addi \$a1, \$a1, -1 bne \$a1, \$zero, loop end: jr \$ra Given a 2GHz processor with the CPI’s in the table below, what would be the exact CPU time of this function if the initial value of \$a1= 3 ? Instruction Type CPI Arithmetic (add, sub, addi) 3 Memory (load, store) 5 Control (branches and jumps) 4 53 × (1 / (2×10 9 )) = 26.5 × 10 -9 seconds 2. (5 points) Suppose a computer runs at 2GHz. If this computer runs an MPEG-4 video encoder that takes 1 billion instructions and has the following distribution of instructions. 20% Floating point CPI = 3 10% Integer CPI = 1 30% Load CPI = 2 20% Store CPI = 1 15% Branches CPI = 4 5% Other CPI = 1.5 a. What is the effective or average CPI for this video encoder? 0.2 × 3 + 0.1 × 1 + 0.3 × 2 + 0.2 × 1+ 0.15 × 4 + 0.05 × 1.5 = 2.175 CPI b. How long does it take the encoder to execute? 10

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/29/2010 for the course CDA 3101 taught by Professor Small during the Spring '08 term at University of Florida.

### Page1 / 4

hw5_sol - CDA 3101 Assignment 5 Due in class on Friday,...

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

View Full Document
Ask a homework question - tutors are online