Random Access Memory (RAM)

     RAM holds the instructions and data in use by the operating system and software applications before and after they pass to the CPU. RAM is volitile; to hold its contents, it must have a steady power stream. RAM is the primary memory on the PC and is generally installed directly on the motherboard.

Dynamic RAM (DRAM)

     DRAM is the most commonly used type of memory. DRAM requires constant refreshing or it loses its contents. DRAM must be refreshed every two milliseconds. A special refresh logic circuit reads and then rewrites the contents of each DRAM address, whether it is in use or not.

     DRAM is the slowest of the memories, clocking in with access speeds around 50 nanoseconds (ns) or higher (higher is slower). DRAM comes in three popular technologies: Fast page mode (FPM), extended data out (EDO), and burst EDO. Recent additions are synchronous DRAM (SDRAM) and video RAM (VRAM). Which technologies can be used on a particular system is controlled by its processor and motherboard.
Static RAM (SRAM)

     SRAM is static, which means it holds its charge and doesn't need to be refreshed. As long as it has a power stream, it holds its contents. SDRAM also has very fast access times, in the range of 15-20ns. The only problem with SDRAM is that it's physically two pins longer in size than DRAM and because it's a more complex technology, it costs a lot more.

     SRAM is available as either synchronous or asynchronous. Synchronous SRAM uses the system clock to coordinate its signals with the CPU, and asynchronous doesn't. Because of its high cost and bigger size, SRAM is used primarily for memory cache.

     The SRAM that is included along with the cache controller is internal, or level 1 (L1), cache. Many newer systems now include additional SRAM, which is called external, or level 2 (L2), cache. It is common for a system to have 256K of internal cache and another 256K of level 2 cache.


Read-Only Memory (ROM)

     ROM is the nonvolatile memory used to permanently store instructions and data that can't be altered in normal operations. Virtually all ROM chips are packaged in a DIP form.


Modern Memory Packaging

SIMMs

     Single Inline Memory Modules are made up of surface mount SOJ and TSOP DRAM memory soldered on a small circuit board that has either 30-pin or 72-pin connectors. SIMM's capacity range form 1 to 16MB in either a one-sided or two-sided style. SIMMs are currently the most common memory type in use. SIMMs must be installed in pairs. Each bank of memory for a SIMM has two sockets. You must fill the bank before moving on to another bank.

DIMMs

     Dual Inline Memory Modules are emerging as the new standard for larger PCs. A DIMM has 168 discrete contact pins as opposed to the 30 and 72 pins of the SIMM. DIMMs come in different voltages: 3.3V and 5.0V, and as buffered or unbuffered, which yields four possible combinations. The current standard is the 3.3V unbuffered DIMM that is used by most computers.


Memory Integrity

     To ensure memory integrity, two methods are used to ensure the integrity of data stored in memory: parity and Error Correction Code (ECC). The memory controller oversees the movement of data into and out of memory and, in doing so, determines the type of data integrity checking used. In both parity and ECC, the memory controller is key to the process.

Parity Memory

     DRAM memory that implements parity checking has an additional bit for every 8 bits of data. The extra bit allows the system to verify the data format using two parity protocols - odd parity and even parity - that work very much the same. Parity is achieved when the total number of one bits in a byte add up to either an even or odd number, depending on the parity technique.

Nonparity Memory

     Because parity and ECC memory are more expensive than nonparity memory, nonparity memory is much more common. Nonparity systems don't perform data integrity checks. You can't use nonparity memory in a parity system. Parity memory works fine in nonparity systems - the extra bit is ignored.

Error Correction Code

     Error Correction Code (ECC) is a data integrity method that is used in high end PCs and file servers. The difference between the parity method is that ECC can both detect and correct errors.


Logical Memory Layout

     How memory is divided into its logical types may be the most important thing you should know about memory, beyond the terms DRAM and ROM.

Real Mode and Protected Mode

     Real-mode memory addressing means that software, such as DOS or DOS applications, can address only 1MB of RAM. Protected-mode memory addressing means that a program is limited to its own memory space allocation, but it can access memory above 1MB. Protected-mode gets its name because it is protected from other programs desiring its memory space.

     Conventional memory is the first 640K of system memory. It is used by standard DOS programs, device drivers, TSRs, and anything that runs on standard DOS.

     Upper Memory Area is the upper 384K of the first MB of system memory. This area is typically allocated to special purposes such as BIOS ROM shadowing, adapter ROMs, and video RAM. Upper memory is also called expanded memory or reserved memory.

     Upper Memory was redesignated expanded memory and special drivers were created to allow its use. The primary device driver is EMM386.EXE. This program frees up conventional memory by allowing unused portions of the reserved memory area to be used for DOS drivers and memory-resident programs. To implement the EMM386.EXE driver, add the following to the CONFIG.SYS file:
DEVICE=C:\DOS\EMM386.EXE
DOS=UMB

Where EMB stands for Upper Memory Blocks. If you don't want to run EMS emulation, but you do want the ability to load drivers and TSRs to upper memory, the NOEMS option can be added.

DEVICE=C:\DOS\EMM386.EXE NOEMS
DOS=UMB
     High Memory Area is the first 64K of the extended memory area. It is also the only part of extended memory that a program in real mode can access. This space is normally used by DOS after the following specifications is included in the CONFIG.SYS file:
DOS=HIGH
The above statement tells DOS to load most of its code in HMA instead of in conventional memory, freeing about 45K of conventional memory space for other programs.

     Extended Memory is all the memory above the first MB. Extended memory can't be accessed beyond its first 64K in real mode. All systems has an upper memory limit for extended memory that ranges from 16MB on the 286 to up to 4GB on a Pentium.

     HIMEM.SYS can allow DOS to access extended memory in protected mode. To use the HIMEM.SYS driver, add the following to the CONFIG.SYS file:
DEVICE=HIMEM.SYS
DEVICE=EMM386.EXE
DOS=HIGH,UMB
All versions of Windows 3.x need HIMEM.SYS running to access extended memory.

Optimizing Memory

     The LOADHIGH and DEVICEHIGH commands also put upper memory blocks to use. The LOADHIGH and LH commands are used on the DOS command line or in the AUTOEXEC.BAT to start a program and direct the operating system to place it into the upper memory area. The LOADHIGH statements only work if HIMEM.SYS and EMM386.EXE device statements have been included in the CONFIG.SYS file.
DEVICE=HIMEM.SYS DEVICE=EMM386.EXE DOS=HIGH,UMB DEVICEHIGH=C:\MOUSE\MOUSE.SYS
     You can use MEMMAKER in MS-DOS 6.0 or later to manage UMB and extended memory. It scans the CONFIG.SYS and AUTOEXEC.BAT files and automatically edits or inserts the commands needed. MEMMAKER also decides if a device driver should be placed in high or left in conventional memory.

DOS Memory Management
Memory BlockDescription
Conventional MemoryArea between 0 and 640 KB.
Upper Memory (UMA)Area between 640 and 1024 KB.
Upper Memory Blocks (UMB)Unused spaces of upper memory divided into blocks, unlike expanded and extended memory, DOS can run programs here.
Expanded Memory (EMS)Uses a 64 KB window from memory, usually upper memory to access and can provide up to 32 MB of additional memory.
Extended Memory (XMS)RAM above the 1 MB address, accessed with HIMEM.SYS.
High Memory Area (HMA)The first 64 KB of XMS, software driver called "A20 handler" must be used to access this. DOS uses HIMEM.SYS for this. DOS is loaded here to free conventional memory.
Virtual MemoryAllows hard drive to simulate RAM. Virtual memory is made up of RAM and a swap file, paged out to the hard drive.
Shadow RAMThis feature rewrites ROM BIOS to extended RAM memory (between 640 K boundary and 1 MB).