What is the Difference between Cache and RAM?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tharden3
    Contributor
    • Jul 2008
    • 916

    What is the Difference between Cache and RAM?

    I google it, but got the definition of both, not the relationship between the two. I kind of got the feeling that RAM was what your open applications load into, and Cache is temporary information stored from whats going on in those apps.

    -Are they two different components? Or does Cache work inside of RAM?

    -Are they on two different pieces of hardware?

    -Any examples of Cache at work?
  • RedSon
    Recognized Expert Expert
    • Jan 2007
    • 4980

    #2
    A CPU cache is a cache used by the central processing unit of a computer to reduce the average time to access RAM. The cache is a smaller, faster memory which stores copies of the data from the most frequently used main memory (RAM) locations. As long as most memory accesses are to cached memory locations, the average latency of memory accesses will be closer to the cache latency than to the latency of main memory (RAM).

    When the processor needs to read from or write to a location in main memory (RAM), it first checks whether a copy of that data is in the cache. If so, the processor immediately reads from or writes to the cache, which is much faster than reading from or writing to main memory.

    Most modern desktop and server CPUs have at least three independent caches: an instruction cache to speed up executable instruction fetch, a data cache to speed up data fetch and store, and a translation lookaside buffer used to speed up virtual-to-physical address translation for both executable instructions and data.

    (Thank you wikipedia!)

    Comment

    • AmberJain
      Recognized Expert Contributor
      • Jan 2008
      • 922

      #3
      Originally posted by RedSon
      The cache is a smaller, faster ........
      .........and costlier too ;).






      I know that OP never wanted to know this, still I couldnot resist the urge to post :)

      AmbrNewlearner

      Comment

      • tharden3
        Contributor
        • Jul 2008
        • 916

        #4
        Thanks for the help.

        Comment

        • Curtis Rutland
          Recognized Expert Specialist
          • Apr 2008
          • 3264

          #5
          Originally posted by RedSon
          (Thank you wikipedia!)

          Just when I was getting impressed :(

          Comment

          • RedSon
            Recognized Expert Expert
            • Jan 2007
            • 4980

            #6
            I could have done that easily myself but then it would have taken me longer than I wanted to. Copy and paste is a major time saver!

            Comment

            • Curtis Rutland
              Recognized Expert Specialist
              • Apr 2008
              • 3264

              #7
              Oh, OK, so you're just lazy. I get it.

              ;)

              Comment

              • RedSon
                Recognized Expert Expert
                • Jan 2007
                • 4980

                #8
                The hallmark of a good programmer :P

                Comment

                Working...