Memory Interfacing – Solved PYQs

Neso Academy
8 May 202105:48

Summary

TLDRIn this educational session, the presenter introduces numerical problems related to memory interfacing, crucial for competitive exams. The session focuses on calculating average access times for cache and main memory, emphasizing practical application over theoretical knowledge. Two methods are discussed for solving such problems, with the second method, considering level-wise organization, being the correct approach as seen in an ISRO CS 2017 exam question. The presenter also covers a GATE CS 2015 question, illustrating the importance of understanding cache hit and miss scenarios. The session concludes with advice on careful problem-solving during exams.

Takeaways

  • 😀 The session introduces types of numerical problems related to memory interfacing in competitive exams.
  • 🔍 It's emphasized that theoretical knowledge needs to be complemented with practical application.
  • ⏱️ Question 1 discusses calculating the average access time of CPU with given cache and main memory access times and a hit ratio.
  • 💡 Two approaches are presented for solving the problem: simultaneous connection and level-wise organization.
  • 📊 The first approach assumes simultaneous access, leading to an average access time of 54 nanoseconds.
  • 📈 The second approach, considering level-wise organization, results in an average access time of 60 nanoseconds.
  • 🎯 The correct answer for the competitive exam (ISRO CS 2017) is the second approach, with 60 nanoseconds.
  • 🤔 The importance of understanding the organization type (level-wise or simultaneous) is highlighted for problem-solving.
  • 📝 Question 2 from GATE CS 2015 involves calculating average read access time with given cache hit and miss times.
  • 🧮 The average read access time for Question 2 is calculated as 14 nanoseconds, using the level-wise organization method.
  • 📚 The session concludes with advice to be careful while solving numerical problems, especially during exams.

Q & A

  • What is the average access time of the CPU for a cache memory with 30 nanoseconds access time and main memory with 150 nanoseconds access time, given a hit ratio of 80 percent?

    -The average access time can be calculated using two approaches. In the first approach, assuming simultaneous connection to the processor, the average access time is calculated as 0.8 * 30ns + (1 - 0.8) * 150ns, which equals 54 nanoseconds. In the second approach, considering level-wise organization, the average access time is calculated as 0.8 * 30ns + (1 - 0.8) * (30ns + 150ns), which equals 60 nanoseconds.

  • What is the significance of the hit ratio in calculating the average access time of a CPU?

    -The hit ratio, which is the probability of finding the required data in the cache, plays a crucial role in determining the average access time of a CPU. A higher hit ratio means more data is found in the cache, reducing the need to access the slower main memory, thus improving the average access time.

  • How does the size and organization of cache memory affect its access time compared to main memory?

    -Cache memory is typically smaller and more quickly accessed than main memory due to its closer proximity to the processor and optimized organization. This results in a faster access time for cache memory compared to main memory.

  • What is the difference between the two approaches to calculating the average access time as described in the script?

    -The first approach assumes that cache and main memory are simultaneously connected to the processor, while the second approach considers the level-wise organization where the cache access time is added to the main memory access time in case of a miss. The second approach results in a higher average access time due to this additional consideration.

  • Why is it important to consider the organization of memory when calculating average access time?

    -The organization of memory, whether it is simultaneous or level-wise, affects how the processor accesses data. This, in turn, influences the average access time calculation, as different organizations have different implications for how data is retrieved in case of a cache miss.

  • In the context of the script, what does 't_cache' and 't_mm' represent?

    -In the script, 't_cache' represents the access time of the cache memory, and 't_mm' represents the access time of the main memory.

  • What was the question asked in the ISRO CS 2017 paper regarding cache memory and main memory access times?

    -The question in the ISRO CS 2017 paper asked for the average access time of the CPU given a cache memory access time of 30 nanoseconds, main memory access time of 150 nanoseconds, and a hit ratio of 80 percent.

  • How does the level-wise organization of memory affect the calculation of average read access time?

    -In a level-wise organization, the average read access time includes the access time of the cache and the main memory in case of a miss. This is because the processor must access both levels of memory to retrieve the required data.

  • What was the average read access time for a certain processor as discussed in the script, given a cache hit time of 5 nanoseconds and a cache miss time of 50 nanoseconds with an 80 percent hit ratio?

    -The average read access time for the given scenario is calculated as 0.8 * 5ns + (1 - 0.8) * 50ns, which equals 14 nanoseconds.

  • Why is it advised to look at the options first when solving numerical problems in competitive examinations as suggested in the script?

    -Looking at the options first can provide clues about the expected answer format and helps in selecting the correct approach to solve the problem, especially when there are multiple ways to calculate the same quantity.

Outlines

00:00

💡 Introduction to Numerical Problems in Memory Interfacing

This paragraph introduces the session focused on numerical problems related to memory interfacing, which are commonly featured in competitive exams. The speaker emphasizes the importance of not only understanding theoretical concepts but also gaining practical experience. The session begins with a question about calculating the average access time of a CPU given the access times of cache and main memory and a hit ratio. Two approaches are discussed: one assuming simultaneous connection of cache and main memory to the processor, and the other considering a hierarchical memory system. The first approach calculates the average access time as 54 nanoseconds, while the second, which considers the access time of the previous level in case of a miss, results in 60 nanoseconds. The speaker notes that the second approach is correct for the question asked in the ISRO CS 2017 paper and advises students to look at the options first and then solve the problem, as the question usually refers to hierarchical organization unless specified otherwise.

05:04

🔍 Detailed Calculation of Average Read Access Time

The second paragraph delves into a specific numerical problem from the GATE CS 2015 paper, which involves calculating the average read access time given the time taken for a read request on a cache miss and a cache hit, along with a hit ratio. The speaker clarifies that the question explicitly mentions the level-wise organization, which should be considered for solving the problem. The calculation involves adding the access times for cache hits and misses, weighted by the hit ratio. The speaker advises to be careful during calculations, not to overthink, and to simply add the relevant times together. The final answer is calculated as 14 nanoseconds, and the speaker concludes the session by reminding viewers to be extra careful while solving numerical problems, especially during exams.

Mindmap

Keywords

💡Cache Memory

Cache memory is a small, fast memory that stores a subset of data from frequently accessed main memory. In the video, it is discussed in the context of its access time, which is significantly faster than main memory. The video uses a cache memory access time of 30 nanoseconds to illustrate the calculation of average access time in a computer system.

💡Main Memory

Main memory, also known as primary memory or RAM, is a type of storage that a computer uses to store data for processing. It is slower but has a larger capacity than cache memory. The video mentions an access time of 150 nanoseconds for main memory, which is used to calculate the average access time when a cache miss occurs.

💡Access Time

Access time refers to the time it takes for a computer to access data from a memory storage device. The video discusses the access times for both cache and main memory, which are essential for calculating the average memory access time in different scenarios.

💡Hit Ratio

The hit ratio, also known as the hit rate, is the percentage of memory access requests that can be satisfied from the cache. In the video, a hit ratio of 80 percent is used to calculate the average access time for the CPU, indicating that 80% of the time, data is found in the cache.

💡Miss Ratio

Miss ratio is the complement of the hit ratio, representing the percentage of memory access requests that are not found in the cache and must be fetched from the main memory. The video uses the miss ratio to calculate the average access time when data is not found in the cache.

💡Level-wise Organization

Level-wise organization refers to the hierarchical structure of memory where data is first sought in the fastest level (cache) and then in the next level (main memory) if not found. The video explains how this organization affects the calculation of average memory access time, particularly when a cache miss occurs.

💡Read Request

A read request is a command issued by the processor to access data from memory. The video discusses how the time taken for a read request varies depending on whether it results in a cache hit or a cache miss, with specific nanosecond values provided.

💡Cache Hit

A cache hit occurs when the requested data is found in the cache memory. The video uses the term to illustrate the scenario where the processor finds the required data in the cache, leading to a faster access time.

💡Cache Miss

A cache miss occurs when the requested data is not found in the cache memory and must be retrieved from the main memory. The video discusses the impact of cache misses on the average read access time and how it is calculated.

💡Average Access Time

Average access time is the mean time taken to access data from memory, considering both cache hits and misses. The video provides formulas and examples to calculate this time based on hit and miss ratios and the access times of cache and main memory.

💡Competitive Examinations

Competitive examinations are tests that are used to select candidates for various positions or opportunities, often based on merit. The video mentions that the discussed numerical problems are typically asked in such examinations, indicating the practical relevance of the concepts being taught.

Highlights

Introduction to types of numerical problems based on memory interfacing in competitive exams.

The importance of hands-on experience in addition to theoretical knowledge.

Question 1: Cache memory access time is 30 nanoseconds, main memory is 150 nanoseconds.

Assumption of simultaneous connection of cache and main memory to the processor.

Cache memory is smaller and faster than main memory.

Hit ratio of 80 percent (0.8) is given.

Average access time calculation: 0.8 * 30 + 0.2 * 150 nanoseconds.

Result of the first approach: 54 nanoseconds.

Second approach considers level-wise organization.

Access time includes cache and main memory in case of a miss.

Result of the second approach: 60 nanoseconds.

The second approach is the correct answer for the question asked in ISRO CS 2017.

Advice on smart work and considering options before answering.

Question 2: Read request takes 50 nanoseconds on a cache miss, 5 nanoseconds on a cache hit.

Observation: 80 percent of processor read requests result in cache hit.

Average read access time calculation: 0.8 * 5 + 0.2 * 50 nanoseconds.

Result of Question 2: 14 nanoseconds.

Emphasis on careful calculation and not overthinking during problem-solving.

Closing remarks and anticipation for the next session.

Transcripts

play00:06

hello everyone

play00:07

welcome to today's session today we will

play00:10

be introduced to the types of the

play00:12

numerical problems

play00:13

based on memory interfacing that are

play00:16

generally asked

play00:17

in various competitive examinations

play00:19

clearly

play00:20

having only the lucid theoretical

play00:22

conceptions are not enough

play00:24

in order to concrete that knowledge

play00:25

foundation we essentially need

play00:28

hands-on experience in the applications

play00:30

too so

play00:31

let's get to learning let's begin with

play00:34

the question number one

play00:36

a cache memory needs an access time of

play00:39

30 nanoseconds

play00:40

and main memory 150 nanoseconds

play00:44

what is the average access time of the

play00:46

cpu assuming heat ratio is 80 percent

play00:50

now there are two possible solutions to

play00:52

this question

play00:53

we will see them one by one first

play00:56

approach

play00:57

assume both the cachet and the main

play00:59

memory are simultaneously connected to

play01:01

the processor

play01:02

the question states that the access time

play01:04

of cache that is t

play01:06

cache is 30 nanoseconds also tmm or the

play01:09

access time of the main memory

play01:11

is 150 nanoseconds now this is a

play01:14

believable information

play01:15

as the main memory is way bigger in size

play01:18

than the cache

play01:19

also due to its different organization

play01:22

the access time

play01:23

is bound to be greater than the cache

play01:25

now coming to the hit ratio

play01:27

it's already been mentioned in the

play01:29

question itself 80

play01:31

that is 0.8 now let's find out

play01:35

the average access time usually termed

play01:37

as t

play01:38

average for this specific organization

play01:41

h cache is the possibility of finding

play01:43

the required word inside the cache

play01:46

and t cache indicates the access time

play01:48

now considering the chances of not

play01:50

finding the word inside the cache that

play01:52

is 1 minus h cache

play01:54

that is the miss ratio of the cache we

play01:56

will look for the word inside the main

play01:57

memory

play01:58

and tmm is the access time of the main

play02:00

memory

play02:01

substituting the values 0.8 into 30

play02:05

plus 1 minus 0.8 into 150

play02:08

and the unit remains the same

play02:10

nanoseconds

play02:12

which equates to 24 plus

play02:15

0.2 into 150 which finally produces the

play02:19

result as

play02:20

54 nanoseconds now coming to the next

play02:23

approach

play02:24

i presume you already guessed it indeed

play02:26

we are talking about the level wise

play02:28

organization

play02:29

and the only difference in this is the

play02:32

way we calculate

play02:33

the average memory access time here in

play02:36

case of a miss the access time of the

play02:38

previous level

play02:38

is also considered due to the

play02:40

organization so substituting the values

play02:43

0.8 into 30 plus 1 minus 0.8

play02:47

but instead of considering the access

play02:49

time of the main memory only

play02:50

we are to consider the t cache as well

play02:53

because

play02:54

not being able to find the needed word

play02:56

inside the cachet

play02:57

the processor opted for the main memory

play02:59

level wise

play03:00

which finally results in 60 nanoseconds

play03:06

now this question was asked in isro cs

play03:09

2017 paper

play03:11

and these were the options judging the

play03:14

options we can say

play03:15

the second approach produces the correct

play03:17

answer the examiners were looking for

play03:20

so option a 60 is the correct choice for

play03:23

this question

play03:24

now you might be thinking having two

play03:26

ways of solving the same question

play03:28

is bit of a confusing thing but let me

play03:30

tell you here you

play03:32

need to do smart work look for the

play03:33

options first and then

play03:35

answer moreover if questions are asked

play03:38

like this one

play03:39

generally they refer to the level wise

play03:40

organization unless mentioned otherwise

play03:43

but worry not there are questions which

play03:46

clearly mention the exact organization

play03:48

which should consider

play03:49

for problem solving let me read out the

play03:52

question number two

play03:53

assume that for a certain processor a

play03:55

read request takes 50 nanoseconds on a

play03:58

caching miss

play03:59

and five nanoseconds on a cache hit

play04:02

suppose

play04:02

while running a program it was observed

play04:05

that eighty percent of the processor rid

play04:07

requests

play04:08

result in cache hit we are to find out

play04:11

the average read access time that 2 in

play04:14

nanoseconds for this question

play04:16

now it was asked in gate cs 2015 paper

play04:19

and it's clearly talking about the level

play04:21

was organization

play04:23

how is so let's consider the access

play04:25

times

play04:26

a read request takes 50 nanoseconds

play04:29

during cache miss

play04:30

that means total time to access both the

play04:33

cache

play04:34

and the main memory must be 50

play04:36

nanoseconds

play04:37

because during cache hit it's only

play04:40

taking 5 nanoseconds

play04:42

here the question itself is specifying

play04:44

the organization to be considered

play04:46

and regarding hit ratio it's 80 percent

play04:50

that is 0.8 similar to the previous one

play04:53

now let's figure out the average read

play04:55

access time

play04:56

or t average substituting the values

play04:59

0.8 into 5 plus 1 minus 0.8

play05:04

into 50 nanoseconds one more thing

play05:07

during calculations

play05:08

be a bit more careful don't overthink

play05:11

and just add

play05:12

five more to this 50. here 50 is t

play05:15

cash a plus tmm altogether so finally we

play05:19

will have the answer as

play05:20

14 nanoseconds all alright folks

play05:24

that was all for this session remember

play05:26

always be extra careful

play05:28

while solving the numerical problems

play05:30

especially during examinations

play05:32

so i hope to see you in the next one

play05:34

thank you all for watching

play05:39

[Music]

play05:47

you

Rate This

5.0 / 5 (0 votes)

Related Tags
Memory AccessCache Hit RatioCompetitive ExamsCPU Access TimeNumerical ProblemsComputer ScienceTechnical TutorialExam PreparationISRO CSGATE CS