You are on page 1of 64

B.

Tech 5th SEMESTER – CSE 2


COMPUTER ORGANIZATION &
ARCHITECTURE
CHAPTER – 16
Memory organization
(Refer Chapter-12 Memory Organization From The Book M. Morris Mano)

Prepared By:
Prof. Smita Dash ( Asst. Professor, Dept. of CSE)

PROF. SMITA DASH (ASST. PROFESSOR., DEPT. OF CSE) 1


WHAT IS A MEMORY?
• A memory unit is the collection of storage units
or devices together. The memory unit stores the
binary information in the form of bits.

2 categories:
• Volatile Memory: This loses its data, when power
is switched off.

• Non-Volatile Memory: This is a permanent


storage and does not lose any data when power
is switched off.
PROF. SMITA DASH (ASST. PROFESSOR., DEPT. OF CSE) 2
CRITERIA TAKEN INTO
CONSIDERATION WHILE DECIDING
WHICH MEMORY IS TO BE USED:

• Cost
• Speed
• Memory access time
• Data transfer rate
• Reliability
PROF. SMITA DASH (ASST. PROFESSOR., DEPT. OF CSE)
3
MEMORY HIERARCHY

PROF. SMITA DASH (ASST. PROFESSOR., DEPT. OF CSE) 4


PROF. SMITA DASH (ASST. PROFESSOR., DEPT. OF CSE)
5
PROF. SMITA DASH (ASST. PROFESSOR., DEPT. OF CSE) 6
PROF. SMITA DASH (ASST. PROFESSOR., DEPT. OF CSE)
7
MEMORY HIERARCHY PROPERTIES
• Coherence Property

• The coherence property requires that copies


of the same information item at successive
memory levels be consistent. If a word is
modified in the cache, copies of that must be
updated immediately or eventually at all
higher levels.
PROF. SMITA DASH (ASST. PROFESSOR., DEPT. OF CSE)
8
• locality of reference, also known as
the principle of locality, is the tendency of a
processor to access the same set of memory
locations repetitively over a short period of
time.

PROF. SMITA DASH (ASST. PROFESSOR., DEPT. OF CSE)


9
Types of Locality
• Temporal locality
If at one point a particular memory location is
referenced, then it is likely that the same location
will be referenced again in the near future.
• Spatial locality
If a particular storage location is referenced at a
particular time, then it is likely that nearby
memory locations will be referenced in the near
future.
PROF. SMITA DASH (ASST. PROFESSOR., DEPT. OF CSE)
10
• Sequential locality
✓ In a program, the execution of instructions
normally follows a sequential order (in-order
execution) unless branch instructions cause the
control to go out- of order (out-of order
execution).

✓ These sequential instructions reside normally in a


cluster of memory close to one another.

✓ This cluster is accessed again and again due to in-


order execution of the sequential instructions in
the program giving rise to sequential locality.
PROF. SMITA DASH (ASST. PROFESSOR., DEPT. OF CSE)
11
MAIN MEMORY & TYPES

PROF. SMITA DASH (ASST. PROFESSOR., DEPT. OF CSE)


12
RAM

PROF. SMITA DASH (ASST. PROFESSOR., DEPT. OF CSE)


13
PROF. SMITA DASH (ASST. PROFESSOR., DEPT. OF CSE)
14
Types Of RAM

PROF. SMITA DASH (ASST. PROFESSOR., DEPT. OF CSE)


15
ROM

PROF. SMITA DASH (ASST. PROFESSOR., DEPT. OF CSE) 16


PROF. SMITA DASH (ASST. PROFESSOR., DEPT. OF CSE)
17
PROF. SMITA DASH (ASST. PROFESSOR., DEPT. OF CSE)
18
RAM & ROM CHIPS

Fig:1 Block Diagram of RAM Chip & Fig:2 Function Table


PROF. SMITA DASH (ASST. PROFESSOR., DEPT. OF CSE) 19
PROF. SMITA DASH (ASST. PROFESSOR., DEPT. OF CSE)
20
SRAM CHIP vs DRAM CHIP

PROF. SMITA DASH (ASST. PROFESSOR., DEPT. OF CSE) 21


WORKING OF AN SRAM CELL

PROF. SMITA DASH (ASST. PROFESSOR., DEPT. OF CSE) 22


• To generate stable logic state, four transistors (T1, T2,
T3, T4) are organized in a cross-connected way. For
generating logic state 1, node C1 is high, and C2 is low;
in this state, T1 and T4 are off, and T2 and T3 are on.
For logic state 0, junction C1 is low, and C2 is high; in
the given state T1 and T4 are on, and T2 and T3 are off.
Both states are stable until the direct current (dc)
voltage is applied.

• The SRAM address line is operated for opening and


closing the switch and to control the T5 and T6
transistors permitting to read and write. For read
operation the signal is applied to these address line
then T5 and T6 gets on, and the bit value is read from
line B. For the write operation, the signal is employed
to B bit line, and its complement is applied to B’.

PROF. SMITA DASH (ASST. PROFESSOR., DEPT. OF CSE)


23
WORKING OF A DRAM CELL

PROF. SMITA DASH (ASST. PROFESSOR., DEPT. OF CSE)


24
• At the time of reading and writing the bit value from the cell, the
address line is activated. The transistor present in the circuitry
behaves as a switch that is closed(allowing current to flow) if a
voltage is applied to the address line and open (no current flows) if
no voltage is applied to the address line. For the write operation, a
voltage signal is employed to the bit line where high voltage shows
1, and low voltage indicates 0. A signal is then used to the address
line which enables transferring of the charge to the capacitor.

• When the address line is chosen for executing read operation, the
transistor turns on and the charge stored on the capacitor is
supplied out onto a bit line and to a sense amplifier.

• The sense amplifier specifies whether the cell contains a logic 1 or


logic 2 by comparing the capacitor voltage to a reference value. The
reading of the cell results in discharging of the capacitor, which
must be restored to complete the operation. Even though a DRAM
is basically an analog device and used to store the single bit (i.e.,
0,1).

PROF. SMITA DASH (ASST. PROFESSOR., DEPT. OF CSE)


25
ASSOCIATIVE MEMORY

PROF. SMITA DASH (ASST. PROFESSOR., DEPT. OF CSE)


26
PROF. SMITA DASH (ASST. PROFESSOR., DEPT. OF CSE)
27
Hardware Organization

PROF. SMITA DASH (ASST. PROFESSOR., DEPT. OF CSE) 28


CACHE MEMORY

PROF. SMITA DASH (ASST. PROFESSOR., DEPT. OF CSE) 29


PROF. SMITA DASH (ASST. PROFESSOR., DEPT. OF CSE)
30
Cache Operation- Overview
• CPU requests contents of memory location
• Check cache for this data
• If present, get from cache (fast)
• If not present, read required block from main
memory to cache
• Then deliver from cache to CPU
• Cache includes tags to identify which block of
main memory is in each cache slot
PROF. SMITA DASH (ASST. PROFESSOR., DEPT. OF CSE) 31
Performance of a Cache
• The performance of cache memory is frequently
measured in terms of quantity called hit ratio.
• When the CPU refers to the memory and finds
the word in the cache, it is said to produce a hit.
• If the word is not found in the cache , it is in main
memory and it counts a miss.
• The ratio of the number of hits divided by the
total CPU references to the memory (hits plus
misses) is the hit ratio.
PROF. SMITA DASH (ASST. PROFESSOR., DEPT. OF CSE) 32
PROF. SMITA DASH (ASST. PROFESSOR., DEPT. OF CSE) 33
PROF. SMITA DASH (ASST. PROFESSOR., DEPT. OF CSE) 34
Hit Ratio

PROF. SMITA DASH (ASST. PROFESSOR., DEPT. OF CSE)


35
Cache Read Operation- Flowchart

PROF. SMITA DASH (ASST. PROFESSOR., DEPT. OF CSE) 36


CACHE MAPPING
• WHAT IS MAPPING?
The basic characteristics of a cache memory is
its fast access time. Therefore, very little or no
time must be wasted when searching the
word from cache. The transformation of data
from main memory to cache memory is
referred to as memory mapping process.

PROF. SMITA DASH (ASST. PROFESSOR., DEPT. OF CSE)


37
Types of Mapping

– Associative Mapping
– Direct Mapping
– Set- Associative mapping

PROF. SMITA DASH (ASST. PROFESSOR., DEPT. OF CSE)


38
1. ASSOCIATIVE MAPPING

PROF. SMITA DASH (ASST. PROFESSOR., DEPT. OF CSE)


39
PROF. SMITA DASH (ASST. PROFESSOR., DEPT. OF CSE) 40
2. DIRECT MAPPING

PROF. SMITA DASH (ASST. PROFESSOR., DEPT. OF CSE)


41
PROF. SMITA DASH (ASST. PROFESSOR., DEPT. OF CSE)
42
PROF. SMITA DASH (ASST. PROFESSOR., DEPT. OF CSE)
43
3. SET-ASSOCIATIVE MAPPING

PROF. SMITA DASH (ASST. PROFESSOR.,


44
DEPT. OF CSE)
PROF. SMITA DASH (ASST. PROFESSOR.,
45
DEPT. OF CSE)
PROF. SMITA DASH (ASST. PROFESSOR.,
46
DEPT. OF CSE)
PROF. SMITA DASH (ASST. PROFESSOR.,
47
DEPT. OF CSE)
PROF. SMITA DASH (ASST. PROFESSOR.,
48
DEPT. OF CSE)
Replacement Algorithms in Cache
Memory
• Replacement algorithms are used when there
are no available space in the cache in which to
place the data.

PROF. SMITA DASH (ASST. PROFESSOR.,


49
DEPT. OF CSE)
PROF. SMITA DASH (ASST. PROFESSOR.,
50
DEPT. OF CSE)
Interleaved Memory

• Abstraction is one the most important aspect of


computing. It is widely implemented Practice in
the Computational field.
• Memory Interleaving is less or More an
Abstraction technique. Though its a bit different
from Abstraction. It is a Technique which divides
memory into a number of modules such that
Successive words in the address space are placed
in the Different module.
PROF. SMITA DASH (ASST. PROFESSOR.,
51
DEPT. OF CSE)
Interleaved Memory (contd..)
• Consecutive Word in a Module:

PROF. SMITA DASH (ASST. PROFESSOR.,


52
DEPT. OF CSE)
• Let us assume 16 Data’s to be Transferred to the
Four Module. Where Module 00 be Module 1,
Module 01 be Module 2, Module 10 be Module 3
& Module 11 be Module 4. Also 10, 20, 30….130
are the data to be transferred.
• From the figure above in Module 1, 10 [Data] is
transferred then 20, 30 & finally, 40 which are the
Data. That means the data are added
consecutively in the Module till its max capacity.
• Most significant bit (MSB) provides the Address
of the Module & least significant bit (LSB)
provides the address of the data in the module.
PROF. SMITA DASH (ASST. PROFESSOR.,
53
DEPT. OF CSE)
PROF. SMITA DASH (ASST. PROFESSOR.,
54
DEPT. OF CSE)
Consecutive Word in Consecutive Module

PROF. SMITA DASH (ASST. PROFESSOR.,


55
DEPT. OF CSE)
PROF. SMITA DASH (ASST. PROFESSOR.,
56
DEPT. OF CSE)
PROF. SMITA DASH (ASST. PROFESSOR.,
57
DEPT. OF CSE)
VIRTUAL MEMORY

PROF. SMITA DASH (ASST. PROFESSOR.,


58
DEPT. OF CSE)
PROF. SMITA DASH (ASST. PROFESSOR.,
59
DEPT. OF CSE)
PROF. SMITA DASH (ASST. PROFESSOR.,
60
DEPT. OF CSE)
PROF. SMITA DASH (ASST. PROFESSOR.,
61
DEPT. OF CSE)
PROF. SMITA DASH (ASST. PROFESSOR.,
62
DEPT. OF CSE)
ADRESS SPACE & MEMORY SPACE

PROF. SMITA DASH (ASST. PROFESSOR.,


63
DEPT. OF CSE)
THANK YOU

PROF. SMITA DASH (ASST. PROFESSOR.,


64
DEPT. OF CSE)

You might also like