Clock cycle vs operating cycle

Thread Starter

patheticz

Joined Nov 3, 2009
28
Is it true that the operating cycle and the clock cycle are two different things altogether?
For example, in a DSP data sheet, an instruction MAC requires 1 cycle to execute. Does that mean the operation can be completed in 1 clock cycle?
I read in a 8051 uP book which states that a cycle consist of 6 states, and each state consist of 2 clock cycles.
Is it true?
 

Markd77

Joined Sep 7, 2009
2,806
They are usually different things. Quite often different instructions take different times as well. For example AMD CPUs used to run at slower clock frequencies that Intel ones but got more instructions done in every clock cycle.
Some PIC microcontrollers do 1 instruction every 4 clock cycles but program jumps take twice as long.
Because the BASIC stamp runs interpreted code, different instructions take very different times to execute.

I wish the forum would tell me if someone had already answered the post while I was slowly typing.....
 
Last edited:

studiot

Joined Nov 9, 2007
4,998
Look carefully at the size of the registers, the bus and the memory address space.

Different devices have to load the address info in chunks defined by the width of the bus.
 

Thread Starter

patheticz

Joined Nov 3, 2009
28
so how do i know how many clock cycles are there in an instruction cycle for a particular DSP chip?
i am looking at the TMS320F28346
 

beenthere

Joined Apr 20, 2004
15,819
It is pretty common for the instruction set to have included in it the execution time for each instruction, and differences depending on things like branches taken, etc.
 

Markd77

Joined Sep 7, 2009
2,806
Looks like it is going to be 1:1

FEATURE TYPE(1) F2809 F2808 F2806 F2802 F2801 C2802 C2801
Instruction cycle (at 100 MHz) – 10 ns 10 ns 10 ns 10 ns 10 ns 10 ns 10 ns
 

Thread Starter

patheticz

Joined Nov 3, 2009
28
lets talk about the chip you are referring to then.
say i clock the chip at 150MHz, which means one clock cycle will take 6.67ns.
Wouldn't that mean the instruction cycle take only one clock cycle?

Because i have seen from other sources that each instruction will take more than one clock cycle.
 

Markd77

Joined Sep 7, 2009
2,806
It does look like most instructions take 1 clock cycle on this chip. Some of the instructions do take longer but the datasheet has the number of cycles for the instruction in the details starting page 175 of the datasheet you linked to.
 

Thread Starter

patheticz

Joined Nov 3, 2009
28
I am confused here...
If that is the case, won't it contradict one earlier reply in the same thread?
That reply mentioned about the instruction cycle being different from the clock/oscillator cycle...

So which is correct, especially for a DSP chip?
 

Markd77

Joined Sep 7, 2009
2,806
A lot of the previous answers were from before you stated what chip you would be using and the number of clock cycles per instruction on different chips varies a lot. Some chips use a lot of clock cycles per instruction, some use less than one. You happen to have picked one that is 1:1 (for most instructions).
The previous answers were not wrong, they were just talking in general, not knowing what chip you would be using.
 
Top