G
GIR
How many CPU cycles
does it take to get information from memory to the CPU?
it takes 1 cycle to get data from the memory to the CPU. in 1 cycle
there are upto 5 R/W operations.
How many CPU cycles
does it take to get information from memory to the CPU?
Uhu, it didn't occure to you that the language C isn't just for 8086
machines...
comp.lang.c sais to me that this group is about the language C... I
think it's kinda ackward that you would automaticly presume that
everybody in here is programming for a 8086 architecture.
I think there's coliding views here. You guyz look at it from a
desktop POV where the OS handles alot of the stuff.
I'm looking at it
from a system POV where you have to handle alot of stuff yourself and
thus know every little tiny detail of your system.
For example if you processor has an XTAL of 1MHz then 1 cycle takes 1
us (microsecond). Just multiply the total amount of cycles needed by
the XTAL and you got your execution time.
it takes 1 cycle to get data from the memory to the CPU. in 1 cycle
there are upto 5 R/W operations.
GIR said:I think there's coliding views here. You guyz look at it from a
desktop POV where the OS handles alot of the stuff. I'm looking at it
from a system POV where you have to handle alot of stuff yourself and
thus know every little tiny detail of your system.
Because there is alot of interrupting and queuing going on in the
modern day OS the suggested timing via timers or RTC cannot and will
not be accurate. If you want to know how long a certain piece of code
(function, subroutine or method) exactly needs for it to complete it's
duties to only way to really know for sure is to look at it's cycles.
GIR said:it takes 1 cycle to get data from the memory to the CPU. in 1 cycle
there are upto 5 R/W operations.
In said:The bottom line is that you are either grossly over-simplifying or you
are simply unaware of several of the issues involved. The method you
suggested is only useful in a relatively small number of very simple cases.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.