Wednesday, August 08, 2012

Memory distribution in Computer

Memory

             The information (instruction and data) required is stored in memory. The computer's memory is constructed out of semi-conducting material and stores information in binary form. Binary information is composed of two symbols 0 and 1, called binary digits(bits). All information within the computer is represented by two digits. The memory is organized into equal sized units (usually a collection of 8 bits, called a byte). These units are arranged a sequence and are identified by numbers called addresses. The memory of a computer can be divided into distinct parts as below.

Registers

     Registers are locations within the microprocessor where data is stored temporarily during processing.These internal high speed registers are used in arithmetic and logic operations for holding data operands. Some registers are accessible by the user through instructions.  Other s are reserved for the use of the CPU to perform it's activities.

Internal Cache

     Cache is a small high speed memory thata contains frequently used data. The use of cache avoids repeated reading of data from the slower main memory. Internal cache is located within the main microprocessor.
External Cache
    External cache is used to supplement the internal cache. It is used when an internal cache is not present.It is placed between the CPU and the main memory.
Main Memory
   Main memory stores data and instructions required by the main microprocessor. The main memory is also called RAM(Random Access Memory). Microprocessor instructions can directly access main memory locations. Main Memory is fast but expensive. However it is volatile the content stored will be lost when the power supply is cut off.
Secondary Memory
Memory levels in computer
Memory levels in computer
   All the data and programs required by the computer cannot be stored in the main memory because it is small in size and volatile. Secondary memory is slower but less expensive than main memory. It is also non-volatile and larger in size.The microprocessor can access the various types of memory in the memory hierarchy up-to the main memory. The microprocessor cannot access the secondary memory directly. Therefore, data  from the secondary memory has to be brought to the main memory so that the processor can use it.Memory management techniques are required to transfer information between the main  memory and secondary memory and this function is performed by the operating system. Some examples of secondary storage devices are hard disks, floppy disks, CD-ROM's, etc.
    The various types of memory are shown in the order of increasing size, decreasing speed and decreasing cost. Registers are the fastest memory devices but their high cost does not make it feasible to have them in large numbers. Similarly secondary memory is the least expensive but is very slow. The hierarchy therefore achieves optimal performance at reasonable costs as the amount of memory of each type that is commonly used is proportional to the size of its rectangle. The cost and speed of different type of memory are  compared in figure.