1. Operating System
Unit - 2
MEMORY HIERARCHY IN OPERATING SYSTEM BY RAM K PALIWAL
9/3/2019 MEMORY HEIRARCHY- UNIT 2- BY RAM K PALIWAL 1
2. Memory Hierarchy
The design constraints on a computer’s memory can be summed up by three
questions:
1. How much?
2. How fast?
3. How expensive?
As might be expected, there is a tradeoff among the three key characteristics of
memory: namely,
• Capacity
• Access time
• Cost.
9/3/2019 MEMORY HEIRARCHY- UNIT 2- BY RAM K PALIWAL 2
3. Memory Hierarchy
A variety of technologies are used to implement memory systems,
and across this spectrum of technologies, the following relationships
hold:
• Faster access time, greater cost per bit
• Greater capacity, smaller cost per bit
• Greater capacity, slower access speed
The way out of this dilemma is to not rely on a single memory
component or technology, but to employ a memory hierarchy.
9/3/2019 MEMORY HEIRARCHY- UNIT 2- BY RAM K PALIWAL 3
5. Memory Hierarchy
A typical hierarchy is illustrated in last diagram. As one goes down
the hierarchy, the following occur:
◦ a. Decreasing cost per bit
◦ b. Increasing capacity
◦ c. Increasing access time
◦ d. Decreasing frequency of access to the memory by the processor
Thus, smaller, more expensive, faster memories are supplemented
by larger, cheaper, slower memories. The key to the success of this
organization decreasing frequency of access at lower levels.
9/3/2019 MEMORY HEIRARCHY- UNIT 2- BY RAM K PALIWAL 5
6. Memory Hierarchy
This Memory Hierarchy Design is divided into 2 main types:
External Memory or Secondary Memory –
Comprising of Magnetic Disk, Optical Disk, Magnetic Tape i.e.
peripheral storage devices which are accessible by the processor via
I/O Module.
Internal Memory or Primary Memory –
Comprising of Main Memory, Cache Memory & CPU registers. This is
directly accessible by the processor.
9/3/2019 MEMORY HEIRARCHY- UNIT 2- BY RAM K PALIWAL 6
8. Memory Access Methods
Each memory type, is a collection of numerous memory locations. To
access data from any memory, first it must be located and then the
data is read from the memory location. Following are the methods to
access information from memory locations:
◦ Random Access: Main memories are random access memories, in which each
memory location has a unique address. Using this unique address any
memory location can be reached in the same amount of time in any order.
◦ Sequential Access: This methods allows memory access in a sequence or in
order.
◦ Direct Access: In this mode, information is stored in tracks, with each track
having a separate read/write head.
9/3/2019 MEMORY HEIRARCHY- UNIT 2- BY RAM K PALIWAL 8
9. Memory Hierarchy
Cache Memory
The data or contents of the main memory that are used again and again by CPU, are stored in
the cache memory so that we can easily access that data in shorter time.
Hit Ratio
The performance of cache memory is 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. If the word is not
found in cache, it is in main memory then it counts as a miss.
The ratio of the number of hits to the total CPU references to memory is called hit ratio.
Hit Ratio = Hit/(Hit + Miss)
9/3/2019 MEMORY HEIRARCHY- UNIT 2- BY RAM K PALIWAL 9
10. References
1. Operating System Concept ninth Edition by Abraham Silberschatz and Galvin
2. Operating Systems, internals and Design Principles, sixth edition by William Stalling
3. https://www.studytonight.com/computer-architecture/memory-organization
9/3/2019 MEMORY HEIRARCHY- UNIT 2- BY RAM K PALIWAL 10
Notas do Editor
The dilemma facing the designer is clear. The designer would like to use memory technologies that provide for large-capacity memory, both because the capacity is needed and because the cost per bit is low. However, to meet performance requirements, the designer needs to use expensive, relatively lower-capacity memories with fast access times.
Suppose that the processor has access to two levels of memory. Level 1 contains 1000 bytes and has an access time of 0.1 μs; level 2 contains 100,000 bytes and has an access time of 1 μs. Assume that if a byte to be accessed is in level 1, then the processor accesses it directly. If it is in level 2, then the byte is first transferred to level 1 and then accessed by the processor. For simplicity, we ignore the time required for the processor to determine whether the byte is in level 1 or level 2.
Main Memory
The memory unit that communicates directly within the CPU, Main memory and Cache memory, is called main memory. It is the central storage unit of the computer system. It is a large and fast memory used to store data during computer operations. Main memory is made up of RAM and ROM, with RAM integrated circuit chips holing the major share.
RAM: Random Access Memory
DRAM: Dynamic RAM, is made of capacitors and transistors, and must be refreshed every 10~100 ms. It is slower and cheaper than SRAM.
SRAM: Static RAM, has a six transistor circuit in each cell and retains data, until powered off.
NVRAM: Non-Volatile RAM, retains its data, even when turned off. Example: Flash memory.
ROM: Read Only Memory, is non-volatile and is more like a permanent storage for information. It also stores the bootstrap loader program, to load and start the operating system when computer is turned on. PROM(Programmable ROM), EPROM(Erasable PROM) and EEPROM(Electrically Erasable PROM) are some commonly used ROMs.
Auxiliary Memory
Devices that provide backup storage are called auxiliary memory. For example: Magnetic disks and tapes are commonly used auxiliary devices. Other devices used as auxiliary memory are magnetic drums, magnetic bubble memory and optical disks.
It is not directly accessible to the CPU, and is accessed using the Input/output channels.