තව කියවන්න

Nov 23, 2014

TSR

Computer Memory




A mechanism that stores data for use by a computer. In a computer all data consist of numbers. A computer stores a number into a specific location in memory and later fetches the value. Most memories represent data with the binary number system. In the binary number system, numbers are represented by sequences of the two binary digits 0 and 1, which are called bits. In a computer, the two possible values of a bit correspond to the on and off states of the computer's electronic circuitry.

            In memory, bits are grouped together so they can represent larger values. A group of eight bits is called a byte and can represent decimal numbers ranging from 0 to 255. The particular sequence of bits in the byte encodes a unit of information, such as a keyboard character. One byte typically represents a single character such as a number, letter, or symbol. Most computers operate by manipulating groups of 2, 4, or 8 bytes called words.


                 Memory capacity is usually quantified in terms of kilobytes, megabytes, and gigabytes. Although the prefixes kilo-, mega-, and giga-, are taken from the metric system, they have a slightly different meaning when applied to computer memories. In the metric system, kilo- means 1 thousand; mega-, 1 million; and giga-, 1 billion. When applied to computer memory, however, the prefixes are measured as powers of two, with kilo- meaning 2 raised to the 10th power, or 1,024; mega- meaning 2 raised to the 20th power, or 1,048,576; and giga- meaning 2 raised to the 30th power, or 1,073,741,824. Thus, a kilobyte is 1,024 bytes and a megabyte is 1,048,576 bytes. It is easier to remember that a kilobyte is approximately 1,000 bytes, a megabyte is approximately 1 million bytes, and a gigabyte is approximately 1 billion bytes.

How memory works

                                                              Computer memory may be divided into two broad categories known as internal memory and external memory. Internal memory operates at the highest speed and can be accessed directly by the central processing unit (CPU) the main electronic circuitry within a computer that processes information. Internal memory is contained on computer chips and uses electronic circuits to store information. External memory consists of storage on peripheral devices that are slower than internal memories but offer lower cost and the ability to hold data after the computer’s power has been turned off. External memory uses inexpensive mass-storage devices such as magnetic hard  drives.

                      Internal memory is also known as random access memory (RAM) or read-only memory (ROM). Information stored in RAM can be accessed in any order, and may be erased or written over. Information stored in ROM may also be random-access, in that it may be accessed in any order, but the information recorded on ROM is usually permanent and cannot be erased or written over.


Internal RAM

                                                   Random access memory is also called main memory because it is the primary memory that the CPU uses when processing information. The electronic circuits used to construct this main internal RAM can be classified as dynamic RAM (DRAM), synchronized dynamic RAM (SDRAM), or static RAM (SRAM). DRAM, SDRAM, and SRAM all involve different ways of using transistors and capacitors to store data. In DRAM or SDRAM, the circuit for each bit consists of a transistor, which acts as a switch, and a capacitor, a device that can store a charge. To store the binary value 1 in a bit, DRAM places an electric charge on the capacitor. To store the binary value 0, DRAM removes all electric charge from the capacitor. The transistor is used to switch the charge onto the capacitor. When it is turned on, the transistor acts like a closed switch that allows electric current to flow into the capacitor and build up a charge. The transistor is then turned off, meaning that it acts like an open switch, leaving the charge on the capacitor. To store a 0, the charge is drained from the capacitor while the transistor is on, and then the transistor is turned off, leaving the capacitor uncharged. To read a value in a DRAM bit location, a detector circuit determines whether a charge is present or absent on the relevant capacitor.

                   DRAM is called dynamic because it is continually refreshed. The memory chips themselves cannot hold values over long periods of time. Because capacitors are imperfect, the charge slowly leaks out of them, which results in loss of the stored data. Thus, a DRAM memory system contains additional circuitry that periodically reads and rewrites each data value. This replaces the charge on the capacitors, a process known as refreshing memory. The major difference between SDRAM and DRAM arises from the way in which refresh circuitry is created. DRAM contains separate, independent circuitry to refresh memory. The refresh circuitry in SDRAM is synchronized to use the same hardware clock as the CPU. The hardware clock sends a constant stream of pulses through the CPU’s circuitry. Synchronizing the refresh circuitry with the hardware clock results in less duplication of electronics and better access coordination between the CPU and the refresh circuits.

                    In SRAM, the circuit for a bit consists of multiple transistors that hold the stored value without the need for refresh. The chief advantage of SRAM lies in its speed. A computer can access data in SRAM more quickly than it can access data in DRAM or SDRAM. However, the SRAM circuitry draws more power and generates more heat than DRAM or SDRAM. The circuitry for a SRAM bit is also larger, which means that a SRAM memory chip holds fewer bits than a DRAM chip of the same size. Therefore, SRAM is used when access speed is more important than large memory capacity or low power consumption.

                     The time it takes the CPU to transfer data to or from memory is particularly important because it determines the overall performance of the computer. The time required to read or write one bit is known as the memory access time. Current DRAM and SDRAM access times are between 30 and 80 nanoseconds (billionths of a second). SRAM access times are typically four times faster than DRAM.

                    The internal RAM on a computer is divided into locations, each of which has a unique numerical address associated with it. In some computers a memory address refers directly to a single byte in memory, while in others, an address specifies a group of four bytes called a word. Computers also exist in which a word consists of two or eight bytes, or in which a byte consists of six or ten bits.

             When a computer performs an arithmetic operation, such as addition or multiplication, the numbers used in the operation can be found in memory. The instruction code that tells the computer which operation to perform also specifies which memory address or addresses to access. An address is sent from the CPU to the main memory (RAM) over a set of wires called an address bus. Control circuits in the memory use the address to select the bits at the specified location in RAM and send a copy of the data back to the CPU over another set of wires called a data bus. Inside the CPU, the data  passes through circuits called the data path to the circuits that perform the arithmetic operation. The exact details depend on the model of the CPU. For example, some CPUs use an intermediate step in which the data is first loaded into a high-speed memory device within the CPU called a register.


Internal ROM
                                                    Read-only memory is the other type of internal memory. ROM memory is used to store items that the computer needs to execute when it is first turned on. For example, the ROM memory on a PC contains a basic set of instructions, called the basic input-output system (BIOS). The PC uses BIOS to start up the operating system. BIOS is stored on computer chips in a way that causes the information to remain even when power is turned off.

                         Information in ROM is usually permanent and cannot be erased or written over easily. A ROM is permanent if the information cannot be changed—once the ROM has been created, information can be retrieved but not changed. Newer technologies allow ROMs to be semi-permanent—that is, the information can be changed, but it takes several  seconds to make the change. For example, a FLASH memory acts like a ROM because values remain stored in memory, but the values can be changed.


External Memory

                                                         External memory can generally be classified as either magnetic or optical, or a combination called magneto-optical. A magnetic storage device, such as a computer's hard drive, uses a surface coated with material that can be magnetized in two possible ways. The surface rotates under a small electromagnet that magnetizes each spot on the surface to record a 0 or 1. To retrieve data, the surface passes under a sensor that determines whether the magnetism was set for a 0 or 1. Optical storage devices such as a compact disc (CD) player use lasers to store and retrieve information from a plastic disk. Magneto-optical memory devices use a combination of optical storage and retrieval technology coupled with a magnetic medium.