• We should now be fully online following an overnight outage. Apologies for any inconvenience, we do not expect there to be any further issues.

Can someone please explain to me the way CPU cycles work?

RSI

Diamond Member
May 22, 2000
7,281
1
0
I would like to know...

I am writing an overclocking article, and I want to go in more depth about CPU cycles, and in this respect I am at a lack of knowledge. Could someone please fill me in or point me to some good info sites? Thanks.

-RSI
 

konichiwa

Lifer
Oct 9, 1999
15,077
2
0
Well I would go look at my "PCs Illustrated" book, but I can't get at it until tomorrow. If it comes down to it, I could look for you in that book tomorrow and report back. But I'm sure someone has to know?
 

thorin

Diamond Member
Oct 9, 1999
7,573
0
0
You need to be more specific about the info that you want.

Here's a basic explanation:

CPU Cycles = A CPU can accept a command or instruction a certain number of times per second which is the MHz rating, 1Hz = 1 cycle (basically). So a 200MHz CPU can accept 200 million commands, instructions, or data packets per second. Certain commands or intructions can be executed within one cycle and some take more then one, depending on complexity, etc..

Now cycles or clock ticks can also refer to the speed of the system bus etc.... If you are refering to a cycle [clock tick] of the system clock (bus speed; 66, 100, or 133), then obviously the CPU can perform multiple instructions per cycle [clock tick] since CPUs greatly outpace the system clock (bus speed).

It would be better if you told us what you know or what you don't quite understand about CPU cycles and we can help you along in your understanding.

Thorin

PS > Sr.'s and Elite's remember I said this was a very basic explanation.....no flamage pls.
 

Zorba

Lifer
Oct 22, 1999
15,613
11,255
136
A Hert is: The variation of voltage or current from zero to a maximum and back to zero, in the positive direction, and from zero to a maximum and back to zero, in the negative direction, is one complete cycle.

From my understanding of a cpu (I could be wrong though), most CPUs start processing data on the rise in the positive direction (when the current is increasing), and it [the data] well be processed by the end of the cycle, and then new data is sent through. DDR sends data on the rise and fall of in the positive direction, and QDR sends data on the rise and fall in both directions.

Okay I don't know if that is right, but it is what I believe to be true, don't flame me if it's not (but do correct me). PM can probably explain this much better than I.
 

Zorba

Lifer
Oct 22, 1999
15,613
11,255
136
Well my post looks kinda crapy now, after the other two posted while I was typing ;).

But thorin: 1MHz = 1 million cycles. 1Hz = 1 cycle.
 

thorin

Diamond Member
Oct 9, 1999
7,573
0
0
It was a typo.....thanks for pointing it out, I've fixed it. Notice I did say 200MHz = 200 million.

Thorin
 

Zorba

Lifer
Oct 22, 1999
15,613
11,255
136
thorin: I knew it was a typo, that is why I tried to not make it sound like I was flaming you (sorry if it did sound that way).
 

Goi

Diamond Member
Oct 10, 1999
6,771
7
91
Most CPU architectures are pipelined and superscalar now, so it can issue multiple instructions per clock cycle. For example, the Athlon can issue up to 3 integer operations per clock cycle.

Generally a CPU reads instructions from memory, executes them and stores the result of the operation back in memory. In a pipelined processor, there are 5 basic pipeline stages that an instruction has to go through before it is completed. These are the Fetch, Decode, Execute, Memory and Writeback stages. Each new clock cycle, any particular in-flight instruction will either proceed on to the next pipeline stage, or gets flushed out due to some kind of exception.

In the fetch stage, the CPU reads an instruction from memory into the instruction register. The CPU knows which memory address to read from based on the Program Counter(PC) which points to the next memory address to read.

In the Decode stage, the CPU dissects the instruction to figure out what operation it is and what operands it uses. It stores the operation and operands into separate registers.

In the Execute stage, the CPU takes the operands and operation and passes it through the ALU, in which the result is obtained.

In the Memory stage, the CPU accesses memory if the operation was a memory operation(Load/Store).

In the Writeback stage, the CPU stores the final result of the instruction into the appropriate register.

This is a very general view of the instruction lifecycle. Complications arise from stuff such as branch prediction, dynamic scheduling(OOE), register renaming and superscalar execution. It'll take more than a BBS thread to explain the intricacies. Good books to read regarding CPU architecture/ISA would be Computer Organization or Computer Architecture by Patterson & Hennessy. The former gives a broad overview while the latter covers more advanced topics.
 

Goi

Diamond Member
Oct 10, 1999
6,771
7
91
BTW I was halfway through that long post when my computer decided to crash on me. Now that sux :(
 

thorin

Diamond Member
Oct 9, 1999
7,573
0
0
Zorba It's all good dude....don't worry so much.

Also I have to make an addition to my post above:

"Now cycles or clock ticks can also refer to the speed of the system bus etc.... If you are refering to a cycle [clock tick] of the system clock (bus speed; 66, 100, or 133), then obviously the CPU can perform multiple instructions per cycle [clock tick] since CPUs greatly outpace the system clock (bus speed)."

A CPU may also complete more then one command/instruction per cycle (CPU Cycle or System Cycle...see above post) due to the fact that modern micro-processors all contain multiple execution units for both Integer and FPU opps.

Thorin