|
pc
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Simple Hardware Clock questionOk, so I just read that the clock synchronizes other hardware
components of a computer szystem; meaning that, because the processor is faster than the RAM for instance, or the hard-disk, the next CPU instruction is delayed till the next clock tick, in order to ensure that each component completes its operation before the next phase. And for this reason, the clocks often run at relatively slow speeds such as 333MHz - much slower than the 3GHz CPUs that we have now. If this is so, one may say that: this CPU execute no more than 333,000,000 instructions per second! Is this so? Thanks for helping the Noob Olumide 50***@web.de wrote:
> If this is so, one may say that: this CPU execute no more than the internal cache runs at the same speed as the cpu, so the cpu can > 333,000,000 instructions per second! execute "complex" calculations in its cache and then send the result to memory. for example, doing an interpolation of two values: r = a[i] + (a[i+1] - a[i]) * fraction_of(i); with i's value in a register, you read two values a[i] and a[i+1], the second a[i] is cached so memory isnt accessed, calculate the difference in to a cpu register (no memory access), multiply by fraction_of(i) (also in register: no memory access), add a[i] (register again) and store r to memory so we only did 3 memory accesses, and as the memory bus is usually wider (64, 128 or even 256bits) than the data we're working on (32bits), a[i] and a[i+1] might have been read at the same time, making it just 2 memory access for 8 operations, some of which could take more than one cpu cycle. if this code is in a loop and the loop fits in the instruction cache then no reads will be done for most of the iterations (only the first will load the instruction cache). so, the cpu does make more work than, say, 333Mhz but it also does MUCH less work than its 3.33Ghz clock would allow it to do if it ran on 3.33Ghz memory. some cpu will even overheat if you make them run too efficiently as they're expected to be regularly slowed down by running on slow memory. |
|||||||||||||||||||||||