Like Tree1Likes
  • 1 Post By brewbuck

is there multiple clock cycles?

This is a discussion on is there multiple clock cycles? within the Tech Board forums, part of the Community Boards category; For CPI I'm given the following equation. Why does it say CPU clock cycles, doesn't the entire system operate on ...

  1. #1
    Registered User
    Join Date
    Apr 2010
    Location
    Vancouver
    Posts
    115

    is there multiple clock cycles?

    For CPI I'm given the following equation. Why does it say CPU clock cycles, doesn't the entire system operate on the same clock cycle, as dictated by the clock?
    CPI=(CPU clock cycles)/(Instruction count)

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    21,456
    In other words, it is possible for an instruction to take more than one clock cycle to complete, e.g., processing an instruction may take multiple steps, with each step happening based on a clock cycle.
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #3
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,452
    Well that really depends on your machine doesn't it.

    ARM (and other RISC processors) typically do one instruction per tick.
    x87 (and other CISC processors) have a much wider range.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  4. #4
    Registered User
    Join Date
    May 2009
    Posts
    2,521
    I suggest looking up machine cycle time if you still do not understand the question.

    Tim S.
    "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the Universe is winning." Rick Cook

  5. #5
    Registered User
    Join Date
    Dec 2011
    Posts
    795
    Not only do different instructions take different amounts of cycles, the average cycle number is often incorrect. It disregards un-cached data, branch misprediction, unaligned access, types of operands and the latency to access the devices, pipelining, and a multitude of other factors that could influence the speed of the instruction.

    Additionally, some other operations use microcode which could be very complicated, especially for FPU operations, which will complicate matters further.

    You might want to look here for clarification and demonstration.

  6. #6
    Captain Crash brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,236
    The motherboard generates a clock signal that the CPU multiplies up (via PLL) to generate its own clock. The CPU clock is much faster than all the other clocks in the system. Modern CPUs can even change their clock rate as they are operating. Thus, the term is qualified CPU clock cycles, because computers haven't operated on a single shared clock for decades.
    c_weed likes this.
    Code:
    //try
    //{
    	if (a) do { f( b); } while(1);
    	else   do { f(!b); } while(1);
    //}

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. cpu clock cycles
    By begginer in forum C Programming
    Replies: 13
    Last Post: 03-30-2011, 07:17 AM
  2. multiple for cycles
    By ERJuanca in forum C Programming
    Replies: 4
    Last Post: 06-17-2009, 04:02 PM
  3. Outside influences on clock cycles? (clock_t)
    By rsgysel in forum C Programming
    Replies: 4
    Last Post: 01-08-2009, 05:15 PM
  4. Multiple Cycles through Multi-Dimensional Array
    By DonFord81 in forum C Programming
    Replies: 2
    Last Post: 11-13-2008, 05:27 PM
  5. How many CPU cycles (ARM) for add vs if..then
    By Pea in forum C Programming
    Replies: 11
    Last Post: 01-26-2005, 01:40 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21