Memory Hierarchy, Cache Memory, Direct Memory Access
Memory Hierarchy, Cache Memory, Direct Memory Access
The total memory capacity of a computer can be visualized by hierarchy of components. The
memory hierarchy system consists of all storage devices contained in a computer system from
the slow Auxiliary Memory to fast Main Memory and to smaller Cache memory.
Auxillary memory access time is generally 1000 times that of the main memory, hence it is
at the bottom of the hierarchy.
The main memory occupies the central position because it is equipped to communicate
directly with the CPU and with auxiliary memory devices through Input/output processor
(I/O).
When the program not residing in main memory is needed by the CPU, they are brought in
from auxiliary memory. Programs not currently needed in main memory are transferred into
auxiliary memory to provide space in main memory for other programs that are currently in
use.
The cache memory is used to store program data which is currently being executed in the
CPU. Approximate access time ratio between cache memory and main memory is about 1 to
7~10
DMA stands for “Direct Memory Access” and is a method of transferring data from
the computer‘s RAM to another part of the computer without processing it using the CPU.
While most data that is input or output from your computer is processed by the CPU, some
data does not require processing, or can be processed by another device.
In these situations, DMA can save processing time and is a more efficient way to move data
from the computer’s memory to other devices. In order for devices to use
direct memory access, they must be assigned to a DMA channel. Each type of port on a
computer has a set of DMA channels that can be assigned to each connected device. For
example, a PCI controller and a hard drive controller each have their own set of DMA
channels.
For example, a sound card may need to access data stored in the computer’s RAM, but since
it can process the data itself, it may use DMA to bypass the CPU. Video cards that support
DMA can also access the system memory and process graphics without needing the CPU.
Ultra DMA hard drives use DMA to transfer data faster than previous hard drives that
required the data to first be run through the CPU.
An alternative to DMA is the Programmed Input/Output (PIO) interface in which all data
transmitted between devices goes through the processor. A newer protocol for the ATAIIDE
interface is Ultra DMA, which provides a burst data transfer rate up to 33 mbps. Hard drives
that come with Ultra DMAl33 also support PIO modes 1, 3, and 4, and multiword DMA
mode 2 at 16.6 mbps.
DMA Transfer Types
In this mode block of data from one memory address is moved to another memory
address. In this mode current address register of channel 0 is used to point the source address
and the current address register of channel is used to point the destination address in the first
transfer cycle, data byte from the source address is loaded in the temporary register of the
DMA controller and in the next transfer cycle the data from the temporary register is stored in
the memory pointed by destination address. After each data transfer current
address registers are decremented or incremented according to current settings. The channel 1
current word count register is also decremented by 1 after each data transfer. When the word
count of channel 1 goes to FFFFH, a TC is generated which activates EOP output terminating
the DMA service.