Chapter 4 Coa
Chapter 4 Coa
The memory unit that communicates directly with the CPU is called the Main
Memory (or Primary memory).
Devices that provide backup storage are called auxiliary Memory (or Secondary).
Only programs and data currently needed by the processor reside in Main memory. All other
information is stored in Auxiliary memory and transferred to main memory when needed.
The Memory hierarchy system consists of all storage devices employed in a computer system
from the slow but high capacity auxiliary memory to a relatively faster main memory, to an
even smaller and faster cache memory accessible to the high speed processing logic.
When programs not residing in main memory are 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 for currently used programs and data.
The cache memory is employed in computer systems to compensate for the speed differential
between main memory access time and processor logic.
The cache is used for storing segments of programs currently being executed in the CPU and
temporary data frequently needed in the present calculations.
By making programs and data available at a rapid rate, it is possible to increase the
performance rate of the computer using cache memory.
While the I/O processor manages data transfers between auxiliary memory and main
memory, the cache organization is concerned with the transfer of information between main
memory and CPU. Thus each is involved with a different level in the memory hierarchy is
economics.
It 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. The principal technology
used for the main memory is based on semiconductor integrated circuits. Integrated circuit
RAM chips are available in two possible operating modes, static and dynamic.
The static RAM (SRAM) consists essentially of internal flip flops that store the binary
information. The stored information remains valid as long as power is applied to the unit.
The dynamic RAM (DRAM) stores the binary information in the form of electric charges that
are applied to capacitors. The capacitors are provided inside the chip by MOS transistors.
The stored charge on the capacitors tends to discharge with time and the capacitors must be
periodically recharged by refreshing the dynamic memory. Refreshing is done by cycling
through the words every few milliseconds to restore the decaying charge. The dynamic RAM
offers reduced power consumption and larger storage capacity in a single memory chip. The
static RAM is easier to use and has shorter read and write cycles.
The ROM portion of main memory is needed for storing an initial program called a
Bootstrap Loader. The bootstrap loader is a program whose function is to start the computer
software operating when power is turned on. The contents of ROM remain unchanged after
power is turned off and on again. The start-up of a computer consists of turning the power on
and starting the execution of an initial program. Thus when power is turned on, the hardware
of the computer sets the program counter to the first address of the bootstrap loader. The
bootstrap program loads a portion of the operating system from disk to main memory and
control then transferred to the operating system, which prepares the computer for general use.
The designer of a computer system must calculate the amount of memory required for the
particular application and assign it to either RAM or ROM.
The interconnection between memory and processor is then established from knowledge of
the size of memory needed and the type of RAM and ROM chips available.
The addressing of memory can be established by means of a table that specifies the memory
address assigned to each chip. The table, called a memory address map, is a pictorial
representation of assigned address space for each chip in the system.
The cache is the fastest component in the memory hierarchy and approaches the speed of
CPU component.
It is placed between the CPU and main memory.
When CPU needs to access memory, the cache is examined. If the word is found in the
cache, it is read from the fast memory. If the word addressed by the CPU is not found 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. When the CPU refers to memory and finds the word in cache, it is said to produce a hit.
Otherwise, it is a miss.
Hit ratio = hit / (hit+miss)
I. Associative mapping
The fastest and most flexible cache organization uses an associative memory.
The associative memory stores both the address and data of the memory word.
This permits any location in cache to store ant word from main memory.
137
The internal organization of the words in the cache memory is as shown in the above figure.
Each word in cache consists of the data word and its associated tag. When a new word is first
brought into the cache, the tag bits are stored alongside the data bits. When the CPU
generates a memory request, the index field is used for the address to access the cache.
The tag field of the CPU address is compared with the tag in the word read from the cache. If
the two tags match, there is a hit and the desired data word is in cache. If there is no match,
there is a miss and the required word is read from main memory. It is then the cache together
with the new tag, replacing the previous value.
The disadvantage of direct mapping is that the hit ratio can drop considerably if two or more
words whose addresses have the same index but different tags are accessed repeatedly.
138
The words stored at address 01000 and 02000 of main memory are stored in cache
memory in index address 000. Similarly, the words at addresses 02777 and 00777
are stored in cache at index address 777. When the CPU generates a memory
request, the index value of the address is used to access the cache. The tag field
of the CPU address is then compared withboth tags in the cache to determine if a
match occurs.
The hit ratio will improve as the set size increase because more words with the
same index but different tags can reside in cache. However, an increase in the set
size increases the number of bits in words of cache and requires more complex
comparison logic.
Hardware Organization:
The block diagram of an associative memory is shown in the Figure. It consists of
a memory array and logic form words with n bits per word.
6
Each word in memory is compared in parallel with the content of the argument
register. The words that match the bits of the argument register set a corresponding
bit in the match register.
The key register provides a mask for choosing a particular field or key in the
argument word. The entire argument is compared with each memory word if the
key register contains all 1’s. Otherwise, only those bits in the argument that have
1’s in their corresponding position of thekey register are compared.
Stored bits are detected by a change in magnetic field produced by a recorded spot
on the surface as it passes through a read head.
Magnetic disks:
7
Figure 4.8: Magnetic Disk
Magnetic Tape:
Magnetic tapes are used for backup memory. A magnetic tapes transport consists
of the electrical, mechanical and electronic components to provide the parts and
control mechanism for a magnetic tape unit. The tape itself is a strip of plastic
coated with a magnetic recording medium.
Bits are recorded as magnetic sports on the tape along several tracks. Read/write heads are
mounted one in each track so that data can be recorded and read as a sequence of characters.
Magnetic tape units can be stopped, started to move forward or in reverse, or can be re-
wound.
However, they cannot be started or stopped fast enough between individual characters. For
this reason, information is recorded in blocks referred to as records.
8
Optical disks:
Optical disks are used for backup memory. Information is written to or read from
an optical disk using laser beam. It has very high storing capacity as compared to
magnetic floppy disks. It has very long life. The capacity of optical disks varies
from 650 MB to 17 GB. Dvds of 15, 25, 30 and 50 GB capacity etc., an optical
disk is a direct access device. As its read /write head does not touch the disk
surface, there is no disk wear and problem of head crash. Elaborate error checking
codes can be used as there is no problem of space because of its high storage
capacity.
The greatest drawback of an optical disk drive system is its large access time as
compared to magnetic hard disk drive. An optical disk system the drive has to
move on a sizable optical assembly across the disk surface. This results in an
increased access time.
Types of optical disks: CD(compact disk), CD-R(recordable), CD-
RW(read/write), DVD(digital versatile disk), DVD-R, DVD-RW.
Figure 4.9: Relation between address and memory space in a virtual memory system
9
Figure 4.10: Memory table for mapping a virtual address
10