Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Assignment 2 Questions - Computer Organization | 0306 550, Assignments of Computer Architecture and Organization

Material Type: Assignment; Class: 0306 - Computer Organization; Subject: Computer Engineering; University: Rochester Institute of Technology; Term: Unknown 2009;

Typology: Assignments

2009/2010

Uploaded on 03/28/2010

koofers-user-k3c
koofers-user-k3c 🇺🇸

10 documents

1 / 3

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Page 1 of 3
Computer Organization (0306-550) - Winter 2009
Homework Assignment #2 - Due January 7
Show all intermediate steps clearly and legibly to obtain full credit.
1. Assume that the code given in question #10 of homework assignment #1 is run
on a CPU with a clock frequency of 2 GHz, that requires the following number of
cycles for each instruction.
Instruction Cycles
add, addi, sll 2
bne 3
lw 5
Ignoring the four instructions before the loops, how many seconds will it take to
execute this code in the worst case?
2. Consider two different CPU implementations of the same instruction set: CPU1
and CPU2. This instruction set has five classes (A, B, C, D, and E) of instructions
whose CPIs for each CPU are given in the table below. CPU1 has a clock rate of
2 GHz, and CPU2 has a clock rate of 2.5 GHz
Class CPI1CPI2
A 1 3
B 3 3
C 4 3
D 5 4
E 7 5
a. What are the peak MIPS ratings of CPU1 and CPU2 ?
b. If the number of instructions executed in a certain program is divided equally
among these instruction classes except for class A, which occurs five times as
often as each of the other classes, which CPU implementation is faster for this
program (i.e., CPU1 or CPU2), and by how much?
pf3

Partial preview of the text

Download Assignment 2 Questions - Computer Organization | 0306 550 and more Assignments Computer Architecture and Organization in PDF only on Docsity!

Page 1 of 3

Computer Organization (0306-550) - Winter 2009

Homework Assignment #2 - Due January 7

Show all intermediate steps clearly and legibly to obtain full credit.

  1. Assume that the code given in question #10 of homework assignment #1 is run on a CPU with a clock frequency of 2 GHz, that requires the following number of cycles for each instruction.

Instruction Cycles add, addi, sll 2 bne 3 lw 5

Ignoring the four instructions before the loops, how many seconds will it take to execute this code in the worst case?

  1. Consider two different CPU implementations of the same instruction set: CPU 1 and CPU 2. This instruction set has five classes (A, B, C, D, and E) of instructions whose CPIs for each CPU are given in the table below. CPU 1 has a clock rate of 2 GHz, and CPU 2 has a clock rate of 2.5 GHz

Class CPI 1 CPI (^2) A 1 3 B 3 3 C 4 3 D 5 4 E 7 5

a. What are the peak MIPS ratings of CPU 1 and CPU 2?

b. If the number of instructions executed in a certain program is divided equally among these instruction classes except for class A, which occurs five times as often as each of the other classes, which CPU implementation is faster for this program (i.e., CPU 1 or CPU 2 ), and by how much?

0306-550 Winter 2009 Homework Assignment #2 Page 2 of 3

  1. Consider two different implementations, CPU1 and CPU2, of the same instruction set, which has three classes of instructions (A, B, and C). CPU1 has a clock rate of 4 GHz, and CPU2 has a clock rate of 2 GHz. The average number of cycles in each instruction class on CPU1 and CPU2 is given in the table below. There are three compilers available for these CPUs: compiler C1 produced by the makers of CPU1, compiler C2 produced by the makers of CPU2, and compiler C produced by a third party. For a given program, each compiler produces the same number of instructions executed, but the instruction mix among the instruction classes differs as shown in the table.

Instruction Class

CPI on CPU

CPI on CPU

C1 Freq. (%)

C2 Freq. (%)

C3 Freq. (%) A 2 1 40.0 40.0 50. B 3 2 40.0 20.0 25. C 5 2 20.0 40.0 25.

Based on this information, answer the following questions.

a. Using C1 on both CPU1 and CPU2, which CPU is faster and by how much? b. Using C2 on both CPU1 and CPU2, which CPU is faster and by how much? c. Using C3 on both CPU1 and CPU2, which CPU is faster and by how much? d. For CPU1, which compiler is the best? e. For CPU2, which compiler is the best? f. Which CPU and compiler combination would you use if all other criteria are the same.

  1. Consider program P running on a 1-GHz machine M in 10 seconds. Someone optimizes P by replacing each of 4x10 8 instances of multiplying a value x by 2 (mult x , x ,2) each with a single add instruction (add x , x , x ) and by replacing all instances of multiplying by 4 (mult x , x ,4) each with a single shift instruction (sll x , x ,2). The optimized program P′ runs in 8 seconds on the same machine. If the CPI of mult is 6, the CPI of add is 2, and the CPI of sll is 1, how many multiplies by 4 were replaced with sll instructions by the optimization?