What is 1Mhz

Tab

Lifer
Sep 15, 2002
12,145
0
76
As the title says. Lets say a processor is giving the easy operation of 2+1. How fast is on 1Mhz computer going to do this and how fast is a 3.0Ghz/800Mhz P4 going to do this. Does the computer even need RAM for a operation this simple?
 

Jeff7

Lifer
Jan 4, 2001
41,596
20
81
Raw MHz rating isn't the only thing that is needed to figure this out. A 3GHz processor is not exactly 91.9x faster than a 33MHz 386 - it's more than that. There's optimizations, like MMX, SSE, SSE2, and hyperthreading, among others.

With a simple operation like that, written in assembly code, it probably would fit in the CPU's cache, but I don't think it would stay there for long. Also, there would need to be some kind of operating system running, which would also want the processor's attention, and its precious cache space.
 

FrankSchwab

Senior member
Nov 8, 2002
218
0
0
Such a simple question with such a complex answer....

You suggested the processor is given the easy operation. So, we won't talk about how long it actually takes to fetch the operation from memory (assume 1 clock for a 1 Mhz processor, 50 or more clocks for the 3 GHz machine).

A 1 Mhz processor built today will take from 1 to 4 clock cycles to execute an add operation - 1 if the processor was designed in the last decade, 4 if it's one of the ancient processors designed two decades ago that are still sold. So, between 1 and 4 microseconds to do the add. It's pretty deterministic.

A 3 GHz processor (say a P4) will take up to 20 clock cycles to execute the specific Add instruction (someone more familiar with the P4 pipelines can give a more precise number for this specific operation). However, as it can be operating on up to 126 instructions at the same time, the "average" time to execute the instruction (if you did a million of them, and the processor caches were enabled) would be less than one clock cycle (0.000033 microseconds). Not nearly so deterministic.

It's a tough question to answer in less than 10 pages; maybe look at
http://www.anandtech.com/cpu/showdoc.html?i=1460
for more background.

/frank
 

Lynx516

Senior member
Apr 20, 2003
272
0
0
Ok realy the question you should be asking is how fast will a 1Mhz CPU do a series of these adds and how fast wil a P4 do it.

Lets start with the 1Mhz slowish CPU. How fast it will do these operations will depend on 2 main things. The first is if it is pipelined and the second is weather its RAM is running at the same speed as teh CPU. In most cases the later is true so that is not an issue. The first will determine how many ANSWERS per clock the CPU provides on average from when the first answer emerges. If the CPU is pipelined and not SUPERSCALER then it will output 1 IPC (Instructions per clock). However if you ran a 3Ghz P4 with the same instructions you would find it outputting 4 IPC (this is because it is SUPERSCALER and has 2 double pumped ALU units). So that is the answer to your comparison.

Jeff7 most of what you said is actually wrong and/or not related to the questoin. The optimisations you talk about are SIMD instructions and make no differences to normal addition. Secondly hyperthreading does not apply as this instruction would only be 1 thread. Thirdly it would fit into a Cache because the instruction is only 64 bits long at most (Max lenght of 32bit x86 instruction). Thirdly you woudl not need an OS running you can execute code directly from memmory as long as the CPU knows where to go. If you needed an OS how does the BIOS run?

For more info on words like Superscaler and Pipelining go to Arstechnica where there are detailed articles on CPUs ranging from the basic to the comprehensive.