Co PDF
Co PDF
Co PDF
Memory Hierarchy, Main Memory, Auxiliary Memory, Associative Memory, Cache Memory, Virtual
Memory.
The memory unit is an essential component in any digital computer since it is needed for storing
programs and data. The memory unit is communicates directly with the CPU is called “Main Memory”.
Only programs and data which are currently needed by the processor is reside in main memory. Initially
programs are stored in auxiliary memory that means all the information is stored in auxiliary memory
and transferred into main memory when needed.
The devices that provide backup storage are called “Auxiliary Memory”. The most commonly
used auxiliary memory devices in digital computers are magnetic disks and magnetic tapes. They are
used for storing system programs, large data files and other backup information.
Cache is a fast access and small capacity memory that should hold those information which are most
likely to be accessed. I/O processor is an interface between auxiliary memory and main memory. The
main memory and cache memory are directly connected to CPU. The block diagram is shown below:
Suppose a typical cache memory may have an access time of 100ns, while main memory access
time may be 700. i. e 1:7 ratio between cache and main memory. Auxiliary memory access time is
usually 1000 times that of main memory. Block size in cache memory is 1 to 16 words and auxiliary
memory is 256 to 2048 words.
In a memory hierarchy system, programs and data are first stored in auxiliary memory. Portions
of a programs or data are brought into main memory when they are needed by the CPU. Many
operating systems performs multiple operation in CPU at a time is called as “Multiprogramming”.
Memory hierarchy block diagram is shown below:
The Static RAM consists of an internal flip-flop that stores the binary information. The stored
information is valid as long as power is applied to the unit.
The Dynamic RAM stores the binary information in Capacitors. The capacitors are inside chips by MOS
transistors. So they need electrical charges sequentially or periodically.
Most of the main memories in general purpose computers made up of RAM integrated circuit chips, but
a portion of the memory may be constructed with ROM chips.
The ROM portion of main memory is needed for storing an initial program called “Boot Strap loader”. It
is an initial program to start the computer software operating when power is turned on.
It does not require electrical charge. It requires electrical charges to charge periodically.
The information is valid until the power supply is The information is valid before computer is turn
applied to unit. off.
It is easier to use and has shorter read and write It is a large storage capacity in a single memory
cycles. Because size of SRAM is less. unit. It's access time is slow.
It implements cache memory It implements main memory. Most of PC's are
DRAMs
RAM chip is better suited for communication with the CPU. If it has one or more control inputs
that select the chips (CS1, CS2) when needed. One feature is bidirectional data bus that allows the
transfer of data either from memory to CPU during read operation; or from CPU to Memory during
“write operation”. RAM and ROM chips are available in a variety of sizes. The block diagram for RAM
and its list of functional operations is shown below
The capacity of ROM is 512 Bytes * 8 bits and ROM has nine address lines, two chips (CS1, CS2’).
The ROM have only one directional data transfer. The block diagram of ROM is shown below
The memory address map table consists of RAM, ROM, chips, and hexadecimal address. The memory
address table is shown in below with different operations:
RAM and ROM chips are connected to a CPU through the data and address buses. The RAM selects
seven low-order bits of the address bus to select one of 128 possible bytes. The particular RAM chip
selected is determined from lines 8 and 9 are equal to 00, the first RAM chip is selected. When 01, the
second RAM chip is selected, and so on. The RD and WR outputs from the micro processor are applied to
the inputs of each RAM chip. The selection between RAM and ROM is achieved through bus line10. The
diagram for memory connection to CPU is below:
Access Time: The average time required to reach a storage location in memory and obtain its contents is
called as “access time”.
Seek Time: Time to position heads over cylinder containing target sector.
Rotational Time: Waiting time for rotation from first bit of target sector to pass under read write head.
Transfer Time: The time to read bits in the target time while transferring data.
Therefore, Taccess time= Tavg seek time + Tavg rotational time + Tavg transfer time
Example:
What is the access time from given data Tavg seek time = 6ms; Rotation per minute (RPM)=7200;
avg number of sectors is = 400.
Solution: Given that Tavg seek time=6ms; RPM=7200; and avg number of sectors = 400
= 4.1 ms
= 0.02 ms
therefore Taccess = Tavg seek time + Tavg rotational time + Tavg transfer time;
A magnetic disk is a circular plate constructed of metal or plastic coated with magnetic material
often both sides of the disk are used and several disks may be stacked on one spindle with
read/write heads available on each surface.
Each track consists of sectors separated by gaps. Sectors store byte of information.
Bits are stored in the magnetized surface in spots along concentric circles called “Tracks”
The tracks are commonly sub divided into sectors. Each sector consists of bytes of information.
Disks are permanently attached to the unit are called “Hard Disk”.
A disk drive with removable disk is called as “Floppy Disk, CD-Disk”. The block diagram for magnetic
disk is shown below
The magnetic tape is coated with plastic with a magnetic recording medium.
Bits are stored in recorded magnetic spots on the tape along several tracks.
The record information is automatically removed after some period of when not in use.
Magnetic tapes data can be stopped, started to move forward or in reverse, or can be rewound.
The information is recorded in blocks.
Hardware Organization
The block diagram of an associative memory consists of a memory array and logic for w words
with n bits per word. The argument register A and key register K each have n bits, one for each
bit of a word. The match register M has m bits, one for each memory word. 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 depends
on key register.
If the key register contains one then the entire word is compared with argument
register; suppose both the values are equal match found else match not found. Otherwise (k=0)
it will not perform search operation on argument register and word.
Computer Organization(R13) DEPT OF CSE Page 8
Associative memory of m words and n cells
The relation between the memory array and external registers in an associative memory with
individual cell representation is shown below. Each cell have n number of bits and m number of
words. The word is denoted by C symbol. Each cell in m words is denoted by C ij where j is a
middle bit in word i. The match logic is denoted by Mi, where i=1,2,3…….n.
Locality of Reference: The reference to memory at any given interval of time tends to be
confined within a few localized areas in memory. This phenomenon is called as “Property of
locality of reference”.
Cache Hit: When the CPU refers to memory and finds the word in cache memory.
Cache Miss When the CPU refers to memory and the word is not found in cache memory.
In the above diagram, the CPU communicates with both memories. It first sends a 15-bit
address to cache. If there is a hit, the CPU accepts the 12-bit data from cache. If there is a miss,
the CPU reads the word from main memory and the word is then transferred to cache. All the
memory accesses are directly communicates with cache.
The associative memory implements a mapping table stored in memory. The mapping table
consists of both address and content of the memory. The cache memory represents bits in octal
format. The size of cache memory is 512 * 12; here it contains 12 data lines and 512 is the
address lines. So 512 = 2^9 i.e 9 address lines in cache memory. The octal format of 12 data bits
takes 4 digits and 9 address lines takes 3 digits.
If the address is found, the corresponding 12 bit data is read and sent to the CPU. If no match
occurs, the main memory is accessed for the word. The address-data pair is then transferred to
the associative cache memory.
Direct mapping cache organization Direct mapping cache with block size of 8 words
In the Direct mapping cache diagram, the index is divided into two parts: the block field and the
word field. In a 512-word cache there are 64 blocks of 8 words each, since 64 * 8 = 512. The
block number is specified with a 6-bit field and the word within the block is specified with a 3-
bit field.
Drawback:
It is not allowed two words with the same index in their address but with different tag
values cannot reside in cache memory at the same time.
An important aspect of cache organization is concerned with memory write requests. When the
CPU finds a word in cache during a read operation, the main memory is not involved in the
transfer. However, if the operation is a write, there are two ways that the system can proceed.
Write Through Policy: In this method, both cache memory and main memory areas are
updated at a same time that means operations are performed parallel.
Cache Initialization: In cache memory initially cache memory is empty, that means no valid
data. After some operations it has some valid data.
Address space and memory space split into groups of 1KB words
The memory-page table consists of eight words, one for each page. The address in the page
table denotes the page number and the content of the word gives the block number where that
page is stored in main memory. The table shows that pages 1,2,5 and 6 are now available in
main memory in blocks 3,0,1, and 2 respectively. A presence bit in each location indicates
whether data is present or not in pages. In virtual memory, 10 bits are used for page data and 3
bits are used for size of pages. Similarly in main memory, 10 bits for data block and 2 bits for
block size. The organization of the memory mapping table in a paged system is shown in below.
1: which page in main memory ought to be removed to make room for a new page.
2: when a new page is to be transferred from auxiliary memory to main memory.
3: where the page is to be placed in main memory.
Suppose a page is not in main memory is called “page fault”. Then we brought data
from auxiliary memory. It is followed 2 page replacement algorithms LRU and FIFO.
The FIFO (First in first out) algorithm selects for replacement the page that has been in memory
the longest time. Each time page is loaded into memory, its identification number is pushed
into a FIFO stack. When FIFO stack is full then remove first inserted page element first.
The LRU (least recently used) policy is more difficult to implement but has been more
attractive on the assumption that the least recently page as in FIFO. When LRU stack is full then
remove least element first.
Cache memory stores data in block or line Virtual memory stores data in Pages
In cache memory, if data is found- cache hit Here, If data is found – Page hit else data is
else cache miss. not found – Page fault.
It has Associative mapping, Direct mapping, It have only Fully Associative mapping.
and set-Associative mapping.
Cache memory follows LRU Page replacement Virtual memory follows LRU and FIFO Page
algorithms. replacement algorithms.
It uses write through and write back policy. It uses only write back policy.
A.SUNEETHA M.Tech(Ph.D)
Asst.Professor
CSE Department
The I/O command is a function code and is in essence an instruction that is executed in the
interface and it is attached to peripheral unit. There are 4 types of interfaces: control command, status
command, data output, and input.
Control command: To control the peripheral and interface operations.
Status command: To test the various status conditions in the interface and peripherals.
Data output command: To transfer the data from the bus into one of its registers.
Input command: It is opposite of the data output.
1: Use two separate buses, one for memory and the other for I/O.
2: Use one common bus for both memory and I/O but have separate control lines for each.
3: Use one common bus for both memory and I/O with common control lines.
The purpose of IOP is to provide an independent pathway for the transfer of information between
external devices and internal memory is shown in below diagram.
In the isolated I/O configuration, the CPU has distinct inputs and output instructions, and each
of these instructions is associated with the address of an interface register. The isolated I/O method
isolates memory and I/O addresses so that memory address values are not affected by the interface
register. The other alternative is to use the same address space for both memory and I/O. This is the
case in computers that employ only one set for read and write signals and do not distinguish between
memory the and I/O address. This configuration is called as memory-mapped I/O. This reduces the
memory address without using an interface register. The CPU can manipulate I/O instructions and
memory reference instructions data directly within memory unit.
Sequence of events
Source initiated data transfer using handshaking
Destination initiated transfer using hand shaking
In the destination initiated transfer using hand shaking method, first ready for data is
active then data on data bus and check whether data is valid or not. Later it transfers data from
source to destination after it disables ready for data and data valid. It is shown in below
diagrams.
The chip selection and the read and write control lines communicate with the CPU.
When chip selection (CS) input is 1 then it performs operations. The register selection (RS) is
associated with the read (RD) and write (WR) controls. Two registers are write-only and two are
read-only. It is listed in below diagram.
The CPU initializes the DMA by sending the following information through the data bus:
1. The starting address of the memory block where data are available (read) and where
data to store (write).
2. The word count, which is the number of words in the memory block.
3. Control to specify the mode of transfer such as read or write.
4. A control to start the DMA transfer.
Each interrupt service routine must have an initial and final set of operations for
controlling the registers in the hardware interrupt system like clear lower-level mask
register, clear IST bit, set IEN bit and proceed service routine. Finally save the contents
of process register.
www.specworld.in 1 www.smartzworld.com
www.jntuworldupdates.org
www.specworld.in 2 www.smartzworld.com
www.jntuworldupdates.org
www.specworld.in 3 www.smartzworld.com
www.jntuworldupdates.org
www.specworld.in 4 www.smartzworld.com
www.jntuworldupdates.org
www.specworld.in 5 www.smartzworld.com
www.jntuworldupdates.org
www.specworld.in 6 www.smartzworld.com
www.jntuworldupdates.org
www.specworld.in 7 www.smartzworld.com
www.jntuworldupdates.org
www.specworld.in 8 www.smartzworld.com
www.jntuworldupdates.org
www.specworld.in 9 www.smartzworld.com
www.jntuworldupdates.org
www.specworld.in 10 www.smartzworld.com
www.jntuworldupdates.org
www.specworld.in 11 www.smartzworld.com
www.jntuworldupdates.org
www.specworld.in 12 www.smartzworld.com
www.jntuworldupdates.org
www.specworld.in 13 www.smartzworld.com
www.jntuworldupdates.org
www.specworld.in 14 www.smartzworld.com
www.jntuworldupdates.org
www.specworld.in 15 www.smartzworld.com
www.jntuworldupdates.org
www.specworld.in 16 www.smartzworld.com
www.jntuworldupdates.org
www.specworld.in 17 www.smartzworld.com
www.jntuworldupdates.org
www.specworld.in 18 www.smartzworld.com
www.jntuworldupdates.org
www.specworld.in 19 www.smartzworld.com
www.jntuworldupdates.org
www.specworld.in 20 www.smartzworld.com
www.jntuworldupdates.org
www.specworld.in 21 www.smartzworld.com
www.jntuworldupdates.org
www.specworld.in 22 www.smartzworld.com
www.jntuworldupdates.org
www.specworld.in 23 www.smartzworld.com
www.jntuworldupdates.org
www.specworld.in 24 www.smartzworld.com
www.jntuworldupdates.org
www.specworld.in 25 www.smartzworld.com
www.jntuworldupdates.org
www.specworld.in 26 www.smartzworld.com
www.jntuworldupdates.org
www.specworld.in 27 www.smartzworld.com
www.jntuworldupdates.org
www.specworld.in 28 www.smartzworld.com
www.jntuworldupdates.org
www.specworld.in 29 www.smartzworld.com
www.jntuworldupdates.org
www.specworld.in 30 www.smartzworld.com
www.jntuworldupdates.org
www.specworld.in 31 www.smartzworld.com
www.jntuworldupdates.org
www.specworld.in 32 www.smartzworld.com
www.jntuworldupdates.org
www.specworld.in 33 www.smartzworld.com
www.jntuworldupdates.org
www.specworld.in 34 www.smartzworld.com
www.jntuworldupdates.org
www.specworld.in 35 www.smartzworld.com
www.jntuworldupdates.org
www.specworld.in 36 www.smartzworld.com
www.jntuworldupdates.org
www.specworld.in 37 www.smartzworld.com
www.jntuworldupdates.org
www.specworld.in 38 www.smartzworld.com
www.jntuworldupdates.org
www.specworld.in 39 www.smartzworld.com
www.jntuworldupdates.org
www.specworld.in 40 www.smartzworld.com
www.jntuworldupdates.org
www.specworld.in 41 www.smartzworld.com
www.jntuworldupdates.org
www.specworld.in 42 www.smartzworld.com
www.jntuworldupdates.org
www.specworld.in 43 www.smartzworld.com
www.jntuworldupdates.org
www.specworld.in 44 www.smartzworld.com
www.jntuworldupdates.org
www.specworld.in 45 www.smartzworld.com
www.jntuworldupdates.org
www.specworld.in 46 www.smartzworld.com
www.jntuworldupdates.org
www.specworld.in 47 www.smartzworld.com
www.jntuworldupdates.org
www.specworld.in 48 www.smartzworld.com
www.jntuworldupdates.org
www.specworld.in 49 www.smartzworld.com
www.jntuworldupdates.org
www.specworld.in 50 www.smartzworld.com
www.jntuworldupdates.org
www.specworld.in 51 www.smartzworld.com
www.jntuworldupdates.org
www.specworld.in 52 www.smartzworld.com
www.jntuworldupdates.org
www.specworld.in 53 www.smartzworld.com
www.jntuworldupdates.org
www.specworld.in 54 www.smartzworld.com
www.jntuworldupdates.org
www.specworld.in 55 www.smartzworld.com
www.jntuworldupdates.org
www.specworld.in 56 www.smartzworld.com
www.jntuworldupdates.org
www.specworld.in 57 www.smartzworld.com
www.jntuworldupdates.org
www.specworld.in 58 www.smartzworld.com
www.jntuworldupdates.org
www.specworld.in 59 www.smartzworld.com
www.jntuworldupdates.org
www.specworld.in 60 www.smartzworld.com
www.jntuworldupdates.org
www.specworld.in 61 www.smartzworld.com
www.jntuworldupdates.org
www.specworld.in 62 www.smartzworld.com
www.jntuworldupdates.org
www.specworld.in 1 www.smartzworld.com
www.jntuworldupdates.org
www.specworld.in 2 www.smartzworld.com
www.jntuworldupdates.org
www.specworld.in 3 www.smartzworld.com
www.jntuworldupdates.org
www.specworld.in 4 www.smartzworld.com
www.jntuworldupdates.org
www.specworld.in 5 www.smartzworld.com
www.jntuworldupdates.org
www.specworld.in 6 www.smartzworld.com
www.jntuworldupdates.org
www.specworld.in 7 www.smartzworld.com
www.jntuworldupdates.org
www.specworld.in 8 www.smartzworld.com
www.jntuworldupdates.org
www.specworld.in 9 www.smartzworld.com
www.jntuworldupdates.org
www.specworld.in 10 www.smartzworld.com
www.jntuworldupdates.org
www.specworld.in 11 www.smartzworld.com
www.jntuworldupdates.org
www.specworld.in 12 www.smartzworld.com
www.jntuworldupdates.org
www.specworld.in 13 www.smartzworld.com
www.jntuworldupdates.org
www.specworld.in 14 www.smartzworld.com
www.jntuworldupdates.org
www.specworld.in 15 www.smartzworld.com
www.jntuworldupdates.org
www.specworld.in 16 www.smartzworld.com
www.jntuworldupdates.org
www.specworld.in 17 www.smartzworld.com
www.jntuworldupdates.org
www.specworld.in 18 www.smartzworld.com
www.jntuworldupdates.org
www.specworld.in 19 www.smartzworld.com
www.jntuworldupdates.org
www.specworld.in 20 www.smartzworld.com
www.jntuworldupdates.org
www.specworld.in 21 www.smartzworld.com
www.jntuworldupdates.org
www.specworld.in 22 www.smartzworld.com
www.jntuworldupdates.org
www.specworld.in 23 www.smartzworld.com
www.jntuworldupdates.org
www.specworld.in 24 www.smartzworld.com