Module 5
Module 5
Memory System
Text book: Computer organization &
Architecture- William Stallins
Memory access methods
1. Sequential Access:-
In this method, the memory is accessed in a specific
linear sequential manner. The access time depends
on the location of the data. Eg. Magnetic tape
2. Random Access:-
Random access allows direct access to any memory
location with uniform access time. In this method,
memory cells are addressed using unique identifiers,
such as memory addresses. Eg: RAM, ROM
Memory access methods
3. Direct Access:-
Direct access allows accessing memory locations
in any order without the need to sequentially
traverse the preceding locations. It utilizes a
direct access table or index to quickly locate the
desired memory location. Hard disk drives (HDD)
and solid-state drives (SSD) are examples of
direct access storage devices.
• 4. Associate Access:-
Associative access, also known as content-
addressable memory (CAM), allows data
retrieval based on content rather than memory
addresses. It compares the search pattern
against all memory locations simultaneously to
find a match. Associative access is commonly
used in caches and specialized hardware for
high-speed look ups. Eg: Cache
Organization
• The basic element of a semiconductor memory
is the memory cell.
• They exhibit two stable (or semistable) states,
which can be used to represent binary 1 and 0.
• They are capable of being written into (at least
once), to set the state.
• They are capable of being read to sense the
state.
Memory cell
Memory hierarchy
Virtual memory
• Most modern computer systems use a hard disk
(also called a hard drive) as the lowest level in the
memory hierarchy .
• Hard disk is large and cheap but terribly slow.
• The disk provides a much larger capacity than is
possible with a cost-effective main memory (DRAM).
• However, if a significant fraction of memory
accesses involve the disk, performance is dismal.
You may have encountered this on a PC when
running too many programs at once.
• The hard disc memory is called virtual memory,
and the smaller main memory is called physical
memory.
• Virtual addresses that specify the location in
virtual memory.
• Virtual memory is divided into virtual pages,
typically 4 KB in size.
• Physical memory is likewise divided into
physical pages of the same size.
• The physical memory holds a subset of most
recently accessed virtual memory.
• In this way, physical memory acts as a cache
for virtual memory.
• Thus, most accesses hit in physical memory at
the speed of DRAM, yet the program enjoys
the capacity of the larger virtual memory.
• The process of determining the physical
address from the virtual address is called
address translation.
• If the processor attempts to access a virtual
address that is not in physical memory, a page
fault occurs, and the operating system loads
the page from the hard disk into physical
memory.
• Page table: lookup table used to translate
virtual addresses to physical addresses
• The page table access translates the virtual
address used by the program to a physical
address.
• The physical address is then used to actually
read or write the data.
Translation lookaside buffer
• Every virtual memory reference can cause two
physical memory accesses: one to fetch the
appropriate page table entry, and one to fetch the
desired data.
• Thus, a straightforward virtual memory scheme
would have the effect of doubling the memory
access time.
• To overcome this problem, most virtual memory
schemes make use of a special cache for page table
entries, called a translation lookaside buffer (TLB)
Operation of Paging and Translation
Lookaside Buffer (TLB)
• A virtual address will generally be in the form of a page
number, offset.
• First, the memory system consults the TLB to see if the
matching page table entry is present.
• If it is, the real (physical) address is generated by combining
the frame number with the offset.
• If not, the entry is accessed from a page table.
• Once the real address is generated, which is in the form of a
tag and a remainder, the cache is consulted to see if the block
containing that word is present . If so, it is returned to the
processor. If not, the word is retrieved from main memory