Memory Hierarchy & Interfacing

Neso Academy
3 May 202108:03

Summary

TLDRThis educational session delves into the concept of memory hierarchy, explaining how different memory units are ranked based on access time and size, with registers being the fastest and secondary storage the slowest. It highlights the purpose of the hierarchy in bridging the speed gap between processors and memory while keeping costs reasonable. The video also explores two methods of memory interfacing, discussing the hit and miss ratios and their impact on average memory access time, aiming to provide a clear understanding of computer organization and memory efficiency.

Takeaways

  • πŸ“š The concept of memory hierarchy in computing is analogous to ranking or order based on different parameters, similar to how movies can be ranked by release dates or ratings.
  • 🏰 Memory units are ranked based on access time and size, with registers being the fastest and secondary memory being the slowest but largest in capacity.
  • πŸ’» The purpose of the memory hierarchy is to bridge the speed gap between the fast processor and the slower memory while keeping costs reasonable.
  • πŸ” Memory interfacing is a part of computer organization that involves connecting memory units to the processor and I/O peripherals to feed instructions efficiently.
  • ⏱️ Processor speed is measured in MIPS (Million Instructions Per Second), and the goal is to provide this many instructions from memory quickly and cost-effectively.
  • 🎯 In the memory hierarchy, a 'hit' occurs when the processor finds the required information in the current level of memory, and a 'miss' means it must look in the next level.
  • πŸ“ˆ The hit ratio is calculated as the percentage of times the processor successfully accesses the required information from a memory level without missing.
  • πŸ”’ The effective or average memory access time can be calculated using a formula that considers hit ratios and access times of different memory levels.
  • πŸ”„ There are two ways of interfacing memory units: simultaneous connection to the processor, allowing parallel search across levels, and level-wise connection, where the processor searches level by level sequentially.
  • ⏳ In simultaneous interfacing, the average access time is calculated considering the parallel search and the probabilities of hits and misses at each level.
  • πŸ“‰ In level-wise interfacing, the average access time formula accounts for the sequential search, including the cumulative access times of all levels in case of a miss.
  • πŸ“š The next session will involve solving numerical problems related to memory hierarchy to enhance understanding of the concept.

Q & A

  • What does the term 'hierarchy' refer to in the context of memory hierarchy?

    -In the context of memory hierarchy, 'hierarchy' refers to the ranking or organization of different memory units based on various parameters such as access time, size, and cost.

  • Why is the memory hierarchy important in computer systems?

    -The memory hierarchy is important because it helps bridge the speed mismatch between the fast processor and the slower memory, ensuring efficient data retrieval at a reasonable cost.

  • What are the different levels of memory units in the hierarchy based on access time and size?

    -The different levels of memory units, from fastest to slowest, are registers, SRAM caches, DRAM main memory, and secondary memory storages.

  • How does the cost and usage frequency relate to the memory hierarchy?

    -As we move up in the memory hierarchy, the cost and frequency of usage increase, with the processor being the most expensive and most frequently used component.

  • What is the purpose of the memory interfacing in computer organization?

    -Memory interfacing in computer organization deals with the way of connecting various levels of memory units, especially to the processor and I/O peripherals, to efficiently feed the processor with instructions.

  • What does MIPS stand for and what does it measure?

    -MIPS stands for Million Instructions Per Second and it measures the speed of the processor by counting how many instructions it can execute in a second.

  • What is a 'hit' in the context of memory hierarchy?

    -A 'hit' in the context of memory hierarchy occurs when the processor finds the required instruction or data in the memory level it is currently referring to.

  • What is a 'miss' and how does it relate to the memory hierarchy?

    -A 'miss' occurs when the processor does not find the required instruction or data in the current memory level and must look for it in the next level of the hierarchy.

  • What is the hit ratio and how is it calculated?

    -The hit ratio is the percentage of times the processor finds the required instructions or data in a particular memory level. It is calculated by dividing the number of hits by the total number of instructions.

  • What are the two ways of interfacing memory units with the processor as described in the script?

    -The two ways of interfacing memory units with the processor are: 1) Simultaneously connecting all different memory levels to the processor, allowing it to look for information in all levels side by side. 2) Connecting memory units level-wise, where the processor looks for information in one level at a time, moving to the next level only if the information is not found in the current one.

  • Can you explain the formula for effective or average memory access time in the context of simultaneous memory interfacing?

    -The formula for effective or average memory access time in simultaneous memory interfacing is the sum of the products of hit ratios and access times for each memory level. It accounts for the time taken to access each level based on the probability of finding the instruction there and includes all levels from the fastest to the slowest.

Outlines

00:00

πŸ“š Introduction to Memory Hierarchy and Interfacing

In this educational session, the presenter introduces the concept of memory hierarchy, explaining it with the analogy of ranking in Nolan's Dark Knight trilogy. The hierarchy of memory units is discussed based on access time and size, with registers being the fastest and secondary memory being the slowest. The purpose of the memory hierarchy is to bridge the speed gap between the fast processor and slow memory at a reasonable cost. The session also covers the basics of memory interfacing, explaining how memory units are connected to the processor and I/O peripherals, and introduces the concept of hits and misses in memory access. The presenter aims to provide a foundational understanding before delving into numerical problems in the next session.

05:02

πŸ” Understanding Memory Access Time and Interfacing Methods

This paragraph delves deeper into the calculation of effective or average memory access time, using a formula that considers the hit ratios and access times of different memory levels. The presenter explains the concept of hit ratio, which is the probability of finding an instruction in a particular memory level, and how it affects the average access time. Two methods of memory interfacing are discussed: simultaneous connection of all memory levels to the processor, and level-wise interfacing where the processor sequentially checks each level if the instruction is not found in the previous one. The presenter provides a detailed explanation of the formulas used for calculating access time in both interfacing methods and sets the stage for solving related numerical problems in the upcoming session.

Mindmap

Keywords

πŸ’‘Memory Hierarchy

Memory hierarchy refers to the organization of a computer's memory system into a series of levels, each with varying access times and capacities. In the script, it is explained as a ranking of memory units based on access time and size, with registers being the fastest and secondary memory being the slowest. The concept is crucial for understanding how a computer manages data flow to match the speed of the processor with the efficiency of memory storage.

πŸ’‘Processor

The processor, also known as the CPU, is the component of a computer that performs arithmetic and logical operations. It is central to the video's theme as the speed of the processor is contrasted with the slower speed of memory, highlighting the need for a memory hierarchy to bridge this speed mismatch.

πŸ’‘Access Time

Access time is the duration it takes for a memory unit to return data once an access request is made. The script discusses how different levels of the memory hierarchy have different access times, with registers having the least and secondary memory having the most, which is a key factor in the ranking of the memory hierarchy.

πŸ’‘SRAM Caches

SRAM (Static Random-Access Memory) caches are a type of high-speed memory used in the memory hierarchy, placed between the processor and main memory to reduce access time. The script mentions SRAM caches as part of the hierarchy, emphasizing their role in improving the efficiency of data retrieval for the processor.

πŸ’‘DRAM Main Memory

DRAM (Dynamic Random-Access Memory) is the primary memory used in computers, where the majority of the operating system, applications, and data are stored. The script positions DRAM as a level in the memory hierarchy that is slower than caches but faster than secondary memory.

πŸ’‘Secondary Memory

Secondary memory refers to non-volatile storage devices like hard drives or SSDs, which hold data even when power is off. In the script, secondary memory is described as the slowest level of the memory hierarchy but is essential for permanent data storage.

πŸ’‘Hit and Miss

In the context of the memory hierarchy, a 'hit' occurs when the data the processor requests is found in the current level of memory, while a 'miss' means the data is not found and must be sought in a lower level. The script explains the importance of hit and miss in calculating the efficiency of memory access.

πŸ’‘Hit Ratio

The hit ratio is the percentage of times that data is found in a particular level of the memory hierarchy when requested. The script uses the hit ratio to illustrate the efficiency of caches and main memory in providing data to the processor.

πŸ’‘Interfacing

Interfacing in the script refers to the method of connecting different levels of memory to the processor and I/O peripherals. It discusses two main ways of interfacing: simultaneous connection of all levels to the processor and level-wise connection, which affects how data is accessed and the overall performance of the system.

πŸ’‘MIPS

MIPS (Million Instructions Per Second) is a measure of a processor's speed, indicating how many instructions it can execute in a second. The script mentions MIPS to emphasize the goal of feeding the processor with instructions as quickly and cost-effectively as possible.

πŸ’‘Effective or Average Memory Access Time

Effective or average memory access time is a metric used to calculate the average time taken to access data in a memory hierarchy. The script provides a formula to understand this concept, which is essential for evaluating the performance of different memory interfacing methods.

Highlights

Introduction to memory hierarchy and its purpose to bridge the speed mismatch between fast processors and slow memory.

Explanation of hierarchy as ranking based on different parameters, using Nolan's Dark Knight Trilogy as an analogy.

Ranking of memory units based on access time and size, with registers being the fastest and secondary memory being the slowest.

Cost and usage frequency hierarchy being reversed compared to access time, with higher levels being more expensive and used less frequently.

The processor's speed is measured in MIPS (million instructions per second), and the goal is to feed it instructions efficiently.

Definition of 'hit' and 'miss' in the context of memory access, where a hit is finding the required information in the current level.

The time taken for a miss includes searching both the current and the next level of memory.

Illustration of two ways of memory interfacing: simultaneous connection and level-wise connection to the processor.

Effective or average memory access time formula explained for simultaneous memory interfacing.

Explanation of hit ratio, which is the probability of finding an instruction in a particular memory level.

The importance of the last level of memory hierarchy having a 100% hit ratio due to its permanent storage nature.

Calculation of average memory access time considering hit ratios and access times of different memory levels.

The sequential search process in level-wise memory interfacing, where the processor looks for information level by level.

Different formula for calculating access time in level-wise interfacing, considering both access times of the current and next levels.

Upcoming sessionι’„ε‘Š to solve numerical problems related to memory hierarchy for a deeper understanding.

Closing remarks and thanks to the audience for watching the session on memory hierarchy and interfacing.

Transcripts

play00:06

hello

play00:07

everyone welcome back in this session

play00:10

we are going to learn about first the

play00:13

memory hierarchy

play00:14

and then we will have a brief

play00:16

introduction regarding how the different

play00:18

memory units

play00:19

are interfaced with the processor so

play00:22

let's get to learning

play00:24

now the term hierarchy if put simply

play00:27

means ranking

play00:28

also ranking can be done based on

play00:30

different parameters

play00:31

for an instance if we consider nolan's

play00:34

dark knight trilogy

play00:35

according to the release dates batman

play00:38

begins comes first

play00:39

then the dark knight and finally the

play00:41

dark knight rises

play00:42

but if rotten tomatoes tomato meter is

play00:45

considered the dark knight is on the top

play00:47

having the freshness of 94 percent

play00:50

because

play00:51

honestly heath ledger just rocked it

play00:53

right then comes the dark knight rises

play00:55

and finally batman begins now this

play00:58

ranking remains the same

play01:00

if metacritic scores are also considered

play01:02

similarly

play01:03

based on different aspects the memory

play01:06

storages

play01:07

can also be ranked if we consider access

play01:10

time and size we can rank the memory

play01:12

units

play01:13

like this registers are made up of flip

play01:15

flops

play01:16

and are embedded within the processor

play01:18

itself therefore

play01:19

time to access them is the least the

play01:22

sram caches

play01:23

are next followed by the dram main

play01:25

memory

play01:26

last but not least the secondary memory

play01:28

storages

play01:29

however in terms of cost and usage

play01:32

frequency

play01:33

this hierarchy is reversed i mean as we

play01:35

move up in this

play01:36

the cost and the frequency of usage

play01:38

increases in our previous discussion

play01:41

we already understood that the processor

play01:43

is very fast and the sole purpose of

play01:45

having the memory hierarchy

play01:47

is to bridge the speed mismatch between

play01:49

the fast processor to slow memory

play01:51

that too at a reasonable cost now coming

play01:54

to memory interfacing it is a part of

play01:56

computer organization

play01:58

which deals with the way of connecting

play02:00

various levels of memory units

play02:02

especially to the processor also to the

play02:04

i o peripherals

play02:06

generally the speed of the processor is

play02:09

counted

play02:09

using the unit mips some call it

play02:13

mips it stands for million instructions

play02:15

per second

play02:16

and our goal is to try to feed the

play02:19

processor

play02:20

with those many instructions from the

play02:22

memory in a faster

play02:23

yet cost effective approach let's try to

play02:26

understand

play02:27

various levels of the memory if i say

play02:30

information at nth level is a subset of

play02:33

the information available in the n plus

play02:36

1 level it means if the processor refers

play02:39

to the nth level memory for something

play02:41

may that be any instruction or data if

play02:44

that's found there only

play02:46

we term it as hit otherwise it's called

play02:49

a mess

play02:49

and the processor then goes to the n

play02:51

plus one level that is the next level to

play02:53

look for the same

play02:54

so in case of a miss the time taken to

play02:57

look for the information in both

play02:58

nth level and n plus one level should be

play03:01

considered

play03:02

however it's not always the case it

play03:05

actually depends on the way the

play03:07

interfacing has been done

play03:08

let's dig a bit deeper now generally

play03:11

interfacing is done in two ways

play03:13

the following illustrations will help us

play03:15

understand these ways

play03:18

way one all the different memory levels

play03:20

are simultaneously connected to the

play03:22

processor and whenever the processor

play03:24

wants some information

play03:25

it can look for it in all the different

play03:27

levels side by side

play03:29

here the processor is connected to three

play03:31

memory units of different levels

play03:33

now for the time being let's call them

play03:36

m1 m2 and

play03:37

m3 assuming the access time for these

play03:40

are

play03:40

t1 t2 and t3 also t1 is less than t2

play03:45

which in turn

play03:46

is less than t3 now let's presume that

play03:49

for a program

play03:50

or a set of instructions the hit ratio

play03:53

of the m1 and m2 are h1 and h2

play03:56

respectively all right now the question

play03:59

that you must be having is

play04:00

what on earth is hit ratio right

play04:03

now we already know that during

play04:05

execution the set of instructions are

play04:07

brought into the main memory from the

play04:09

non-volatile secondary storage

play04:11

also the frequently accessed portions

play04:13

are stored inside the cache

play04:15

let's just say there are 100

play04:17

instructions in a program and it's

play04:19

permanently stored inside the last level

play04:21

of memory hierarchy that is the

play04:22

secondary memory

play04:24

suppose from those 100 80 of them are

play04:26

brought into the main memory

play04:28

in that case the hit ratio would be 80

play04:30

by 100

play04:31

that is 0.8 or 80 percent

play04:34

this means during execution there is 80

play04:37

chance for the processor of getting the

play04:39

required instructions

play04:40

inside the main memory now as the last

play04:43

level is nothing but the permanent

play04:44

storage

play04:45

there is the hit ratio is naturally

play04:47

hundred percent so we don't really

play04:49

bother about it because

play04:50

if the program isn't there there is no

play04:53

way for the processor to execute it

play04:55

it's like if we don't really have the

play04:57

audio file how on earth we can play it

play04:59

so coming back to our illustration with

play05:01

all these informations

play05:03

if we now try to find out how much time

play05:05

is needed on an

play05:06

average to find out an information in

play05:09

this organization

play05:10

which is by the way popularly known as

play05:13

effective

play05:13

or average memory access time the

play05:16

formula is as follows

play05:18

let's understand this formula so that we

play05:20

don't really have to memorize it

play05:22

so there is h1 percent chance of finding

play05:25

the instruction

play05:26

inside m1 and this is the time taken to

play05:29

access m1

play05:31

now 1 minus 81 percent chance is also

play05:33

there that the processor

play05:35

may not find the instruction required

play05:37

inside

play05:38

m1 which is called the miss rate or miss

play05:40

ratio of m1

play05:42

for those cases the processor will look

play05:45

inside the next level that is m2

play05:47

which has 82 percent chance of having

play05:49

the instructions in it

play05:51

also the time taken to access m2 is t2

play05:54

hence 1 minus h1 multiplied by

play05:57

h2 and t2 so finally there are

play06:01

1 minus 82 percent chance of not finding

play06:04

the instructions

play06:05

inside m2 that is the miss ratio or the

play06:08

miss rate of

play06:09

m2 is 1 minus h2 therefore

play06:12

1 minus h1 multiplied by 1 minus h2 that

play06:16

is considering

play06:16

all the chances where we can't find the

play06:18

required instructions either in m1

play06:21

or in m2 in that case we will have to

play06:24

look for it

play06:24

inside m3 that is the last level and the

play06:27

time required to access

play06:29

m3 is t3 hence 1 minus

play06:33

h1 multiplied by 1 minus h2 multiplied

play06:36

by t3

play06:37

now remember the memory devices of the

play06:40

different levels are connected to the

play06:42

processor simultaneously and that's why

play06:44

these all will take place parallelly now

play06:47

the second way

play06:48

is to interface the memory units level

play06:51

wise

play06:52

as this that means if the required

play06:55

instruction

play06:56

can't be found in m1 then the processor

play06:59

will go and look for it inside the next

play07:01

level that is m2

play07:03

and if it is not even there the seeking

play07:05

process will continue to the next level

play07:08

so in that case the formula will become

play07:11

this

play07:12

because here the processor is not

play07:13

simultaneously connected to all the

play07:15

memory units

play07:17

also if the processor is looking for an

play07:19

instruction

play07:20

in the n plus one level that means it

play07:23

already has looked for it in the nth

play07:25

level or the previous level

play07:27

and it couldn't find it there that's why

play07:30

both the access times are being

play07:32

considered

play07:33

well that was all about memory hierarchy

play07:36

and the different ways the memory

play07:38

interfacing takes place

play07:40

in the next session we will try to solve

play07:42

a few numerical problems

play07:44

associated to this concept to have a

play07:46

lucid understanding

play07:47

so i hope to see you in the next one

play07:49

thank you all for watching

play08:02

you

Rate This
β˜…
β˜…
β˜…
β˜…
β˜…

5.0 / 5 (0 votes)

Related Tags
Memory HierarchyProcessorCacheRegistersDRAMSRAMInterfacingInstruction FetchHit RatioMiss Rate