Bedanto wrote:
I am trying to undersand why certain intel instrucitons take more than
one cloc kcycle to complete while others can even be done in less than
one clock cycle.
i thought each instruction should take one clcok cycle to complete,
but hat doesnt seeem to be the case. can someone kindly explain this
to me…
This is not something that can be explained in a simple mailing list
post. You need to do some basic reading about processor architectures
in general.
However, consider this. If I have an instruction that needs to read
from memory, first I need to figure out what address I need to read.
That might involve pulling values from two registers, adding them, and
adding a constant from the instruction. That arithmetic has to finish
before I can even start the operation to request memory. Then, I have
to know where to put it.
Division is another interesting example. There is still no algorithm
for doing a division in one cycle. It’s done iteratively, not unlike
the way you do long division on paper.
Remember, the processor cycle is the lowest step in getting things
done. Despite parallelism, if operation B cannot start until the result
of operation A is available, then by definition those two operation
cannot complete in the same cycle. Many Intel instructions are
complicated, involving many steps.
These operations tend to be done in small, incremental steps in small
functional units, and by having several of those units, I can have
several instructions in mid-process at the same time. An instruction
can’t really take less than one cycle, but because of multiple pipeline
units, I can sometimes have two or more instructions complete in the
same cycle, so the average cycle count is less than 1.
–
Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.