Chapter 4
Chapter 4
Sequential: Tape units have sequential access. Data are generally stored in units called
“records”. Data is accessed sequentially; the records may be passed (or rejected) until the record
that is searched is found.
Random: Each addressable location in memory has a unique addressing mechanism. The time to
access a given location is independent of the sequence of prior accesses and constant. Any
location can be selected at random and directly addressed and accessed. Main memory and cache
systems are random access.
Performance
Access time: For random-access memory, this is the time it takes to perform a read or write
operation: that is, the time from the instant that an address is presented to the memory to the
instant that data have been stored or made available for use. For nonrandom-access memory,
access time is the time it takes to position the read-write mechanism at the desired location.
Transfer rate: This is the rate at which data can be transferred into or out of a memory unit.
Physical Type
Figure
4.2:Connection of RAM and CPU
The CPU initiates a memory operation by loading the appropriate data into registers MDR and MAR,
and setting either Read or Write memory control line to 1. When the required operation is completed the
memory control circuitry sends Memory Function Completed (MFC) signal to CPU. The time that
elapses between the initiation of an operation and completion of that operation is called memory access
time. The
minimum time delay between two successive memory operations is
called memory cycle time. The cycle time is usually slightly lower than the access time.
4.3.2 Catch Memory
Cache memory is a small, high-speed RAM buffer located between the CPU and main memory.
Cache memory holds a copy of the instructions (instruction cache) or data (operand or data
cache) currently being used by the CPU.
The main purpose of a cache is to accelerate your computer while keeping the price of the
computer low.
Revised by Fikru T.(Lecturer, MSc.)
3
Figure 4.3: Placement of Cache memory in the computer
Hit Ratio
The ratio of the total number of hits divided by the total CPU accesses to memory (i.e. hits plus
misses) is called Hit Ratio.
Hit Ratio = Total Number of Hits / (Total Number of Hits + Total Number of Miss)
Example
A system with 512 x 12 cache and 32 K x 12 of main memory.
Associative Mapping
An associative mapping uses an associative memory.
This memory is being accessed using its contents.
Each line of cache memory will accommodate the address (main memory) and the contents of
that address from the main memory.
That is why this memory is also called Content Addressable Memory (CAM). It allows each
block of main memory to be stored in the cache.
Optimal (OPT)
The optimal policy selects that page for replacement for which the time to the next reference is
longest.
Revised by Fikru T.(Lecturer, MSc.)
9
This algorithm results in fewest number of page faults. But, this algorithm is impossible to
implement.
At the time of page fault, the operating system has no way of knowing when each of the pages
will be referenced next. However, it does serve as a standard against which to judge other
algorithms.
Consider a paging system having capacity of 3 pages. The execution of a program requires
references to five distinct pages P1, P2, P3, P4 and P5. The pages are executed in the following
sequence:
P2 P3 P2 P1 P5 P2 P4 P5 P3 P2 P5 P2