#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2010
    Posts
    9
    Rep Power
    0

    What is the difference between RAM and Computer Clock (Gh'z) (computer speed)


    I know the computer clock is measured in hertz (millions/billions of pulses per second is todays standard) I know that the higher the pulses per second the faster a computer completes a cycle, therefor the faster it can execute programs and all that other good stuff.

    However,
    I dont see the correlation between RAM and Gh'z.
    Comparing these two computers (both dual core):
    A computer with 4GB of ram and a 1.6 Gh'z processer
    A computer with 1GB of ram and a 3.2 G'h'z processer


    What would be faster and why?

    (I know there are other factors besides ram and clock speed that may determine speed but lets just focus on these two factors for the sake of the example)

    Thanks in advance I appreciate any feedback.
  2. #2
  3. No Profile Picture
    Lost in code
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 2004
    Posts
    8,317
    Rep Power
    7170
    If everything else about the two systems is identical, and the two processors have identical architectures, and the ram is running with identical timings, and the systems are running identical programs with identical input, and the system is using less than 1GB of RAM and not swapping, then the 3.2Ghz system will be faster because its higher clock speed allows it to perform a greater number of operations each second.

    Under any other conditions it is utterly impossible to say without considering other factors.

    However, this is a very unrealistic comparison:
    * there are very few (if any) CPU architectures that span from 1.6Ghz to 3.2Ghz, so it's unlikely that the two CPUs use the same architecture
    * a modern desktop computer frequently uses more than 1GB of memory if it can, and is usually swapping anyway even if it has more memory than it needs
    PHP FAQ

    Originally Posted by Spad
    Ah USB, the only rectangular connector where you have to make 3 attempts before you get it the right way around
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2010
    Posts
    9
    Rep Power
    0
    Originally Posted by E-Oreo
    If everything else about the two systems is identical, and the two processors have identical architectures, and the ram is running with identical timings, and the systems are running identical programs with identical input, and the system is using less than 1GB of RAM and not swapping, then the 3.2Ghz system will be faster because its higher clock speed allows it to perform a greater number of operations each second.

    Under any other conditions it is utterly impossible to say without considering other factors.

    However, this is a very unrealistic comparison:
    * there are very few (if any) CPU architectures that span from 1.6Ghz to 3.2Ghz, so it's unlikely that the two CPUs use the same architecture
    * a modern desktop computer frequently uses more than 1GB of memory if it can, and is usually swapping anyway even if it has more memory than it needs

    Thank you for the response, that kind of helps, however, I knew the example was unrealistic and the two computers are unlikely to have the same architecture.

    Can you please explain how does RAM come into play when the computer runs and how the CLOCK comes into play while the computer runs?

    So, RAM basically, is responsible for doing all the swapping and taking care of processes WHILE the computer is on, and the clock is responsible for the speed of carrying out all the instructions and all the other factors needed to execute a program, correct?
  6. #4
  7. No Profile Picture
    Lost in code
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 2004
    Posts
    8,317
    Rep Power
    7170
    Can you please explain how does RAM come into play when the computer runs and how the CLOCK comes into play while the computer runs?
    RAM is used to store data, just like a hard drive or a CD. The CPU itself also has memory in it that can be used to store data. The key performance difference is speed. The memory in the CPU is much much faster than RAM, which itself is much much faster than a mechanical hard drive. However, faster memory is expensive. Memory on the CPU is much much more expensive than RAM, which itself is much much more expensive than a mechanical hard drive.

    For these reasons computers use many types of memory in a hierarchy. Data that is actively being used is stored in the CPU's memory, data that is likely to be used soon or has been used recently is stored in RAM, and data that is not likely to be used anytime soon is stored on the mechanical hard drive. This hierarchy allows lots of data to "share" very fast memory without having to pay for hundreds of gigabytes of very fast memory.

    The computer frequently duplicates data between the different memory systems. Which data is duplicated depends on what programs you are currently executing.

    RAM does not perform swapping or process management, these features are facilitated by special hardware in the processor, but are primarily implemented in the operating system software (which is stored in memory and uses the CPU).

    Swapping occurs to free up extra RAM. It is most prominent when insufficient RAM exists to support all of the programs that are requesting to store data in RAM. Swapping works by copying sections of RAM to the mechanical hard drive. If that section of RAM is needed later by the executing program it is then necessary for the computer to copy the data back from the hard drive to RAM. (Doing this will often require some other section of RAM to be copied to to the hard drive to make room). This process is very slow due to the fact that the hard drive is so much slower than the RAM.

    The computer's clock is used to synchronize operation of the processor. In modern CPUs it does not directly indicate how quickly the processor can carry out instructions. Modern CPUs are designed like an assembly line, there are many stations that perform a very small part of executing a single instruction. The clock speed describes how long the processor waits for each station to complete its job before the instruction is shifted to the next station. For example, in a 3Ghz CPU the instruction will shift to the next station every 0.334ns.

    However, the "assembly line" is orders of magnitude more complex than an assembly line that you would find in a factory. Knowing the clock speed tells you very little about how quickly the processor can execute instructions because:
    - different instruction types require different numbers of stations to complete
    - the processor will have more than one instruction executing at the same time... but
    - some instructions will cause all instructions that are currently executing to be cleared from the "assembly line" (any partial results are discarded)
    - some stations are duplicated so more than one instruction can use them at the same time
    - modern CPUs usually have multiple cores, so there are multiple independent assembly lines
    - some instructions will cause the processor to stall (not move any instructions to the next station)

    All of these factors are dependent on the design of the CPU architecture. The exact same instructions will be handled differently by different CPU architectures. Additionally, different architectures divide up the steps of executing an instruction (the "stations") differently.

    For example, the Cedar Mill revision of the Pentium 4 processor used up to 31 stations to execute a single instruction. The competing AMD processors had many fewer stages, and were able to execute instructions with fewer clock cycles. This is a significant contributing factor to why they were able to outperform the Pentium 4's even though the P4's were clocked at least 1Ghz higher.

    This is why you can only compare clock speed between processors that use the same architecture.

    ** Note that the "assembly line" example is not standard terminology. The "assembly line" is called a pipeline, and the "stations" are usually called stages.

    Comments on this post

    • karsh44 agrees : Great explanation!
    PHP FAQ

    Originally Posted by Spad
    Ah USB, the only rectangular connector where you have to make 3 attempts before you get it the right way around

IMN logo majestic logo threadwatch logo seochat tools logo