Notices
Results 1 to 6 of 6

Thread: How is data written to RAM

  1. #1 How is data written to RAM 
    Forum Freshman
    Join Date
    Jul 2014
    Posts
    10
    From my understanding(correct me if I am wrong) when I read data from RAM memory it is copied into processor cache and than it is copied into register to be used by the processor. When I create data (like variable) is it first created in register and than copied to cache and from cache to RAM or is it directly created in RAM?

    Additional question: Does stack and heap exist only in RAM or do they exist in processor cache as well?



    Reply With Quote  
     

  2.  
     

  3. #2  
    Forum Radioactive Isotope MagiMaster's Avatar
    Join Date
    Jul 2006
    Posts
    3,440
    Well, I'm trying to come up with a good answer, but modern architectures are a bit too complicated to answer simply. Things leaving the processor don't go through the cache, but when you create a variable, either on the stack or the heap, there's so much going on that it's hard to keep track of it all. (Also, computer architecture isn't my field, so I may be missing a couple of pieces of the puzzle.)


    Reply With Quote  
     

  4. #3  
    Forum Freshman
    Join Date
    Jul 2014
    Posts
    10
    Do you know if variable is created in cpu register before going into RAM? Also I am wondering if there is no stack or heap(or maybe there is) in the cache how can a cache keep track of data?
    Reply With Quote  
     

  5. #4  
    Forum Professor
    Join Date
    Aug 2013
    Location
    San Diego
    Posts
    1,970
    A simple processor writes data directly to memory. More complex processors use a cache, so the processor can write to cache at a very high speed then continue executing at a very high speed while the cache writes the data to the slower memory. Think of the cache as a delivery truck system; that way you can load the stuff you want delivered into the trucks and keep working while they go out and deliver. A stack write isn't much different.
    Reply With Quote  
     

  6. #5  
    Forum Professor
    Join Date
    Aug 2013
    Location
    San Diego
    Posts
    1,970
    Quote Originally Posted by fghf76 View Post
    Do you know if variable is created in cpu register before going into RAM? Also I am wondering if there is no stack or heap(or maybe there is) in the cache how can a cache keep track of data?
    If you "create" a variable in a language like C, nothing is written anywhere. It's an abstract concept; you are just allocating space for it in your code. When you actually write a value to it, then the write is performed to the space in memory allocated to that variable.
    how can a cache keep track of data?
    That question occupied about two months in a computer design course I once took. Suffice to say that it is a difficult but not insurmountable problem; each location in the cache needs additional space to store the intended address, a flag that shows whether it has already been written or not, age of the cached item etc.
    Reply With Quote  
     

  7. #6  
    Forum Junior
    Join Date
    Mar 2014
    Location
    WA
    Posts
    287
    They are caches within processors, of different speeds and sizes. The CPU reads the input, does calculations using it's internal cache then it is sent directly to the RAM, through the motherboard.
    Newbie to Science, trying to educate myself on this forum and further my scientific knowledge.

    I like to ask a ton of questions so please be understanding!

    I like to think of new stuff and in new ways.
    Reply With Quote  
     

Similar Threads

  1. Replies: 1
    Last Post: October 3rd, 2012, 12:21 PM
  2. ram setu proves darwin was wrong
    By xxx200 in forum Biology
    Replies: 1
    Last Post: February 7th, 2012, 07:09 PM
  3. Please hlep me in (Data preparation for data mining )
    By nadia in forum Computer Science
    Replies: 3
    Last Post: December 22nd, 2008, 01:56 PM
  4. Help: Ram fried - Is my MoBo damaged?
    By Bloodling in forum Computer Science
    Replies: 1
    Last Post: January 16th, 2007, 04:21 AM
Bookmarks
Bookmarks
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •