Co Unit Iv
Co Unit Iv
Memory organization: Memory hierarchy, main memory, auxiliary memory, associate memory,
cache memory.
Memory (storage device) where data can be stored. The memory unit stores the binary information
in the form of bits. Generally, memory/storage is classified into 2 categories:
• Volatile Memory: This loses its data, when power is switched off.
• Non-Volatile Memory: This is a permanent storage and does not lose any data when power
is switched off.
Memory Hierarchy:
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.
Auxiliary memory (removable memory) or secondary memory, the most common auxiliary
memory devices used in computer systems are magnetic disks and tapes. Access time is
generally 1000 times that of the main memory, hence it is at the bottom of the hierarchy.
The main memory (RAM) is the central storage unit in a computer system. It is a relatively large
and fast memory used to store programs and data during the computer operation. It 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. It is
a fastest small memory. It is placed between the CPU and main memory as illustrated in below Figure.
The cache memory access time is less than the access time of main memory by a factor of 5 to 10.
The basic operation of the cache is as follows. When the CPU needs to access memory, the cache is
examined. If the word is found (cache HIT) in the cache, it is read from the fast memory. If the word
addressed by the CPU is not found (cache MISS) in the cache, the main memory is accessed to read
the word. A block of words containing the one just accessed is then transferred from main memory
to cache memory.
The performance of cache memory is frequently measured in terms of a quantity called hit ratio.
CACHE MISS
CACHE HIT
Hit ratio=no of hits/total no of bus cycle *100
Block transfer
Cache performance: The measures that characterize the performance of a cache are the hit ratio.
Input-Output Interface:
The method that is used to transfer information between internal storage and external I/O devices is
known as I/O interface.
Input/output Interface provides a method for transferring information between processor and external
input/output devices i.e., peripherals. These Input/output interface in computer system are exists in
the form of special hardware component between the system bus and peripherals. This component is
called “interface unit” (These communication links are used to resolve the differences between CPU
and peripheral.).
A typical input-output interface between the processor and several peripherals is shown in figure
below:
Here we see that each peripheral device has an interface unit associated with it.
Now, the question arises- why Input/output Interface is required for transferring information between
processor and peripherals?
The Input/output Interface is required because there are exists many differences between the central
computer and each peripheral while transferring information. Some major differences are:
• Peripherals are electromechanical and electromagnetic devices and their manner of operation
is different from the operation of CPU and memory which is electronic device. Therefore, a
conversion of signal values may be required.
• The data transfer rate of peripherals is usually slower than the transfer rate of CPU, and
consequently a synchronisation mechanism is needed.
• Data codes and formats in peripherals differ from the word format in the CPU and Memory.
• The operating modes of peripherals are differ from each other and each must be controlled so
as not to disturb the operation of other peripherals connected to CPU.
These differences are resolved through input-output interface. As input-output interface (Interface
Unit) contain various components, each of which performs one or more vital function for smooth
transforming of information between CPU and Peripherals.
I/O BUS and Interface Module:
It defines the typical link between the processor and several peripherals.
The I/O Bus consists of data lines, address lines and control lines.
The I/O bus from the processor is attached to all peripherals interface. To communicate with a
particular device, the processor places a device address on address lines. Each Interface decodes the
address and control received from the I/O bus, interprets them for peripherals and provides signals
for the peripheral controller. It is also synchronizes the data flow and supervises the transfer between
peripheral and processor. Each peripheral has its own controller. For example, the printer controller
controls the paper motion, the print timing. The control lines are referred as I/O command. The
commands are as following:
Control command- A control command is issued to activate the peripheral and to inform it what to do.
Status command- A status command is used to test various status conditions in the interface and the
peripheral.
Data Output command- A data output command causes the interface to respond by transferring data
from the bus into one of its registers.
Data Input command- The data input command is the opposite of the data output. In this case the interface
receives on item of data from the peripheral and places it in its buffer register. I/O Versus Memory Bus
The chip select (CS) input when the interface is selected by the address bus. The two register select
inputs RS1 and RS0 are usually are connected to the two least significant lines of the address bus.
These two inputs select one of the four registers in the interface as specified in the table accompanying
the diagram. The content of the selected register is transfer into the CPU via the data bus when the
I/O read signal is enabled. The CPU transfers binary information into the selected register via the data
bus when the I/O write input is enabled.
MODES OF TRANSFER:
Data transfer between the central computer and I/O devices may be handled in a variety of modes.
Some modes use the CPU as an intermediate path; others transfer the data directly to and from the
memory unit. Data transfer to and from peripherals may be handled in one of three possible modes:
1. Programmed I/O
2. Interrupt-initiated I/O
3. Direct memory access (DMA)
Binary information received from an external device is usually stored in memory for later processing.
Information transferred from the central computer into an external device originates in the memory
unit. The CPU merely executes the 110 instructions and may accept the data temporarily, but the
ultimate source or destination is the memory unit.