# FCS 22 Nov

- **Course:** 5102 - Foundations of Comp Sys
- **Recorded:** 2026-11-22 00:00
- **Transcript:** 2256 segments, 13420 words
- **Made by:** colab import

---
Why can a processor execute billions of operations per second yet still spend time waiting? If we try to understand this question, then we can understand that computation is only one part of performance. Operants and instructions must arise from a memory system. The session connects two mechanisms. Caches exploit locality to reduce average access time, while memory gives each process a protected, flexible address space. For example, if we are opening a large spreadsheet, Excel sheet. Frequently used instructions and data may remain cached, while the process sees virtual addresses rather than the raw RAM locations. Now, why does the memory hierarchy exists? Basically, the speed, capacity, cost. That is the trade-off. Registers are the fastest. CPU registers are the fastest, but the smallest. RAM, for example, DRAM is larger, but slower. The hard disks, whether it is HDD or SSD, it also adds persistency. RAM do not have persistency.

If you reboot the system or if you close the program, the data that is available in the memory will be erased. So hard disks adds another property, that is storage. It adds another property called persistence. And from the speed perspective, storage is comparatively slower than any of these in this storage mechanism. So why not build the entire memory system from RAM? Now, if you are having a laptop, you can have terabytes of hard disk disk in your laptop, but only tens of gigabytes of RAM, because the technologies serve different roles. You may have 32 GB RAM, but you may have a terabyte of hard disk. So here if the volume is high, here the volume is low, but here the speed is high, here the speed is slower. I won't say low, but it is slower compared to the memory. So these two has two different roles within the system. Now, if you look at the overall hierarchy, the registers, cache within cache, L1 is the lowest in terms of the capacity, but fastest in terms of the speed.

And L3 has comparatively higher capacity, but slower in speed. Then comes memory. Memory is higher than cache in terms of the capacity. But again, in terms of the speed, it is slower than cache. And memory, the next stage is the hard disk, which is higher in terms of the volume, the capacity that it has, it can store, and also adds the quality of persistency. So higher the hierarchy, lower the latency, smaller the capacity and higher cost per bit. How the cost is compared? If you have lower volume and paying higher money, then the rupee that you are spending to store one byte is comparatively higher in L1 cache compared to the hard disk. So lower in the hierarchy, latency is high. The time it takes to reach the processing, that is high. Capacity is larger. The cost is also comparatively lower per bit. Okay, cool. So now, locality. It is a tendency in real workloads. Not a promise. It is statistical. Now, temporal. Temporal is nothing but temporary.

Temporal and spatial locality. How are they different? Temporal will reuse the same location pretty soon compared to the spatial locality where access nearby locations very soon. That is the difference between temporal and spatial locality. And finally, the cache feature block, not just one byte. It is not going to retrieve byte by byte. It will retrieve a block which we refer as a cache line to exploit spatial locality advantage. Because spatial locality gives faster access to the nearby locations. So if you are taking advantage of the spatial locality, then we can retrieve the cache line at a faster pace. So now, for example, if a program repeatedly calls the same function function and it accesses the same array again and again, the function, the data and the nearby array elements are likely to be reused. If it is likely to be reused, then definitely what we will be expecting is, access is faster so that the process is also faster. So the reuse capacity, if you are going to use a temporal,

it will use the same location at a faster pace. So either way, if it is a huge data line by line, then spatial locality is going to help you, then spatial locality is going to help you. If it is like, for example, one variable is getting repeatedly accessed by the program, it could be a global variable being accessed by different functions. So that variable will be stored in the temporal locality until the program completion is executed, completed. It will reuse the same location. So temporal locality for the global variable, but in case if it is an array that is getting stored, it will get stored in the spatial locality because you can access it faster and you can access it it as a total cache line. So now in case, if you are going to, if you are going to write a loop for i in range of n, we say values of i. So we are increasing the i one by one. So the ranges we have, we are telling total plus. Let us assume that this for i loop, we are doing it 0, 1, 2, 3, 4.

So range of 0, value of i added to the total. So what is getting reused again and again here? The total is getting repeatedly read and updated, not just only reading. It also need to be written because we are adding, using this plus, we are adding the total. So whatever data available for the variable total, until this for loop ends with n, this total has to be accessed again and again, updated again and again. The values, for example, 0, 1, 2, 3, 4. If n is equal to 5, 0, 1, 2, 3, 4. Now then, value of 0, value of 1, value of 2 for every increase in the loop. Here the values are changing, but total remains the same. When I say the same, the variable total remains the same. The data is getting updated. That is the value is getting updated for the total. So the variable total is read and updated successfully again and again. What happens if a program repeatedly accesses a small lookup table? After initial misses, after initial misses, later accesses may hit. It may have initial miss,

but it will hit again and again successfully. So now, even the mentioned loop counter frequently accesses can be accessed object fields and not hot functions. So the temporal locality also appears in frequently called functions and hot data structures. In this example, it is the total, which is getting accessed again and again, repeatedly, and also written, written when it has to be updated is 0 plus 1, 1. So initially, the value of total is 0, now it has to be 1. So it has to be overwritten with the value. So this has to be available for this loop all the time, otherwise the function is going to fail. So this is where exactly the temporal locality comes in handy to store the repeatedly used objects. And as we saw before, it can be accessed fastly because it is going to use the same location. And since it is pretty soon, obviously it will use the same location and update the data. So when it has to access the total again, it knows where exactly to

access and the value only it has to read before it goes and adds 1 is the current total value. Now we have increased the value of i. So values of 1, which is like 2. So 1 plus 2 is 3. Now this total has to be updated with 3 instead of 1. So the temporal locality will store all the repeatedly used objects and it ensures that it is available by making sure that it stores in the same location. Now spatial locality. In the same example, if you look at it, values of 0, values of 1, values of 2, values of 3. The second part of the loop is basically to fetch the value and add it to the total. So here the value in values of 0, that is the first element in the array. There is the second element in the array, third element and the fourth element and it goes on. So the values are also different. The variable also is different. The variable is the, here in this case, it is the first element of the array called values. So like this, values might have 10 elements in the array or 100 elements in the array.

So values is only one variable, but it is of type array, but it can store multiple values. So now if I have access to values of 0, physically if you look at it where it should be, it should be in a memory. Now from the memory, it has to go to the processor for it to get processed so that the output can be written back into the memory. Unless the program writes the data from memory to a disk, that operation will not happen. It depends on the program. In case if you are accessing the values, calculating the total and displaying the total on the screen and you are coming out. So now you are not writing anything in the hard disk. So where are these values are stored? It is stored in the memory, but this array will be storing in a special locality. Now, you can take a whole lot of the data, you've heard the data. You can read the data. Now, you know, it's the same thing as I'm supposed to do, like you said.

So I'm going to, you know, it's the same thing as a user. It's the same thing. Thank you. Hi, guys. Sorry, I got disconnected. I had to choose another internet connection. It took a couple of minutes. Can I know if you confirm, am I audible, am I clear? Hey, guys, thank you so much. I'm really sorry for that. Just a minute. Let me go ahead and share my screen. Can I know if you confirm, is my screen visible? Can I know if you confirm, is my screen visible? Okay, cool. Okay, thank you so much. Okay, let us continue. Sorry for the interruption. Sorry for the interruption. Okay, where will be? We were in special rule. We are in special locality. Okay. So now, we are discussing about if in this for loop, we have a range, we have total, we have values. Range of n, value to be stored in the total. And the array will be stored in the array called values. So total, we saw, it has to be repeatedly accessed for both read and write.

So it will be stored in the temporal locality. And values is an array. And that array will have multiple values within that single array. And each array has to be stored. Each, sorry, each element in the array has to be stored. So the adjacent elements often occupy adjacent byte. It has to be stored in the memory. In that case, where will it locate? It will locate in the special memory. The reason is, it will give you an access. It will store it in the next location that is accessible faster. And also, if you want to read the entire array and put it back to the processing, then it can pick it up as a cache line and adjacent locations it will be stored. And it is faster and easy access. So one cache line can supply several future loads. In this case, suppose if the array has 254 values, then at least if not the whole array, it will supply for the future, several future loads immediately. So a row-wise traversal of Python, numpy array, is usually more cache friendly than jumping randomly access memory.

Link list is another example which may show weaker spatial locality than array traversal. But still, when you look at the values that it needs to be supplied for that for loop, the moment the first cycle is completed in the loop, automatically value 1 will be supplied. Once it is completed, value 2 will go. Immediately, our processing is not getting hit. So our program performance is also not getting hit. So if it is an array, then probably the spatial locality, that is what is going to help us to process with a very good response back to the user. Now, we know the cache is a small store of recently used memory blocks. Okay. Now, there is a concept of hit and miss. What is this hit and miss? The requested block is already in the cache. That is hit. That means hit means the requested block is present at the relevant cache level. The main difference is that temporal will use the same location in the memory or cache.

Temporal is a type, spatial is a type. Temporal will use the same location so that immediately reused and recently going to be used will be accessed faster. And that is what we saw is the total in which it has to be in the entire for loop. The total will be accessed in every loop. In case of values, the next loop is going to access the next element in the array. So, that is the difference between temporal and spatial. Now, a hit means the requested block is present at the relevant cache level. Miss means that level must obtain the block from a lower level. It is not that the program will not get the value or get the variable. This means not in the actual sense, okay, it is missed, not happened. Not in that sense. Here, the hit and miss means it is referring to whether the requested block is available in the cache or not. If it is not available in the cache, then it will go to the lower level. And the lower level must supply it.

It will supply it. So, the definition of cache hit and cache misses basically determines the level of the performance of the program. It does not mean the program will fail. It does not mean the operation will fail. It is just that the data needs to be supplied by the next lower level. What is the next lower level? If it is not in L1, L2 will supply. If it is not in L2, L3 will supply. If it is not in L3, then SRAM will supply or DERA will supply. If it is not there in RAM also, then it has to fetch it from the hard disk. Now, the time taken to get the value. If it has got the value from the requested block, which was already present in the cache, you hit. Otherwise, you miss. It does not mean that you will not get it. You will get it. But it will take some time for you to fetch the data that you are looking for. That is miss. Now, a cache line is nothing but the transfer for an allocation unit. That is what the cache line is.

Not necessarily the size of the requested variable. Cache line is a fixed aligned block transferred between memory levels. When I say memory level, it is right from L1, L2, L3 and RAM. All are considered as memory levels. So, cache line is of a fixed size. Suppose if you have three elements in your array. And if all the three elements come within the fixed size, then the whole array is a cache line. You have 30 elements in your array. But only 10 elements are fitting the fixed size of the cache line. 10 elements will be taken. When will the next 10 comes? Basically, the first 10 is completed for processing. Then when it is looking for the 11th element, at that time, the next 10 elements will be loaded. So, why it will load the entire 10 elements? Because that's the cached line size. It can also happen. You have 30 elements in your cache. Sorry, in your array. And in the first cache line, 10 elements has fit.

So, it will get loaded. Now, when the 11th element is being accessed, then the entire next cache line will get loaded. It may be so happen that element 11 to element 19 will get loaded instead of 11 to 20. It does not mean that, okay, in the first cycle, we got 10 elements of the array. In the next cycle also, we will get 10 elements. It is not so. It depends on the size of the elements. Even if it is numerical, 0, 1, 2, 3, up to 10. Then 11, 12, 13, 14, 15, up to 20. Then it may fit. Because the representation in terms of bits and also size being fixed, the content is not having a variable length. In case if your array is not numerical, but it is a string, it contains the sentence, Taj Mahal is a beautiful monument located at Agra. If these sentences bifurcated into elements and stored in an array, obviously located is of a different size. Agra only four characters. Is is only two characters. Mahal is five characters.

So now you can see each and every value is of different size. So when you are loading this, Taj Mahal is a beautiful monument located at Agra into your array. And suppose if it is able to fit only Taj Mahal is a, then greatest monument location, Agra, everything will come as part of the second cash line. In the size of the cash line is not going to change. It is fixed. So initially it could be Taj Mahal is air is something that would have come in the first cycle. And the second cycle might have great monument. If you are trying to add something else, probably it would exceed the size of the cash line. The size of the cash line is fixed irrespective of what you are getting loaded and what type of data you are getting loaded. So in that case, probably great monument could be taken up and pushed to the lower levels and made it available for the program. Because if it is available in the lower level, it is easy to fetch compared to the higher level, which is going to take some time to fetch.

So what is the major concern here is the time factor. Nothing to do with the content. It has nothing to do with the application. It has nothing to do with the end user expectation. It all aligns. But what differs is the size. So Sundar, if that is the case, then we should have most of the things in memory. Because it also has ability to store. It also functions in the way that it needs to function. But still, you will see somebody who is interacting with the customer will continue to do and will love to continue to do. Similarly here, any data analyst or any data engineers who are working on these type of data will also become part of them to understand, analyze, estimate the objectives. So we have two options. Within that only we have to choose. But again, whatever we are choosing, it is going to go from the lowest form of latency. Basically, it could be A, B, C, D or E with the same consideration. So the objective is very clear.

The objective is to provide uninterrupted connectivity. Okay, cool. So now if this is the case, Sundar, then what will happen to, I think that we will not be able to record. We may be able to refer, but we may not be able to record. For example, if it is special. Then we know that, yes, it will be available, because we only have tried it. So we are good. But what will happen to this individual who has come to work, probably for the last two, three days. So now, the question that comes to our mind is, what next? That I understand different levels of memory. That includes L1, L2, L3 cache as well. We are trying to connect the dots in terms of the memory. We should consider the cache also, because it is a cache, but it's a cache memory. We will be, or we can probably use that. Okay. Yes, Sundar, we tried it, but we didn't get the desired result. What is it we are expecting after this? Okay, cool. Now, we have seen how L1, L2, L3, and memory, basically as DRAM, and also the hard disk compared

it within terms of other data transfers, and where exactly it resides, for what purpose, and how long. How long is something that we can define, if it is not defined, it is infinite. So it can be present in the system forever, if we do not action. So what next? And that is what we are going to understand. Now, fully, we are on the same page. As far as cache line is concerned, understanding about cache line, understanding about cache miss, and understanding about cache hit. So I would like to pause here and check if there are any queries, questions, from anyone about what we have seen until now, let me stop sharing and share it again. If spatial locality improves cache performance by loading nearby memory locations together, what happens when a program accesses memory locations randomly? Okay. Does the CPU still load the entire cache line? Okay. First of all, why it has to access randomly? If you are going to make the program to access the memory random, then obviously you are not

storing or you are not looking for an error. You might be looking for a single value. If it is repeated, then it will be in the locality, obviously it will have faster. So, yes, I know there is a concept that you can access the locations remotely and as well as randomly, but it does not change the performance of the program. Will CPU cache still load the entire cache line? The answer is yes. Whenever a cache line is getting loaded, it will load fully. If it is not available, then it is a miss. That means we need to get that rest part or the new one from the lower level cache. If it is not available in lower level cache, it has to obviously get it from the memory. If not in memory, we have to get it from. So this is how we approach. But as far as the design is concerned, you will definitely hit it back at L3 or something. It is very rare that it goes beyond that. It is not that it is going to tell us something that we do not know.

It is going to indicate us what we already know. So this way, definitely the behavior of the CPU is going to be properly in terms of the cache line, not randomly. It won't do random. In case of cache, it will know where it is stored. It will hit the first and then it will fetch the overall slide. That is how it works. If it is not able to identify the first element value or the first element of the value in that cycle, then it will put words to the next line. Explain what it is going to say. It is again going to say the starting and the ending of it. Then what we will achieve. That's normally the message that comes. But our focus should be more on the practice that we do rather than just understanding the concept. I would like to pass here and check if there are any queries, questions before we move ahead. Okay, cool. Let me share my window again. Hope my window is visible. So we have seen cache hit, cache miss and cache line.

Now the cache address anatomy. So let us take an example of three fields. One is add, second is index and the third is type. This is for a set associative cache. The addresses are generally divided into fields. The field is tag, which is basically which block. Index, basically which set. And basically the byte offset. Byte offset is nothing but which byte it has to start and which byte it has to end. Even within the byte, it needs to know which byte. So the offset selects a byte within a line, sets index and selects a set. Tag distinguishes the memory block. Tag is nothing but the memory block. Now, suppose let us see the line size is 16 bytes. So addresses 0 to 15 is what we will use. Which are in the block 0. Block 0 is going to have 0 to 15. And block 1 will have 16 to 31. Block 2 will have 32 to 45. So this is how the blocks are going to be made available. The number of sets is 2. Let us restrict ourselves to 2 sets.

That means 2 blocks. And it will occupy right from 0 to 16 is 1. And 17 to 36 is another. And this is how we look at the cache address. And this is what exactly the anatomy speaks about. So now, the next thing is, where can a block go? Okay, block 0, block 1. Block 0 is used. Where can it go? Block 1 is currently being used. So where is it? The next block, block 2 is going to come. It will come from the cache or wire memory or even database. But, how? And the process is basically called as mapping. Where can a block go? Which area it will get stored? So there are actually three common placement strategies. And basically you can think this as three different designs. So directly mapped. Exactly one possible cache line. Very simple. But conflict misses can occur. Miss again, I just wanted to reiterate. Miss doesn't mean a negative that we have missed it and we will not get it further. Miss means only that it is not available in the highest cache, which is L1.

So Sundar, if we assume that we have two different arrays, both the arrays are getting split because of the size of the block into two. But within the two, it will supply all the values of the array. 0 to 29. So now 0 to 12 is one break. And another is another break. So this break actually leads to the different blocks. And each block has its own address and it will have its own content. And that is how it is going to store and as well as get searched for the values of this program. Okay. Now, let us try to calculate. Let us try to calculate a number of sets. Basically, 64 divided by, in the denominator, we have 16 into 2. 16 into 2 is nothing but 32. So 64 by 32 is equal to 2. So basically, two sets. When you say two sets, it is address 0, block 0, set 0. So like that, you will have address 0, block 0 and set 1. Then it will increase the blocks if the sets are over. And if the block is also getting over, then it will release the address space.

So now addresses 0 and 32 compete for the same set. But can co-exist in two ways. One is that address 64, which is block 4, is set to 0. So now it has to compete again and may cause an eviction. So now if something is Cushantyana for eviction, then definitely it is So now we have understood how the mapping also works. So basically our focus is now on memory, memory levels, L1 cache up to RAM. Storage is basically adds up consistency and persistency. And the other side CPU registers are basically the one which is going to use the values that is going to be part of the processing at that point of time. So that leads to blocks and sets. And sets, if it gets over, then the block gets increased. And if the blocks are getting over, then So any queries, any questions until now? Are we good? Are we on the same page? Okay. Let me stop sharing. The slides of previous classes I have uploaded. Are you not able to see it in the model?

Are you not able to see it in the model? I think I have uploaded until like RISC. Can one of you confirm? Are you not able to see the RISC document? R-I-C-E. Sorry. R-I-S-E. Sorry. R-I-S-E. Until then I have already uploaded. If you are not able to see them, please let me know. Why is memory address divided into tag, index, and offset instead of using the complete? Okay. I can see that in and the RIS. Labs. That is the same month. FCS lab one, two, three, four. FCS theory one, two, three, four. No RIS. Let me also check. And if it is not uploaded, definitely I will upload. Probably I might have uploaded it to the right place. I'll do that. I'll check if it is in the right place or not. If not, I'll just move it. Not an issue. Any other curious questions before we move ahead, guys? Okay. Cool. Let me just share my screen again. So now we have seen how the mapping works. The next is when a set is full, which line should leave?

So basically the eviction, when the set is full, that's where this replacement policy comes and plays its role. It only matters when the target set is full. Until then, the replacement policy does not even kick off. LRU evicts the least recently used line. That is the first one. If you have a line that is available in the cache, which is not being used in the last 24 hours, for example, that will be evicted from the LRU. Both fit because there are two ways of doing it. So address 64 gives block 4, also set 0. Now three competing blocks cannot all remain. So this makes actually conflict replacement tangible. So FIFO evicts the oldest resident line. Okay. Now, you have 10 cache lines. When we see the oldest, the one which has arrived, and been available in that. Per continuous period of time where others is not able to. This is not able to. That's it. Okay. Just give me a minute. Okay. So now let us look at the replacement policy, LRUs, we have seen, which will remove the least recently used.

Suppose if you have 10 lines available, then probably the eighth one, which is not being used for some time now. So it will remove the eighth, keep all the lines in order. So that's exactly it. Now, someone was asking, so what will happen if it is random? So it is basically in such a manner that it is just a hardware implementation and hardware resource utilization. So can we do? Yes, we can. But it will lead to more. More processing and more storage as well. Now, when there is an implementation specific policy, that do not assume exact LRU. Then in that case, the CPUs will act on its behalf. Does it happen very frequently? If it happens very frequently, then the performance is lower. But if we identify and rectify that as soon as possible, then it will not impact. So impact is not there, but it doesn't mean that it can be slight enough. It's always better if we check the end opinion. Okay. Cool. Now, we understand how the replacement policy also is defined and work to when the memory

is full. There is no place to, okay, understand. Okay. So any other queries, questions before we move ahead? Let's turn to the next part of this lecture. So that any queries, any questions from anyone? Okay. Cool. So we have seen the replacement also, how it happens and what policy it follows. But if you want to keep cache and lower memory consistent. Now, we understand how the lower memory plays the role. What is the type and how fast it is, how it impacts the speed and performance. Now, if you want to keep the cache and the lower memory consistent. If it is inconsistent, obviously you'll get the data, but it is going to put some stress on the system and as well as utilization in terms of the resources. So what can we do? So we can have the updates lower memory on every store. And we can use write back. What is write back? Write back is nothing but a mark. It's nothing else. It's just a mark. And it will mark what?

It will mark the... It will mark the line to make available. So write back actually marks the cache line dirty. Place the lower level right until eviction or even flush. Now, you also need to understand traffic versus complexity or consistency. So, one practical analogy could be, you're updating a shared ledger immediately versus patching changes and recording, recancelizing it later. You have two different options. While the transaction is happening, let it go ahead and update there also. So, we can basically plan ourselves and then keep it fit. So, that is what the write back does. And write through, what is write through? Write through is nothing but updating the cache and lower memory on each write. For example of the for loop, where does the write happens? It happens to the variable called total. Arrays are getting retrieved. So, we have understood the write through, we have understood the write back.

And we also have something called write allocate. All these are related to the write operations and update. Best example is the total in our for loop. It commonly allocates or fetches a line on a write miss. So, that means we are allocating, write allocate, commonly fetches a line on the write miss. When you are going to write the element. When you are going to write the element, you are going to update the element in your row. And obviously, it needs to accept the test to be made available. So, that way, like it is not going to be very nice. But can happen in a day or two as well. So, now, let us also look at the cache miss. It actually helps us to diagnose the performance. It's not about only counting the misses. If you are just going to merely count the misses and not look beyond that. Then, we will not be able to identify or diagnose the back to the performance. So, first access to a block that is compulsory.

And the definition of a compulsory is as first ever access. That means it is not available in the cache. If you are going to available. If you are going to access the available, then it is fine. But, when the capacity of the working set is too large and also conflicting. Can I have more than one as a value compared to any other offerings? That would not be. That would not be. So, you really need to put across something that what you need to put across. Then, you need to face them against the. Okay. Anything else from anyone before we move ahead? Cash misses. It's very useful. Especially, first block. First access to the block is compulsory. The working set does not fit in the cache. In that case, we have more than what a cache line can hold. And there could be conflicts. Blocks compete for the same set, even when other sets have room. There are room. But, if it is a competition of the same set, then how are we?

It's a conflict. Two things trying to get bordered into a single thing. So, that means, when you are trying to retrieve, whether it is the first element or the second element that is stored in that particular memory address, just from there only the data will be accessed. So, that way, when there is a competition for the same location for two different sets of variables, then we call it as a conflict. Not just, not only in terms of the storage, but in terms of other fields as well. This clarity we should. So now, cache misses. It's basically a useful classification that leads to identifying the gaps. Let me, let me. Okay, cool. So, hopefully I think we are good with the understanding of the cache miss as well. Let me stop sharing. So, what we have seen is basically why memory hierarchy exists. The reason we understood. What is the memory hierarchy and how it is laid down? Right from registers to persistent storage.

We also understood the locality. There are two types. One is temporal and another one is spatial locality. Temporal will store repeated values or repeated variable. So, I understand that. Ignore assignment one. I think I will delete it. Okay, coming back. So, we understood the difference between the temporal and the spatial locality. We also understood the concept of hit, miss and line for the cache. And what is the anatomy of the cache address? And what is the role of the mapping and the replacement policy? And if you want to retain how the write-through and write-back helps us to retain the value in the same cache itself. And where exactly the cache misses helps us as a useful classification. And the checkpoint. Checkpoint. Basically, array work, spatial locality, repeated accumulator, temporal locality. So, two blocks competing for one directly map the line. Then it is a conflict or miss. Write-back may reduce lower-level write when multiple writes to a line are combined.

Can I combine? Yes, we can. It's data as usual and we can definitely. Now, the real traces can contain overlapping cases. And this classification is diagnostic framework. So, which category a cold was feeling belongs to? I believe that we should be able to identify and understand. What we have seen. We will take a quick break of five minutes. Once we are back, we will start about virtual memory. Now you have memory, physical memory, SRAM, DRAM. But we also have the concept of a virtual memory. Like we have a virtual server, virtual memory. How it works and what is the relationship between and correct memory. So, any questions before we go after a break? Are we good? Yes, no, maybe. Okay. Where are the replacement policies used? Okay. Whenever it wants to reconcile, retain in the same location. So, the write back policy, modify the data remains in the cache and RAM contains an ultra value. Okay. This, let me clarify.

The data will be stored in one of these. The moment it is moved from memory, that is RAM, to a cache block, it will be evicted. Unless your program writes back. Unless your program writes back. Unless your programming logic writes back over for a particular date. Okay. Cool. Similarly, it's the same thing. So, the write back policy will retain the data in the same location, irrespective of whether it has to go or it has to wait. If a doctor has told the theory, it definitely will be. So, something like that, even in the write back policy, it actually confirms the availability of the data in the similar location, spatial location, not at this space. Anything that they have been offered is not available at this space. Okay. Cool. So, let us take a quick five-minute break. I just stopped sharing with this. So, what is write-around? We will start with that when we come back. So, just for the convenience purpose, what I am going to do is, I am just going to run

a five-minute break. So, that if you are going to see the recording later, you should be able to move the recording for the next topic. For that reason, I am just going to run a five-minute break. Yes. Thank You, guys. Thank you. Thank you, guys. Thank you. Please come back. I have one extra minute. Please come back soon. Thank you. So, Okay. Thank you. So, Thank you. It is, So, Thank you. So, Thank you. You, Thank you, on common 64-bit systems. So, now can we understand the address translation? So basically, we know that a page table stores virtual page mapping information. So now the page size is 256. Let us assume. That is 256 GB. Now virtual address 270. So, VPN that is the offset is 270 divided by 256 which is 14. 276 minus 256 which is 14. So, if VPN 1 maps to frame 2, then the physical address is equal to 2 into 1, 256 plus 14. That is 526. The often does not change. What does not change? The offset. And in case if you are going to compute a virtual

virtual Okay. So, the address translation offset is 250 by 250, 270 minus 256. offset is 250 by 250, 270 minus 256 in case if we take the example of 256 and 270 KB. So, if VPN 1 maps to frame 2, 2, then the physical address is 2 into 256 plus 14, that is 526. So, stress that offset does not change. Offset is not changing. So, basically, if you have virtual address 530, and VPN is mapping to frame 2, offset is 80. How are you going to compute? You can try with this formula. with this formula, it will, the page size, the frame number, page size plus offset. So, this is how the address is translated. Once the address is translated, then, easy for us to look around and bring the data up, information that is required. Now, page table are nothing but memory addresses too. So, CPUs cache recent transactions in a TLB. A TLB hit returns the frame very quickly and a TLB miss because a page table, table block. If the PTE is present, then,

this is not a page fault. This, basically, even if you are trying for your examinations or something like that, this is going to help you. This understanding, especially this topic, a cache for translations, well, I have questions in case if you are appearing for any certain patients. So, the best example is again, repeatedly accessing pages in a loop, tends to reuse TLB. the entries. So, that's what the role of the TLB. And again, TLB has its own hits and miss. It does not mean that we did not get the data in case if we are telling TLB miss. where it is basically the operating system performing the required page table walk. Then, we cache the result. Like how we have cache it, cache miss. TLB also had hit and miss. Miss, again, is going to increase the time for processing other than that it has no impact. That is what the miss. Miss means here we are missing the latency. Yet, TLB miss is not automatically a page fault. A page fault means the mapping needs operating system

handling. So, sometime, your mission crashes, or sometime your application crashes, then you might see this type of page fault information which will help us to diagnose what went wrong. in this entire process. So, now, TPU traps. Where is it? Where is it going to trap? It is going to trap the operating system. the operating system. The operating system checks whether the access is valid or not. If page is not resident, operating system obtains or constructs it. And retries the instruction. So, instruction also is not going to fail. It will retry. So, what is the impact? Impact is, again, the time it takes to process. Demand paging means load on first use. When the first time it is going to load for the first use, then it is called as demand paging. And a page fault can be resolved without this case. any input-output is required. Without that, we will be able to, for example, zero fill on demand or even copy on write.

valid access to terminate the process. process. So, this is the demand paging and the page fault. The demand paging is nothing but loading on first use. It is the first time that it is going to access it and bring it up. And it is going to refer it. But since it has not been tested, we are going to, our objective is basically to bring them up and see if our outcome is secured. So, this page fault is basically a process fault or could be a termination also. How does it happen? Invalid addresses that are being referred by the MMC. Or it might be referring to any of the disallowed. So, these are all the reasons that it can bring out a page fault, but the happening of the page fault is very, very rare. unless there has been some conflict, it led to the same operation within the system. Until then, there is no overlap. Even though if the page faults, we don't need to think that we need immediate attention. we should not be thinking so.

So, that is about the demand paging. Now, protection and permissions. we are still in the page table. It also needs a security boundary. So, how can we secure it? We can secure it with PTE permissions. How is it going to help us? It will help us in restricting the access with read, write and execute access. A write to a read-only page triggers a protection fault. It is not a page fault. It will lead to the protection fault. Because we are protected and it is writing, trying to write. It is supposed to have that as a read-only. So now, in case if you have the user or kernel privilege levels, generally we don't do with any of the individual devices. So now, with page fault, demand damming, protection, with permissions. Now, with all these things, we also have privilege levels for the user or the kernel level. Actually, that actually adds in another dimension of access control. So, that actually adds in another dimension of access control.

So, the shared pages can only be mapped read-only or copy-on-write to multiple processes. Suppose, if you are running multiple functions and there are like end users logging into the environment and the same process is being used by multiple. So, there would probably be a conflict conflict but that conflict could lead to a conflict maze. So, with all these things, we will try to put the path together. Now, it's a sort of a complete pipeline. Now, from instruction to memory. This is a complete pipeline. Instruction generates virtual address. Now, the TLB is checked. if it is on miss, what will happen? If TLB is missing. So, page table is consulted. When the page table is consulted. When the page table is consulted? When there is a miss. So, absent page triggers page fault. So, you understand that? So, the present mapping plus permissions yields. The PA data is accessed. accessed. Especially VMware. Guest physical address is then led to second level transition.

Oh. CPU. CPU nothing but registers L1, L2 and L3 to TLB. From TLB to page table. Page table is going to acquire the frame of a RAM. It will do the process. After processing, it will return the outcome data. Okay. So, what if there is a page fault? The operating system tries to revolve, resolve. And if it is able to resolve, then the page fault is resolved. Then it goes back to the page strip. But what if the operating system is not able to resolve? It will retry. It is not going to stop the retry until we close it. So, now you are using this facility or protecting your environment environment and when the user is accessing. If the user is not able to access, if they see. Okay. So, when the permission is denied, then only the protection fault. Because we have protected it, someone is trying to access it. So, then we call it as protection fault. Okay. Cool. Now, let us look at a Python demonstration. So, we will see a configurable set associate cache LRU replacement

write-through and write-back in one part of it. And the second part we will be able to see the virtual pages. And we will be able to see DTEs, not the industry records, but it will definitely give you index records. Then the output prints every hit and miss in that program. and it will also tell you the translation. The page falls in case if it happens. And then eviction and the protection. The entire cycle. The entire cycle with the help of a patent program. We are going to look at it. it does not impact the real CPU caches, internal pages, or even VMware internal. It does not impact irrespective of having. So, let me stop sharing the screen. Let me open up my VMware and then I will share the Linux box. Just give me a minute. And that Linux box will, the Linux box will be using the Python program. The Python program. Please. Page is used to translate virtual address into physical address. That's right. So, we are getting confused between virtual memory and virtual machine.

Okay. memory is something that you are having as one of the accessories in your laptop. Now, your laptop is a physical machine. And memory is a card. It is a part of your laptop. It is two different entities. Now, when you are using VMware sort of application, what it will help you to achieve is, you are trying to bring up a machine which is not there, but still functioning. So, it is not there, but there. That is what the virtualization of software is like. VMware is helping you to achieve. Now, when you are creating that virtual machine, that virtual machine also needs to have some memory. Where does that memory come from? Because the machine itself is virtual, not identifiable, not healable. So, where it is going to get its memory, it is going to get it from the physical RAM. Now, not only your lab, but your memory is also virtualized. Like memory, your processor also is virtualized. Your storage also is virtualized. So, when you say virtual machine,

it is a combination of some part of your physical memory, some part of your CPU, and some part of your storage along with other components. these three are the major. So, that is virtual machine. Now, both involves virtualization. And rather than saying both involves virtualization, we can say it that way that virtualization helps us to bring up the virtual machine, where its memory is also virtual. virtual. So, that is the right way of putting across. If you have understood this, you should be good. They are not related. It is one into the another. A virtual machine requires a physical machine. So, you can run one virtual machine in a physical machine, or you can also run three virtual machines in a single physical machine. So, it is related in a manner, if at all we wanted to relate it. The resources that are used to buy the virtual machines is from the physical machine. Okay, great. So, Satya is asking, if RAM is crowded,

then the operating system moves some data to the swap. And that swap space is the virtual memory. virtual memory. Okay. You are right. Why we call that also a virtual memory? Taking a part of memory to a virtual machine, that is also referred as virtual machine. If you are taking a part of your hard disk, when you say the RAM is crowded and the operating system moves data, where is it moving? is moving to the hard disk. So, you can say swap memory, you can say paging. Paging is the name of the process. Swap memory is the type of the memory. Called a swap memory because it swaps the data between memory and the hard disk. So, if I don't define a swap memory, that means I am using the entire hard disk as a hard disk. I am not trying to make one part of hard disk as a memory. Now, a practical question. Is swap accepted in applications like Kubernetes? The answer is no. That means I can't help paging process that system. When Kubernetes is running,

the answer is yes, we can't. We can't. Now, why Kubernetes is not supporting that memory? It is nothing but virtual memory. So, now, imagine. Okay. So, let me share this. Let me share this. Okay. Cool. Just a minute, please. Just a minute, please. Let me share it. Okay. Oops, why is it not opening? Okay, let me try paint. Cool. Let me share it. Okay, hopefully this will clarify everyone. So this is my physical server. I have two servers. And two physical servers in this, it's huge. So what I'm trying to do is I'm just trying to basically make smaller servers. So I create virtual servers here. So I have three virtual machines in both the servers. So now, each virtual machine is going to have all the components, like disk, storage, memory, and processor. So now what I'm trying to do here is I'm just, this is one, this is two, and this is three. Let me name this as virtual machine four, five, and so what I'm going to do is I'm just going to use

virtual machine one as master. And I'm going to make, I'm going to make, I'm going to make all this, five other virtual machines as nodes. As my Kubernetes cluster. These are all my nodes. So, now Sundar, you said that paging is not allowed in Kubernetes. Why? Now, when I'm going to make this Kubernetes cluster, I will be installing an application called Kubernetes. Basically, three different packages will help us to create this cluster. So at the first level, I have used VMware to create virtual machine. this is level one. And at the level two, what is Kubernetes is doing? Kubernetes is also going to virtualize. Virtualize the virtual virtual machines. How? It is going to run components called pods. What are pods? Pods are small units which is going to run which is going to run which is going to run our application inside the container. So, when you say I'm using Kubernetes, obviously, you have microservice to your application. And for each

microservice, you have created an image and each image will run as a container and each container will run the application and the container is going to run inside the pod. So, each container, each pod will have the applications running. Now, what is this pod? Pod is containing the application inside it. So, now, if the application has to run, where is it going to get the resources? It needs memory, it needs processor, it needs storage also. It also needs a network interface so that it can communicate between the pods. Where is it going to get? Again, Kubernetes is going to virtualize the virtualized memory and provide a small portion of it to the pod. So, now, let us put numbers and then we will understand that. Assume that this has 64 GB memory. This also has 64 GB memory. Now, what we have done is, we have made all these virtual missions as 8 GB. Each virtual mission has 8 GB memory. So, that means this has 8 GB memory, this has 8 GB memory, every virtual mission, 4, 5, 6. Now, virtual

machines, 2, 3, 4, 5, 6 are running our pods. That means our applications are running inside this virtual machine and each pod, we will probably provide 2 GB RAM. So, that means this virtual machine can run a maximum of 3 pods because it also requires some memory to run its own operating system and other depending software. So, allocating that 2 GB, rest 6 GB can be allocated maximum to 3 pods. Here also, we can run 3 pods. So, every virtual machine will run 3 pods. Now, this is our server S2 and this is our server S1. In S1, how many pods are running? 3 here and 3 here, so 6 will run. This server to S2 is running 3 virtual machines because this does not run any master, all are nodes. so all the 3 virtual machines are capable of running pods. So, this can run up to 9 pods, 3 each virtual machine. So, at the system level you have 64 GB RAM. At the virtual machine level you are virtualizing this 64 to 8 for each virtual machine. and this 8 GB is again virtualized as 2 GB for each pods. Now, in this scenario,

if you are also going to use the hard disk of this virtual machine and swap it as a memory, then Kubernetes master will get confused. Whether this is hard disk or whether it is RAM, this is a hard disk, now it is used as a RAM, suddenly your application is hung, now the paging has stopped, the virtual hard disk which is nothing but the memory, virtual memory, now became a hard disk. so the Kubernetes will get confused because the Kubernetes is providing resources to our application that is running inside our pods from the virtual memory only. So can I virtualize my hard disk? Yes, it can, as a memory, but if you do so, then is it really a hard disk or a memory? Kubernetes will get confused. So that's the reason Kubernetes says that I'm going to look at your storage as a storage, I'm going to look at your memory as a memory, don't confuse me by changing the identity of a resource. Then our application will get confused, it might hang, it might use it for a different purpose or the process also

can get killed because of these confusions. That's the reason, to avoid that risk, Kubernetes will not allow any paging or swapping activity in that physical service where Kubernetes is running. That is only for the Kubernetes. Now, Sundar, I have created three virtual missions. Now, I have used only two, three, four, five, six as a cluster and I have made virtual machine six as my master and rest, everything is a node and this is a independent virtual machine which is not running as part of the Kubernetes cluster but it is running in S1. Which one? This virtual machine. This is not part of the Kubernetes cluster which I have created. so can I use paging here in this virtual machine? The answer is yes. This virtual machine can use paging using the hard disk of this server one. So, it depends for what purpose you have deployed your virtual machines and other things. but generally when you are speaking about virtual memory it can refer to two different things. One is the one what is

referred here in this virtual machine. Second is where you are using for paging. If you are using for paging that means you are using hard disk as a memory. That memory is also called as virtual machine. Sorry, virtual memory. So, you need to identify the context first before understanding the virtual memory. Any queries, any questions? Okay. What is the main role of Kubernetes? Okay. It is a container orchestration tool. In short, it is an orchestration tool. It will run all your containers. That is something which can be understood immediately. But why should I require container orchestration? Because I have containers. So I need to have a container orchestration. Why do I need a container? Because to avoid the limitations of running in a single physical mission or a single virtual mission? Because if you are running the application on a single physical mission or a single virtual machine, then the resources are limited to the resources available in that machine only. I will not be able to

use resources available in other machines from the other regions. that is the reason we create a group of servers and that group of servers are called as cluster. So we have containers. to take the container and run the application, we need container orchestration. That container orchestration is Kubernetes. Now, what is the advantage? If you are having five, as I said, shown you, if you have five virtual machines, part of your cluster, then Kubernetes can run that particular container in one of the five virtual machines. So that means whatever resources available in those five virtual machines or five physical machines are available for your application, you can run in any one of them, wherever resources are available at that point of time. So that we require Kubernetes. Hope that helps. Cool. Anything else from anyone? Cool, I answered this. if you run an AWS or Azure virtual machine, why are putty on our machine? Okay. Putty is a small application. It has nothing

to do with the virtual machine. It cannot create a virtual machine. It cannot run a virtual machine. all it can do is it will help you to access the virtual machine that is running in the AWS environment. So it is a remote access application. virtual machine. So it has nothing to do with the virtual machine. So it has nothing to do with the resources of the virtual machine also. It is, it will just create an interface in your laptop or in your system wherein you will be able to see the AWS virtual machine in your laptop. Apart from that application like Putty has no role in running the virtual machine. It is only to access the virtual machine. Once you have accessed using the Putty, then the resources that are being used is of AWS resources only, not your laptop resources. The same question if you have asked, if I am running the virtual machine in my laptop and I am having a Putty in my laptop and I am using Putty to access the virtual machine which is running in my laptop,

then is it using my laptop's resources? 100% yes. So conceptually, Putty has no relationship of which resources to be used by the virtual machine. It is only an interface to access the virtual machine. Great. Anything else? Guys, before we move ahead quickly. Okay, cool. Just give me a minute. Let me open the virtual machine. Has the virtual machine started? Yes, it has started. Cool. 29 is the address. So I'm also going to access it using the virtual and I'll quickly explain once I have logged in. cool. All right, guys. Responding a little slowly. Just give me a minute. one later. Okay, I will go ahead and come Ad go. I know, it's Oh, Let me just share my screen, this time let me share my whole screen so that I can show you how exactly the virtual memory, just a minute, yeah. Let me share this whole screen, hope you're able to see my screen, I don't know if you confirm please, right now you should be seeing my console, let me increase the settings so that you'll

be able to find, so this is my system, whole system has 32 GB RAM and I'm using VMware, this is my VMware, one of the virtual machines is IIT Patna Atom 2026, all other virtual machines are either passed or stopped, only virtual machine that is running is IIT Patna Atom 2026. And this virtual machine, if I click here, and if I, cool, I'm not going to do that, let let me cut here, let me secant, view, okay, the console view, so this has two processors and 4 GB memory, so I can increase, decrease on the go, but it has 4 GB as of now, and it has two processors, where is this two processor for this virtual machine coming from, and where is this 4 GB RAM is coming from, it is coming from my Windows laptop, so my laptop has 32 GB, and it has physical memory is 32 GB, out of that 4 GB is being allocated to this virtual machine, so this virtual, this is virtual, it is not physical, but it is taking the actual resource from the physical memory, so how the

relationship is established, this will have a VA, that is virtual address, which will map it to the physical address, and who will manage this between the physical address and virtual address, that is the MMC, MMC is nothing but management console from the virtualization software, here in this case, mine is VMware, so this 4 GB is virtual virtual memory, and this 32 GB is my physical memory, so similarly, if in this virtual machine, if I am enabling paging, or swap memory, then out of this 60 GB, configure that it will use 6 GB as a swap memory, so this virtual machine, instead of 4 GB, instead of 4 GB, it will have 10 GB memory, of which 4 GB is virtual memory, and 6 GB is swap memory, but currently, I don't have swap, I have disabled the swap, if we want to run a cluster, for example, for example, if you look at here, controller, node, node, these 3 virtual machines, if I start, it will start a

Kubernetes cluster for me, in these 3 virtual machines, I have disabled the swap memory, because Kubernetes does not support back, so a quick explanation of virtual memory, how to address, virtual memory is addressed in both the contexts, one is memory to memory virtual memory, hard disk to memory, that is also a virtual memory, now let us come back here, so now, let me open this program, memory hierarchy, so it's a Python program, so, I will share this program, in the model, no worries, you can go through, how this program is written, but, this is a conceptual simulator, basically, it models cache behavior, and the operating system, type, virtual to physical translation, it does not inspect VMware's physical CPU, caches, the guest, guest kernel, which is my guest kernel, my Ubuntu operating system is the guest kernel, real page tables, are the hypervisor's methods, that is, so I am just, return this program, and this program, what it will do is, it is going to

give us, every, every information, cache line, let me go below, I have a function here, this function, is going to split byte address into block numbers, that index and tag, and then, this is something which is, this function, this is decode, and this is access, basically, it will perform one byte address, read or write, and return an explanation, that is, this function's job, and this is basically a summary, so we should put everything together, now, this function is basically to run a cache demo, and then, it will print the information, so, this is the first part, which is, cache model, suppose if you are having a VMM, VMM is nothing but a virtual memory model, in that case, how the paging table, works, so, we are just, trying to put some transaction, and that transaction, where exactly, is performing, and I have written the code in such a manner, that while it is performing, it will identify itself, and it is going to display on the screen, now, when you are doing, in the

virtual memory demo, it is also going to display all the information, right from the virtual memory, paging, and also translation, eviction, all the four, it will display, so now, let me close the program, let me try to run, I am using Python 3, let me run this, memory hierarchy.py, hopefully it runs, sometime that I have not run this program, oh, great, so now, part 8, so basically, it simulates, okay, concept, it does not expose the real CPU caches, just a simulation, one is cache hierarchy, second is VMM, virtual memory, or address translation, so, cache is 64 bytes, capacity, the cache capacity is 64 bytes, that's the data which I have put, 16 byte line, one cache line is 16 byte, two way set associative, so address cases are 0, R4, R0, R32, R0, W4, so what is this? This is the four reads, and the four writes, and that's the actual physical memory, which it has been provided to this particular virtual machine. Now, this is the write-through,

this is the write-through, and this is policy as write-track. So, when it is reading the address 0, first time, it's a cache miss. It means it is, the data is not available in L1. So, block 0, set 0, tag 0, it was not available. But when it was reading the address 4, it is a hit. The reason it is a hit is, the information was available in this block for this particular read. So, 0, 4, 32. And read address 0. So, 32 also, first time it is reading, so it is a miss. Because it is referring to block 2, set 0, and the tag 1. So, in this, there were no data available in that. It's a L1 cache. So, now, since no data was available, it is a miss. Miss does not mean that you will not get the data. You will get the data, but the lower level cache, like L2, L3, RAM, has to provide that. So, it will take some time. So, now it is reading the address 0 again. It's a hit. Here, it is a miss. But when you are doing 0 again, it is a hit. Because

this miss would have got the data into this. So, it is a hit. Hit means it found. So, it's write through update memory immediately. Okay. So, it is basically write address 4. The next is, it is something similar to our total variable, where we are updating the value to the variable. So, it is a write. So, write where? Write in this address. So, here we read, it's a hit. Nothing happened. But the same block, when we are trying to update, our program is trying to update the value. It is a hit. Because address has the value, the data. Now, it is a write. So, it is a write through update memory immediately. Write through means, not only in the cache, but it also needs to update the memory immediately. But from memory to disk, this will not, this operation will not do. Memory to disk will be done by our actual program. Means if I have written in my Python program, whatever value is written here for the variable total, write it to the database in the system. Then only from memory, it will go to

hard disk. But by default, if there is a change in the cache, automatically the memory also will be updated and that is write through. So, again, it is reading the address 64. Reading the address 32. 32, here also we read. Here it was a miss. 32, again it was a miss. It is also blocked to stat 0 and tag 1. Why it is a miss? Because evict tag 0. So, here. So, that is the reason it is a miss. But next time when you do the 32 again, it will have the hit. So, summary is we have for eight accesses, three hits and five misses. Hit rate is 37% and memory write is 1. Why memory write is 1? Because only this request it has written through. So, this is a return through policy. Now, in case if I have a write back policy. So, you can here write back mark cache line dirty. It will not write it back to the memory. It will just mark the cache line as dirty. That's all it will do. But here, if you look at it, it is a hit block 0, set 0, tag 0,

block 0, block 0, set 0, tag 0. So, here also it is a hit. So, again, rest dirty victim return to memory where read access 32. That's fine. But our focus is write back. It will mark cache line as dirty. Write through. It will update the same data in the memory immediately. Perfect. Now, virtual memory. Same addresses. Virtual address 20, virtual address 30. Now, virtual address 20, TLB miss. It is looking up the page table entry for VPN 0. Page fault because it's not there. Load virtual page 0 into frame 0. What is page 0? Page 0 is the virtual memory and frame 0 is the referring to the physical memory. So, the translation up. Because it's a page fault translation is happening. So, virtual address 20 refers to physical address 20. VPN is 0, offset is 20 and frame is also 0. So, this is the first time you are reading. But if you are reading this again, read virtual address. TLB is again missed. It will look for the page table entry for VPN 0. It will evict virtual page

1 from frame 1 because then 0. So, TLB replacement remove VPN 2. Where is VPN 2 coming from? VPN 2 will come from? VPN 2 will come from here. Right. So, here we have 3 read virtual addresses. 3 write virtual, sorry 2 write virtual addresses and 2 further read. So, whenever there is a TLB miss, you will see TLB miss the maximum because it will look up the page table entry for here. It's a page fault. Load virtual page 2 into frame 2. It means replacement remove VPN 0. Why it has to be replaced? Because it was earlier referring to VPN 0. Now, it has to refer to VPN 2, offset 80 and frame 2. Frame is referring to the physical. Page is referring. This virtual address is referring to the virtual memory. And it is connected through the VPN 2. Offset is 80. Now, if you are accessing the same 530 again, then you will not see the TLB miss as long as it is the same program which is running. If one program has used that particular virtual memory, that function is over, program is over,

a new transaction comes, same program comes up, then it has to evict the value and get a new for the new customer. New request means new customer for the application. And as far as resource also is concerned, it is a new. So, it has to evict, get the new and that's what exactly this particular process has done it. Now, page table. This is basically simplified for our understanding. So, this is only for part B. 0, 1, 2, 3, VPNs. Present. Was the data present? Information given? True. Frame 1. False. No frame. True. Frame number 2. True. Frame number 0. So, here 0 means its actual reference. If it is not present, it will say none. The read or write? Only one write. Sorry, three writes. Is it referenced? Yes. All the four are referenced. Out of which only one is marked as 30. This is the overall performance of this particular program using the resources from my virtual machine. So, I used a virtual machine. I could have displayed this in my Windows operating system itself.

But if I am running it in the Windows operating system, it will not be able to refer to the VPN and other things, because everything will be using the virtual memory. That's the reason I used this virtual memory. For to understand the concept. I just wanted to pass here and check any queries, any questions, please. Let me see the chat from here itself. Any queries, any questions? Any queries, any questions? Can I assume we are good? Is it clear? Can I assume we are good? The quiz 2, I have not understood. The quiz too, I have not prepared it. I'll be preparing the coming week. I think it will get opened after November 30th. So it will contain all the portions. We still have two sessions. One is on Saturday and next Sunday. We are good. We'll be covering. Whatever we are covering until next Sunday, it will be part of your quiz too. Yes, I will be uploading. I will just check and then if it is missing. See,

labs is something that only for reference of what activities we have done. I will upload it in the lab. I don't see, because I have not used much presentation after the fifth or sixth lab session. I have used the actual programs. So the recordings will have it. And I will also upload the programs as part of the labs. But definitely the theory part is updated. Up to risk. I'll be uploading this also. Next Saturday, Sunday also, I'll get it uploaded. So you should be able to wrap up that. end some exam. Okay, that's a great question. If I am right, that is to have some 25 questions. No, today's slide I will be uploading today itself. So your final exam is on 5th December. Okay. So the EAC would be of all the types, quiz, true or false, multiple right answers. And it will also have descriptive type questions, wherein you might have to type the answer on the screen itself. Definitely, there won't be any question where you are expected to write a program.

So that you can be doubly sure of. So this is what, but number of questions, once I set, I can confirm. I'm expecting it to be somewhere between 25 to 30 questions. It will be of all types together. Some 25 to 30 questions will be there. So just wanted to check. Until now, it was only in MCQs and 12 faults. All the topics that we have covered is, you have to mark as important because Patna themselves have restricted the topics and we have also gone through only that. Descriptive, definitely, there will be one or two questions. In all the sessions, whatever I have taken, there had been descriptive questions. One or two, for example, I can understand Paramveer. I'm going to check that. Descriptive type means, for example, today's one, if you're speaking about, I'll be just telling you, asking you to write about, you know, the sequence of the memory hierarchy and describe the role of each element in that.

Just one example from today's session. Maybe for four marks or something. So there are four elements. Sorry, five elements and five elements for description of its role. So that is the type of descriptive questions. Generally, I'll put it across, but since you're telling it's a proctored exam and something, so probably I will not add those one or two. Anything else from, how many words will be part of the question itself? It will say not exceeding 30 words, not exceeding 50 words. It will be part of the question. Now that Paramveer has said that this is what it is, because until today, IIT had not come back and said, well, let us not have descriptive. Because earlier, they had an option to write it on a paper and then upload also. So that option was there. Anyhow, let me check with the coordinator. I will confirm you next week whether it will be there or not. Anything else from anyone? Yeah, I understand.

It's easy for me also, no? Okay, cool. Thank you so much, guys. See you next Saturday. Take care. Bye-bye.

