memory - CPU and RAM operations in different application states

05
2014-04
  • johnnyquest

    This will actually consist of multiple questions.

    1. After an application is started and loaded into the RAM the RAM's operations are refreshed many times a second (even without any input and the application just sitting on the screen). Is this correct? If so, how come the data is not stored in a static state like in HDD?

    2. Does the CPU still run operations on the application, even when there are no instructions coming from it?

  • Answers
  • Slowki

    "Does the CPU still run operations on the application, even when there are no instructions coming from it?"

    CPUs perform instructions as they cycle, some instructions taking multiple cycles, others can be executed in parallel, the CPU clock speeds up and slows down as needed depending on what instructions and how many of them are being sent, without instructions they idle untill new instructions are sent.

    "After an application is started and loaded into the RAM the RAM's operations are refreshed many times a second (even without any input and the application just sitting on the screen). Is this correct? If so, how come the data is not stored in a static state like in HDD?"

    If the application changes a variable, then that information will be updated in memory as necessary. Beyond that RAM gets refreshed to preserve the integrity of the information due to RAM's volatility, storing information on the HDD(through virtual memory, or swap partition) is used often, but not preferred due to low read/write speeds.

  • ultrasawblade

    After an application is started and loaded into the RAM the RAM's operations are refreshed many times a second (even without any input and the application just sitting on the screen). Is this correct?

    Right.

    Old computers such as the Commodore 64 would need to halt the CPU during this process (in the case of the Commodore 64, the video chip actually handled RAM refresh).

    Modern computers have dedicated memory controllers that issue DRAM refreshes.

    If so, how come the data is not stored in a static state like in HDD?

    There is such a thing as Static RAM. The cache in a CPU uses it. It's much more expensive and power-hungry (and quicker due to not needing refresh cycles) than DRAM, so it tends to be used only where the benefit outweighs the cost.

    On old 486 motherboards, when cache RAM started becoming a thing, you had sockets where you were expected to populate with small static RAM chips. These were not addressable as main RAM but external CPU cache (386/486 era). Then, the cache RAM started being included on a card with the CPU (Pentium I/II era), then built into the CPU.

    Does the CPU still run operations on the application, even when there are no instructions coming from it?

    Intel CPU's have a HLT instruction that tells it to stop until the next interrupt. An interrupt can come from a device or other sources (a reset is a type of interrupt). Old CPUs did not physically halt when they encountered this instruction but later ones will physically power down.

    CPUs that do not have such an instruction never stop. The only way to get them to do nothing is place them in an endless loop.


  • Related Question

    memory - Given a processor specification how can I figure out what RAM it can use?
  • user4213

    If I have a number of varying processor specifications (x86, x64, PII, P4 etc) can I accurately calculate the memory (speed, size, etc) that will work with the CPU?

    I appreciate that the motherboard the CPU / RAM will be used on will further limit this by number of pins, speed and slots.

    Are there any 'gotchas' or can I deduce this all from specifications and what properties of the RAM / CPU should I be checking?


  • Related Answers
  • osij2is

    I'm not certain of what you're really trying to ask. Basically, CPU/RAM specifications are usually a function of the chipset more than RAM.

    If I have a number of varying processor specifications (x86, x64, PII, P4 etc) can I accurately calculate the memory (speed, size, etc) that will work with this RAM?

    "Accurately calculate"? Um, yes I suppose. The motherboard Chipset and usually the socket of the CPU will determine what specifications of RAM can be supported. For example, some processors are supported by chipset 'X' and 'X' does NOT support DDR3. Guess what? No DDR3 support for that CPU. That's about as simple as it gets. Some CPUs are built around RAM (remember RAMBUS?) while others focus more on what chipset can support which features they want.

    Are there any 'gotchas' or can I deduce this all from specifications and what properties of the RAM / CPU should I be checking?

    Yes there are some BIG gotchas. People (system builders) typically get hung up on a few details: what CPU can I have - how much RAM can I hold - bus support (PCI-e x16/x8/x4?) and peripherals. The problem in looking at things in this light is that the most important factor is being left out: the chipset.

    I don't care how fast a CPU is or what killer RAM you get, the chipset is the heart of the motherboard and in turn, the computer itself. Chipset determines RAM, CPU, buses, everything. So if you want to deduce from specifications of RAM & CPU, start looking at the motherboard chipset.

    Another "gotcha" is RAM. RAM can be expensive to rare to find to stable/unstable. RAM is a strange beast. The faster the RAM, usually the slower the timings. If you really want to learn about how RAM works, there are lots of articles all over the web. But learning RAM timing and how the chipset works in conjunction is what really matters.

    Don't get swept up in "nehalem" fever or whatever CPU is the flavor of the year. Yeah, it's a solid CPU, but if the RAM is too expensive or flaky and the chipset is 'meh' at best, it's not always worth it. DDR3 is not better simply because of speed. You have to weigh your options carefully with what you're trying to achieve. Are you building a simple computer? Workstation for development or animation/rendering or computation?

    And as a last and obvious note, always read the manual before buying anything. You'll save yourself time and money.

  • NoCarrier

    No conclusive way to determine what RAM it can use. There was far too much overlap.

    in GENERAL though..

    • PC100/PC133 lasted from P2 to P3
    • Rambus was on some early P4s
    • P4 generally used DDR.. some used DDR2 near the end
    • Core2Duos use DDR2
    • Core2Quad use DDR2
    • Core I7 use DDR3

    However, choosing a specific memory module is hard as there are varying system/motherboard specifications which may not be compatible.

  • Kevin Panko

    If you go check out the memory advisor tool at Crucial, you will see that it is basically using a database of every known motherboard. If you know the motherboard, you can figure out which memory modules work with it.

  • Troggy

    To a degree yes, but one of the more defining components is the chipset used on the motherboard. That is what normaly determines ram usage characteristics/limitations.

  • Keck

    Coupled with Kevin Panko's comment,

    You need to know your motherboard model, not the CPU.

    An easy way to find out the details is the excellent CPU-Z program from CPUID.

    CPU-Z

    Using that information, check google, or Kevin's Crucial link to find what memory is supported.

  • ChrisInEdmonton

    Not fully. Motherboards may impose upper limits on the amount of RAM that will be supported. In fact, if you know your motherboard, you'll know what RAM you'll need. If all you know is your CPU, you'll be able to determine what motherboards would support it and from that, know what RAM you'll need.

    Some CPUs support multiple types of RAM. AM3 based Phenom IIs, for example, support DDR2 and DDR3 RAM.

  • Diago

    Actually the only thing you need to know is the motherboard, since this is what will define what RAM you can use.

    The best configuration is normally predetermine. For example i7 boards will support DDR3, Dual Core normally support DDR2 etc.

    However the CPU won't have an effect on the memory choice.

  • rob

    Contrary to what is stated in most of the other answers, there are several CPUs for which you can definitively state that a particular type of RAM is compatible without researching motherboard chipsets.

    The determining factor is the memory controller, which either resides on the motherboard or is integrated into the CPU, as has been the case for AMD CPUs as far back as the Athlon 64.

    Computers using Intel microprocessors have traditionally had a memory controller implemented on their motherboard's northbridge, but many modern microprocessors, such as DEC/Compaq's Alpha 21364, AMD's Athlon 64 and Opteron processors, IBM's POWER5, Sun Microsystems's UltraSPARC T1, and more recently Intel's Core i7 and Core i5 Cpu's have an integrated memory controller (IMC) on the microprocessor in order to reduce memory latency. While this has the potential to increase the system's performance, it locks the microprocessor to a specific type (or types) of memory, forcing a redesign in order to support newer memory technologies.

    Given a CPU model, you could look at the documentation on the manufacturer's website or Wikipedia (AMD | Intel) to determine (1) if it has an integrated memory controller and (2) if so, what type of memory it supports.

    If you're looking at an AMD CPU older than the Athlon 64 or an Intel CPU older than the first generation of i3/i5/i7 (Nehalem), then the CPU does not have an integrated memory controller and the type of memory will be dictated by the motherboard chipset.