CPU to computer is same as brain is to our body. Both control the functioning of peripheral parts of systems and both store and utilize information. The reason that they can do this is the memory or storage. In computer terms, memory/storage are the physical devices that store data or programs on a temporary or permanent usage by the computer system. Understandably, many computer users consider memory and storage to be the same thing. But there is a slight difference.
Memory is that component in your computer that allows you to access data, stored for small interval of period. An example of memory is Dynamic Random Access Memory (DRAM). Not much can be stored here due to its size limitations.
[caption id="attachment_746" align="aligncenter" width="300"]
Computer Memory Hierarchy[/caption]
Normally, as the Speed and Cost of storage type increases, it's size decreases and vice versa. For instance, the tapes or disks that have cheapest cost and biggest memories have operational time in range of seconds. While the CPU registers that can store Kbs of data and are most expensive to buy have operation time in range of nano seconds.
The data flow is a 2 way process. From the CPU, the data goes to Cache and then to Random Access Memory (RAM
). The RAM in turn interacts with the Virtual Memory (Disk Storage). This interaction is affected the clock cycle that defines the rate of data flow for example a 16 bit bus generally operates at around 66Mhz while a 32 bit bus operates around 100Mhz.
The Caches are of 2 types L1 and L2 in a computer. L1 Cache accesses memory at full microprocessor speed
for around 10 nanoseconds and is 4 kilobytes to 16 kilobytes in size. L1 contains both data and instruction cache that are individually transferred to L2. L2 Cache accesses memory of type Static Random Access Memory for around 20 to 30 nanoseconds and is 128 kilobytes to 512 kilobytes in size. L2 transfers the data to RAM.
So, briefly this is how the computer memory works. We will go in more depth of Memory in other articles about Operating Systems.