Memory Organization in Computer
Architecture
Simultaneous/Independent and Hierarchical (2 Level or 3
Level) Memory Access
1. Simultaneous Access Memory Organization
2. Hierarchical Access Memory Organization
1. Simultaneous Access Memory Organization-
In this memory organization,
All the levels of memory are directly connected to the CPU.
Whenever CPU requires any word, it starts searching for it in all the levels
simultaneously.
Example-01:
Consider the following simultaneous access memory organization-
Let-
T1 = Access time of level L1
S1 = Size of level L1
C1 = Cost per byte of level L1
H1 = Hit rate of level L1
Similar are the notations for level L2.
Average Memory Access Time-
Average time required to access memory per operation
= H1 x T1 + (1 – H1) x H2 x T2
= H1 x T1 + (1 – H1) x 1 x T2
= H1 x T1 + (1 – H1) x T2
Important Note
In any memory organization,
The data item being searched will definitely be present in the last level.
Thus, hit rate for the last level is always 1.
Consider the following simultaneous access memory organization-
Here, three levels of memory are directly connected to the CPU
Let-
• C1 = Cost per byte of level L1
• H1 = Hit rate of level L1
Similar are the notations for other two levels.
Average Memory Access Time
Average time required to access memory per operation
= H1 x T1 + (1 – H1) x H2 x T2 + (1 – H1) x (1 – H2) x H3 x T3
= H1 x T1 + (1 – H1) x H2 x T2 + (1 – H1) x (1 – H2) x 1 x T3
= H1 x T1 + (1 – H1) x H2 x T2 + (1 – H1) x (1 – H2) x T
2. Hierarchical Access Memory Organization
In this memory organization, memory levels are organized as Level-1 is directly connected
to the CPU. Level-2 is directly connected to level-1. Level-3 is directly connected to level-2
and so on.
Whenever CPU requires any word
Example-01:
Consider the following hierarchical access memory organization
Here, two levels of memory are connected to the CPU in a hierarchical fashion.
Let
C1 = Cost per byte of level L1
H1 = Hit rate of level L1
Average Memory Access Time-
Average time required to access memory per operation
= H1 x T1 + (1 – H1) x H2 x (T1 + T2)
= H1 x T1 + (1 – H1) x 1 x (T1 + T2)
= H1 x T1 + (1 – H1) x (T1 + T2)
Example: 2
Consider the following hierarchical access memory organization-
Here, three levels of memory are connected to the CPU in a hierarchical fashion.
Let-
T1 = Access time of level L1
S1 = Size of level L1
C1 = Cost per byte of level L1
H1 = Hit rate of level L1
Similar are the notations for other two levels.
Average Memory Access Time-
Average time required to access memory per operation
= H1 x T1 + (1 – H1) x H2 x (T1 + T2) + (1 – H1) x (1 – H2) x H3 x (T1 + T2 + T3)
= H1 x T1 + (1 – H1) x H2 x (T1 + T2) + (1 – H1) x (1 – H2) x 1 x (T1 + T2 + T3)
= H1 x T1 + (1 – H1) x H2 x (T1 + T2) + (1 – H1) x (1 – H2) x (T1 + T2 + T3)
PRACTICE PROBLEMS BASED ON MEMORY ORGANIZATION
Problem 1
What is the average memory access time for a machine with a cache hit rate of 80% and
cache access time of 5 ns and main memory access time of 100 ns when-
1. Simultaneous access memory organization is used.
2. Hierarchical access memory organization is used.
Solution-
Part-01: Simultaneous Access Memory Organization-
The memory organization will be as shown-
Average Memory Access Time
= H1 x T1 + (1 – H1) x H2 x T2
= 0.8 x 5 ns + (1 – 0.8) x 1 x 100 ns
= 4 ns + 0.2 x 100 ns
= 4 ns + 20 ns
= 24 ns
Part-02: Hierarchical Access Memory Organization-
The memory organization will be as shown-
Average memory access time
= H1 x T1 + (1 – H1) x H2 x (T1 + T2)
= 0.8 x 5 ns + (1 – 0.8) x 1 x (5 ns + 100 ns)
= 4 ns + 0.2 x 105 ns
= 4 ns + 21 ns
= 25 ns
Problem 2:
A computer has a cache, main memory and a disk used for virtual memory. An access to the
cache takes 10 ns. An access to main memory takes 100 ns. An access to the disk takes
10,000 ns. Suppose the cache hit ratio is 0.9 and the main memory hit ratio is 0.8. The
effective access time required to access a referenced word on the system is _______ when-
1. Simultaneous access memory organization is used.
2. Hierarchical access memory organization is used.
Solution-
Part-01:Simultaneous Access Memory Organization-
The memory organization will be as shown
Effective memory access time
= H1 x T1 + (1 – H1) x H2 x T2 + (1 – H1) x (1 – H2) x H3 x T3
= 0.9 x 10 ns + (1 – 0.9) x 0.8 x 100 ns + (1 – 0.9) x (1 – 0.8) x 1 x 10000 ns
= 9 ns + 8 ns + 200 ns ×
= 217 ns
Part-02: Hierarchical Access Memory Organization
The memory organization will be as shown
Effective memory access time
= H1 x T1 + (1 – H1) x H2 x (T1 + T2) + (1 – H1) x (1 – H2) x H3 x (T1 + T2 + T3)
= 0.9 x 10 ns + (1 – 0.9) x 0.8 x (10 ns + 100 ns) + (1 – 0.9) x (1 – 0.8) x 1 x (10 ns + 100 ns + 10000 ns)
= 9 ns + 8.8 ns + 202.2 ns
= 220 ns
Difference between Simultaneous/Independent and
Hierarchical (2 Level or 3 Level) Memory Access
In the Computer System Design, Memory organisation is primarily divided into two main
types on the basis of the manner in which CPU tries to access different levels of
Memory. These two types include Simultaneous Access Memory Organisation and
Hierarchical Access Memory Organisation.
Figure – Simultaneous Access Memory Organisation
l Access Memory Organisationspdated : 19 Dec, 2018
•
Simultaneous/Idependent Access Hierarchical Access Memory
Memory Organisation Organisation
In this organisation, CPU is directly In this organisation, CPU is always directly
connected to all the levels of Memory. connected to L1 i.e. Level-1 Memory only.
CPU accesses the data from all levels CPU always accesses the data from Level-1
of Memory simultaneously. Memory.
For any “miss” encountered in L1 memory,
For any “miss” encountered in L1 CPU cannot directly access data from higher
memory, CPU can directly access data memory levels(i.e. L2, L3, …..Ln). First the
from higher memory levels (i.e. L2, desired data will be transferred from higher
L3, …..Ln). memory levels to L1 memory. Only then it can
be accessed by the CPU.
If H1 and H2 are the Hit Ratios and T1
If H1 and H2 are the Hit Ratios and T1 and T2
and T2 are the access time of L1 and
are the access time of L1 and L2 memory levels
L2 memory levels respectively then
respectively then the Average Memory Access
the Average Memory Access Time can
Time can be calculated as:
be calculated as:
NOTE:
1. By default the memory structure of Computer Systems is designed with
Hierarchical Access Memory [Link] is so because in this type of
memory organisation the average access time is reduced due to locality
of references.
2. Simultaneous access Memory organisation is used for the
implementation of Write Through Cache.
3. In both types of memory organisation, the Hit Ratio of last memory
level is always 1.