Sunday 1 July 2012

C Programming : MEMORY : ROM, RAM, VIRTUAL AND CACHE

MEMORY

Internal storage areas in the computer The term memory identifies data storage that comes in the form of chips, and the word storage is used for memory that exists on tapes or disks. Moreover, the term memory is usually used as a shorthand for physical memory, which refers to the actual chips capable of holding data. Some computers also use virtual memory, which expands physical memory onto a hard disk.
Every computer comes with a certain amount of physical memory, usually referred to as main memory or RAM. You can think of main memory as an array of boxes, each of which can hold a single byte of information. A computer that has 1 megabyte of memory, therefore, can hold about 1 million bytes (or characters) of information.
Memory Manufacturers Corsair, Kingston, Rambus, Crucial, Samsung, PNY, Micron

Memory Terminology:

Memory speed -

measured in nanoseconds, this is the time to access data that is stored in memory
the lower the nanoseconds the faster the memory (2ns-80ns)

Parity

A simple error checking method use in memory correction
 ECC-Error correction code use in memory correction for newer computers

Memory Banks

A socket where memory is installed Example 4 banks will have 8MB of memory each for a total of 32MB
There are several different types of memory:
240-pin DIMM----------------------------- DDR3 SDRAM

ROM:  Read Only Memory ,  Computers almost always contain a small amount of read-only memory that holds instructions for starting up the computer. Unlike RAM, ROM cannot be written to. It is non-volatile which means once you turn off the computer the information is still there.



PROM:

short for programmable read-only memory A PROM is a memory chip on which data can be written only once. Once a program has been written onto a PROM, it remains there forever. Unlike RAM, PROM's retain their contents when the computer is turned off. The difference between a PROM and a ROM (read-only memory) is that a PROM is manufactured as blank memory, whereas a ROM is programmed during the manufacturing process. To write data onto a PROM chip, you need a special device called a PROM programmer or PROM burner. The process of programming a PROM is sometimes called burning the PROM.

EPROM: 

(erasable programmable read-only memory) is a special type of PROM that can be erased by exposing it to ultraviolet light. Once it is erased, it can be reprogrammed. An EEPROM is similar to a PROM, but requires only electricity to be erased.

EEPROM: 

Acronym for electrically erasable programmable read-only memory. Pronounced double-ee-prom or e-e-prom, an EEPROM is a special type of PROM that can be erased by exposing it to an electrical charge. Like other types of PROM, EEPROM retains its contents even when the power is turned off. Also like other types of ROM, EEPROM is not as fast as RAM. EEPROM is similar to flash memory (sometimes called flash EEPROM). The principal difference is that EEPROM requires data to be written or erased one byte at a time whereas flash memory allows data to be written or erased in blocks. This makes flash memory faster.

RAM: 

(Random Access Memory) is a temporary (Volatile) storage area utilized by the CPU. Before a program can be ran the program is loaded into the memory which allows the CPU direct access to the program.

2 Types of RAM:

SRAM Short for static random access memory, and pronounced ess-ram. SRAM is a type of memory that is faster and more reliable than the more common DRAM (dynamic RAM). The term static is derived from the fact that it doesn't need to be refreshed like dynamic RAM.
SRAM is often used only as a memory cache usually found in the CPU (L1, L2 and L3 Cache)

DRAM stands for dynamic random access memory, a type of memory used in most personal computers.

Types of DRAM Packages and DRAM Memory

LAPTOP MEMORY
(72, 144, 200) SO-DIMM

SO-DIMM Short for Small Outline DIMM, a small version of a DIMM used commonly in notebook computers. 72 supports 32bit and 144 and 200 SO-DIMM pins supports a full 64-bit transfer.
(144, 172) Micro-DIMM

Micro-DIMM
Short for Micro Dual Inline Memory Module, a competing memory used on laptops, mostly supports 144 and 172 pins.

SIMM Acronym for single in-line memory module, a small circuit board that can hold a group of memory chips. Typically, SIMM's holds up 8 (on Macintoshes) or 9 (on PCs) RAM chips. On PCs, the ninth chip is often used for parity error checking. Unlike memory chips, SIMM's is measured in bytes rather than bits. SIMM's is easier to install than individual memory chips. A SIMM is either 30 or 72 pins.
30 pin SIMM (Usually FPM or EDO RAM)
FPM RAM Short for Fast Page Mode RAM, a type of Dynamic RAM (DRAM) that allows faster access to data in the same row or page. Page-mode memory works by eliminating the need for a row address if data is located in the row previously accessed. It is sometimes called page mode memory.
 
72 pin SIMM (EDO RAM)

EDO DRAM Short for Extended Data Output Dynamic Random Access Memory, a type of DRAM that is faster than conventional DRAM. Unlike conventional DRAM which can only access one block of data at a time, EDO RAM can start fetching the next block of memory at the same time that it sends the previous block to the CPU.

DIMM Short for dual in-line memory module, a small circuit board that holds memory chips. A single in-line memory module (SIMM) has a 32-bit path to the memory chips whereas a DIMM has 64-bit path. Because the Pentium processor requires a 64-bit path to memory, you need to install SIMM's two at a time. With DIMM's, you can install memory one DIMM at a time. A DIMM contains 168 pins.
168 pin DIMM (SDRAM)
SDRAM Short for Synchronous DRAM, a new type of DRAM that can run at much higher clock speeds than conventional memory. SDRAM actually synchronizes itself with the CPU's bus and is capable of running at 133 MHz, about three times faster than conventional FPM RAM, and about twice as fast EDO DRAM . SDRAM is replacing EDO DRAM in many newer computers
SDRAM delivers data in high speed burst
184 pin DIMM (DDR-SDRAM)

DDR SDRAM Short for Double Data Rate-Synchronous DRAM, a type of SDRAM that supports data transfers on both edges of each clock cycle, effectively doubling the memory chip's data throughput. DDR-SDRAM is also called SDRAM II.
240 DIMM (DDR2-SDRAM)
DDR2-SDRAM Short for Double Data Rate Synchronous DRAM 2 is a type of DDR that supports
higher's speeds than it's predecessor DDR SDRAM
240 DIMM (DDR3-SDRAM)
DDR3-SDRAM Short for Double Data Rate Synchronous DRAM 3 is the newest type of DDR that supports
the fastest speed of all the SDRAM memory
184 pin RIMM (RDRAM)

RIMM Rambus Inline Memory Module, The memory module used with RDRAM chips. It is similar to a DIMM package but uses different pin settings. Rambus trademarked the term RIMM as an entire word. It is the term used for a module using Rambus technology. It is sometimes incorrectly used as an acronym for Rambus Inline Memory Module. A RIMM contains 184 or 232pins. Note must use all sockets in RIMM installation or use C_RIMM to terminate banks
232 pin RIMM (RDRAM)
RDRAM Short for Rambus DRAM, a type of memory (DRAM) developed by Rambus, Inc.
In 1997, Intel announced that it would license the Rambus technology for use on its future motherboards, thus making it the likely de facto standard for memory architectures.

SIMM and DIMM Sockets:






  


Virtual Memory:

A part of the hard disk can be used as a Virtual Memory. Generally the size of the virtual memory in a computer is 2 or 2.5 times greater than the RAM memory size in that computer.

Assume you are starting an application. But there are already many programs started previously that is occupying the RAM space. And the remaining space in RAM is not sufficient to use the new application that you are starting. Then the virtual memory is used. Now the Operating System comes into play. It decides which are the applications that are not currently used and then moves them from the RAM memory to the Virtual memory in Hard Disk. Therefore the RAM is now free and the new application can occupy the space and be started.

If the program that is moved to the virtual memory is used again then the Operating System brings that application back from virtual memory to the RAM and some other idle application is moved to the virtual memory.

Therefore the virtual memory is also referred to as Swap memory.

Cache:

 A part of the main memory (RAM) can be used as Cache or it can be separate chip.

The commands that are often used, or data often used will be kept in this static RAM. This static RAM is called Cache memory.

But there are also Cache memory that comes independently from RAM. Level 1 (L1) and Level 2 (L2) are types of cache memory. The cache integrated inside the microprocessor is categorised as L1 cache. For example Pentium Processor comes with 16KB cache. This is SRAM.

The cache between the Microprocessor and the RAM is L2 Cache. This is also SRAM category.

6 comments:

  1. can i have a c coding for finding a RAM & cpu memory usage of our system???PLEAse

    ReplyDelete
  2. I UPLOAD A PROGRAM FOR YOU WHICH SHOWZ THE MEMORY USES ... :)

    ReplyDelete
  3. I have learn some good stuff here. Certainly worth bookmarking
    for revisiting. I wonder how so much effort you put to make this sort of excellent informative website.


    My weblog discover more

    ReplyDelete
  4. I leave a response when I appreciate a post on a website or if I have something to contribute to the discussion.
    Usually it is caused by the passion communicated in the article I looked at.

    And on this article "C Programming : MEMORY : ROM, RAM, VIRTUAL AND CACHE".
    I was actually moved enough to post a commenta response ;) I
    actually do have 2 questions for you if it's okay. Is it simply me or do a few of the responses look like they are coming from brain dead visitors? :-P And, if you are writing at other social sites, I'd like to keep up with
    everything new you have to post. Would you
    make a list all of all your shared pages like your
    Facebook page, twitter feed, or linkedin profile?

    ReplyDelete
    Replies
    1. many pages below on image and i have less time for doing everything ..

      Delete