Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Homework Help: Need Help Understanding a Problem About CPUs

  1. Feb 11, 2008 #1
    1. The problem statement, all variables and given/known data
    This is the problem:

    Consider a CPU that has a clock cycle of 20 nanoseconds (ns). It is possible to remove some instructions from its assembly language instruction set to form a second CPU and reduce its clock cycle to 18 ns. These instructions comprise 4 percent of all code in a typical assembly language program, and each of these removed instructions would have to be replaced by 3 instructions from the reduced set. Assume that every instruction requires the same number of clock cycles, c, to complete (i.e., to be fetched, decoded, and executed with results written back).
    Which CPU has the better performance?
    What percentage of typical code would the removed instructions have to comprise in order for the two CPUs to have the same performance?
    For what clock cycle for the original CPU would the two CPUs have the same performance?

    2. Relevant equations

    T = (N*S)/R

    N = actual number of instructions
    executed in program
    S = average number of cycles for
    instructions in program
    R = clock rate
    T = program execution time

    3. The attempt at a solution

    I actually don't need help solving the problem (not yet anyways).
    My problem is that to me it seems this problem is worded kind of
    poorly and I don't really understand what it's trying to say about
    the new instructions comprising 4 percent of the code and the
    removed instructions being replaced by 3 instructions from the
    reduced set. Can someone explain this problem to me?
  2. jcsd
  3. Feb 19, 2008 #2


    User Avatar
    Science Advisor
    Homework Helper

    Let's say that there are instructions A-Y and performing instructions BCD in order will do the same thing as instruction A will do by itself. Now, you have the choice between a chip that will do all of A-Y in 20 ns each, or one that will do B-Y (so you have to replace all the A's with BCD) in 18 ns each.
  4. Feb 19, 2008 #3
    Thanks for the help, I've got it now
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook