InClassActivity02-sol - 1/23/02 9:15 AM Activity #02...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
1/23/02 9:15 AM Page 1 of 6 Activity #02 (SOLUTIONS) Last Name First Name Student ID Number 2.1 1.2 Total Grader Initials 50 points 50 points 100 points Activity 2.1 (First hour) A. (35 points) Consider a simple CPU with just the instructions listed below Instructio n Mnemoni c Operation Number of Cycles Number of Bytes LDAA Load Accumulator from Memory 4 3 STAA Store Accumulator to Memory 4 3 ADDA Add Memory to Accumulator 4 3 BEQ Branch on Equal to 0 3 2 CMPA Compare accumulator to Memory 4 3 NEGA Negate Accumulator 2 1 BRA Branch always 3 2 MUL Multiply Accumulator 10 1 SUBA Subtract Memory from Accumulator 4 3 ANDA AND Accumulator with Memory 4 3 HALT Halt 1 1 NOP No Operation 1 1 a. (5 points) What is the average number of cycles per instruction (CPI) for this CPU, assuming that all instructions are executed equally often? Answer: n instructio cycles ns instructio cycles / 67 . 3 12 44 = Grading Policy: 5 pts correct answer, 2 pts partially correct answer, 0 pts for not trying.
Background image of page 1

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

View Full DocumentRight Arrow Icon
1/23/02 9:15 AM Page 2 of 6 b. (5 points) If the CPU cycle time is 5ns, what is the average number of instructions executed per second, assuming that all instructions are executed equally often? Answer: Remember that 1ns = 10 -9 sec. It takes 3.67 × 5 × 10 -9 secs per instruction By taking the reciprocal, this translates to 54.5 × 10 6 instructions/sec, which is 54.5 MIPS . Grading Policy: 5 pts correct answer, 2 pts partially correct answer, 0 pts for not trying. c. (5 points) What would the highest "peak MIPS" that could be (misleadingly) claimed, and what operation would it use? Answer: The most favorable assumption is that the machine executes only 1-cycle instructions such as NOPs all the time. This implies that it takes 5ns per instruction, which translates to 200 MIPS . Grading Policy: 5 pts correct answer, 2 pts partially correct answer, 0 pts for not trying. d. (5 points) How long would it take to execute a program P with 10 million instructions executed equally often, and no I/O? State your answer in seconds. Answer: From part (a) we see that it takes 3.67 cycles/instruction.
Background image of page 2
Image of page 3
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 / 6

InClassActivity02-sol - 1/23/02 9:15 AM Activity #02...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online