• Wrong document? Swap it for free
  • Written by students who passed
  • Immediately available after payment
  • Read online or as PDF
Sell
Where do you study
Your language
Document preview thumbnail
Preview 2 out of 5 pages
Exam (elaborations)

Questions_and_answers_in_Computer_Arch_a

Document preview thumbnail
Preview 2 out of 5 pages

Chapter 1 Quiz Consider two different implementations, M1 and M2, of the same instruction set. There are three classes of instructions (A, B, and C) in the instruction set. M1 has a clock rate of 80 MHz and M2 has a clock rate of 100 MHz. The average number of cycles for each instruction class and their frequencies (for a typical program) are as follows: (a) Calculate the average CPI for each machine, M1, and M2. For Machine M1: Clocks per Instruction = (60/100)* 1 + (30/100)*2 + (10/100)*4 = 1.6 For Machine M2: Clocks per Instruction = (60/100)*2 + (30/100)*3 + (10/100)*4 = 2.5 (b) Calculate the average MIPS ratings for each machine, M1 and M2. For Machine M1: Average MIPS rating = Clock Rate/(CPI * 106) = (80 * 106) / (1.6*106) = 50.0 For Machine M2: Average MIPS rating = Clock Rate/(CPI * 106) = (100 * 106) / (2.5*106) = 40.0 (c) Which machine has a smaller MIPS rating ? Which individual instruction class CPI do you need to change, and by how much, to have this machine have the same or better performance as the machine with the higher MIPS rating (you can only change the CPI for one of the instruction classes on the slower machine)? Machine M2 has a smaller MIPS rating. If we change the CPI of instru

Content preview

Chapter 1 Quiz

Consider two different implementations, M1 and M2, of the same instruction set. There are three
classes of instructions (A, B, and C) in the instruction set. M1 has a clock rate of 80 MHz and
M2 has a clock rate of 100 MHz. The average number of cycles for each instruction class and
their frequencies (for a typical program) are as follows:




(a) Calculate the average CPI for each machine, M1, and M2.

For Machine M1:
Clocks per Instruction = (60/100)* 1 + (30/100)*2 + (10/100)*4
= 1.6
For Machine M2:
Clocks per Instruction = (60/100)*2 + (30/100)*3 + (10/100)*4
= 2.5

(b) Calculate the average MIPS ratings for each machine, M1 and M2.

For Machine M1:
Average MIPS rating = Clock Rate/(CPI * 106)
= (80 * 106) / (1.6*106)
= 50.0
For Machine M2:
Average MIPS rating = Clock Rate/(CPI * 106)
= (100 * 106) / (2.5*106)
= 40.0

(c) Which machine has a smaller MIPS rating ? Which individual instruction class CPI do you
need to change, and by how much, to have this machine have the same or better performance as
the machine with the higher MIPS rating (you can only change the CPI for one of the instruction
classes on the slower machine)?
Machine M2 has a smaller MIPS rating. If we change the CPI of instruction class A for Machine
M2 to 1, we can have a better MIPS rating than M1 as follows:
Clocks per Instruction = (60/100)*1 + (30/100)*3 + (10/100)*4 = 1.9
Average MIPS rating = Clock Rate/(CPI * 106) = (100 * 106) / (1.9*106) = 52.6

, 2. Suppose you have a machine which executes a program consisting of 50% floating point
multiply, 20% floating point divide, and the remaining 30% are from other instructions.

(a) Management wants the machine to run 4 times faster. You can make the divide run at most 3
times faster and the multiply run at most 8 times faster. Can you meet management’s goal by
making only one improvement, and which one?

Amdahl’s Law states:
Execution time after improvement =
(Execution time affected by improvement)/(Amount of Improvement) +
Execution time unaffected
Assuming initially that the floating point multiply, floating point divide and the other instructions
had
the same CPI,
Execution time after Improvement with Divide = (20)/3 + (50 + 30) = 86.67
Execution time after Improvement with Multiply = (50)/8 + (20 + 30) = 66.67
The management’s goal can be met by making the improvement with Multiply alone

3. Suppose that we can improve the floating point instruction performance of machine by a
factor of 15 (the same floating point instructions run 15 times faster on this new machine). What
percent of the instructions must be floating point to achieve a Speedup of at least 4?

We will use Amdahl’s Law again for this question.
Let x be percentage of floating point instructions. Since the speedup is 4, if the original program
executed in 100 cycles, the new program runs in 100/4 = 25 cycles.
(100)/4 = (x)/15 + (100 – x)
Solving for x, we get:
x = 80.36

The percent of floating point instructions need to be 80.36.

4. Computer A has an overall CPI of 1.3 and can be run at a clock rate of 600MHz.
Computer B has a CPI of 2.5 and can be run at a clock rate of 750 Mhz. We have a particular
program we wish to run. When compiled for computer A, this program has exactly 100,000
instructions. How many instructions would the program need to have when compiled for
Computer B, in order for the two computers to have exactly the same execution time for this
program

(CPUTime)A = (Instruction count)A * (CPI)A * (Clock cycle Time)A
= (100,000)*(1.3)/(600*106) ns
(CPUTime)B = (Instruction count)B * (CPI)B * (Clock cycle Time)B
= (I)B*(2.5)/(750*106) ns
Since (CPUTime)A = (CPUTime)B,
we have to solve for (I)B and get 65000

Document information

Uploaded on
August 4, 2024
Number of pages
5
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers
$17.49

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
StudyCenter1
4.3
(29)
Sold
232
Followers
91
Items
3811
Last sold
1 month ago



Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions