[00:00:10] Hi, everyone. Just wanted to confirm, am I audible? Am I clear? Okay, great. Thank you so much, guys. Just give me a minute. I will turn my screen. Am I audible now, guys? Okay, great. Not sure what was the problem. I did nothing. But anyhow, it's time for us to start. So today, our session is going to be [00:03:34] little interesting. I do see Uday raising his hand. Yes, Uday, I have allowed your mic. [00:03:42] What is that? Uday, if you are there, you can unmute yourself and talk. Okay, great. That's [00:03:54] fine. Not a problem. So today we are going to see our focus is going to be on CPU. Earlier, [00:04:04] Here we have seen what is the system, how it gets forward on, what is the process. [00:04:12] I'm not sure, Salim, how to enable the transcript, if you can tell me then I can do that. [00:04:22] All I was told is how to enable the recording, pause the recording and other things. [00:04:29] Okay, recording is anyhow started. [00:04:33] I'm not sure how to enable the transcripts. [00:04:36] If any of you can tell me how to do that, [00:04:41] click on more as I have done that. [00:04:45] I do see timer, video effect, audio settings, language [00:04:50] and speech, and settings. [00:04:54] Chat bubbles, mute notifications, show live captions, [00:04:59] Audio settings, video, record and transcribe. [00:05:05] Okay, great. [00:05:06] I have only stopped recording and start recording. [00:05:11] That start transcription is something which is disabled for myself. [00:05:16] So I'm not sure if I can start the transcription. [00:05:21] It is disabled. [00:05:21] I will not be able to. [00:05:25] Only recording is enabled for me. [00:05:28] Okay, cool. [00:05:29] Coming back. [00:05:29] So, we are going to see the most important topic. [00:05:35] Until now, we have seen how a system is booting up when powered on, [00:05:41] what is the process of system boot up, [00:05:45] and then how it comes for the operation. [00:05:49] We have seen the components of the system. [00:05:52] We understood different components that is part of the system, [00:05:58] and CPU is one of them. [00:06:03] So registers, data path, and instruction execution. [00:06:07] That is what we are going to understand this session. [00:06:11] So the components of the CPU, [00:06:15] basically the session would progress [00:06:21] starting with components, registers, data path, [00:06:26] instruction format instructions structure and how are we going to trace the instruction [00:06:34] and what is the instruction cycle for a single processing that is what we are going to see [00:06:41] today so being said that this is the modern cpu so if you look at this modern cpu [00:06:53] you can understand [00:06:56] this is how the shape of the CPU would be [00:06:59] inside the computer [00:07:00] and it will be less than a palm size [00:07:03] overall [00:07:04] what you are seeing is less than a palm size [00:07:07] but it does have [00:07:09] so many things inside it [00:07:11] it is basically [00:07:13] a circuit and chips [00:07:14] and [00:07:16] we have components [00:07:18] all through [00:07:19] basically this is the bus [00:07:23] which is going to connect all the components together. [00:07:30] And to this bus is attached the cores, GPU cores. [00:07:37] When we say like 4 core, 12 core, [00:07:42] basically there would be 4 cores if it is 4 core. [00:07:48] There will be 12 cores if it is a 12 core. [00:07:51] If you say the server is 24 cores, then you will have 24 wires like this inside the CPU. [00:08:04] Now, we understood the process, how it gets executed within the CPU. [00:08:11] We know cache. [00:08:13] Cache is very small, but very fast to store data and pass on the instruction. [00:08:21] The cache is divided into three, L1 cache, L2 cache, and the L3 cache. [00:08:31] Now the L1 cache is further divided into two, L1 cache for instructions and L1 cache for data. [00:08:39] So this is instruction cache and this is data cache. [00:08:44] Now L2 cache is a little larger than the L1 cache. [00:08:53] So this is actually shared, but this is also slower than L1. [00:09:04] L1 is faster, but it is smaller. [00:09:07] L2 is comparatively bigger, but it is a little slower compared to L1. [00:09:14] And L3 is shared care. [00:09:18] So you will have L1 cache for every core you have in your CPU. [00:09:24] L2 also you will have, suppose if you have a four core, then there will be four pairs [00:09:31] of L1 cache, fabricated into instruction cache and data cache, and each cache is going to [00:09:38] be associated with a specific core. [00:09:42] Now the L3 cache is something different from L1 and L2. [00:09:49] It is going to be, L3 is something which is shared across all the cores. [00:09:55] Now, along with this cache, we might have a GPU. [00:09:58] It is optional. [00:10:01] If you don't want, it won't be there. [00:10:05] If that system doesn't require, if the system design does not [00:10:10] require a GPU, then the CPU will not have the GPU. [00:10:14] It's an integrated graphics. [00:10:17] It's optional. [00:10:18] It is on-chip, basically for graphics and multimedia [00:10:23] processing. [00:10:24] Nowadays, in many of the modern CPUs, GPU is integrated, but it is optional. [00:10:39] So suppose if you are going to buy a laptop, and if it is, the normal terminology that we hear is low-end, high-end. [00:10:50] So most of the low-end laptops, which would also cost you lesser, may not have a GPU, integrated GPU. [00:10:57] So if the CPU do not have an integrated GPU, but will it have an option to add a GPU if you want, yes, that option will be kept open. [00:11:09] But by default, GPU will not be integrated to the CPUs that is being used in the low-end system. [00:11:19] Now on the other side, we also have a lot of components. [00:11:26] Now the control unit. [00:11:29] this control unit [00:11:32] actually going to communicate [00:11:36] with the external [00:11:39] something like RAM, hard disk [00:11:41] so one thing we need to be very clear about is [00:11:48] the other resources such as RAM, hard disk [00:11:52] network interface, everything is outside of this CPU [00:11:55] so who's going to communicate [00:11:58] with all these external units [00:12:01] that is control unit [00:12:02] Now, this control unit will have another component called instruction decoder. [00:12:11] This control unit will fetch the instruction from the memory, [00:12:19] and then it is going to give it to the instruction decoder, [00:12:27] which will decode the instruction that is available in the RAM [00:12:31] and convert that into a machine language. [00:12:35] So this decoding basically means constructing the machine language [00:12:41] from the command that the memory has from an application program. [00:12:48] It also has some execution units. [00:12:53] These execution units is something like ALU, FPU, CIMED. [00:12:58] And so they would perform arithmetic, logical, floating point, vector operations, whatever we provide in our instruction. [00:13:11] So we have a decoder unit which will decode the instruction that is available in the English language to the machine language. [00:13:21] and once it is done that will be forwarded to the execution unit which is going to execute [00:13:27] because by that time it receives the instruction it will receive it in the machine language so now [00:13:35] this is not memory but it is a memory control basically the job of this memory controller [00:13:43] is to interface with the system memory you may have 32 gb ram you may have 16 gb ram you may [00:13:50] have 8 GB RAM, whatever it is. The job of the memory controller is to identify and connect [00:13:57] with the memory to get the data from the memory into the CPU. Then we also have an IO controller. [00:14:08] It basically handles the communication with other types of hardware, something like USB. [00:14:14] If you are plugging in a mouse to your USB, it will detect it, it will identify, and it will [00:14:21] function but in case if there is no mention about this then it is a normal provisioning [00:14:31] so this iowa controller is the one which is responsible for communicating with other [00:14:37] cci devices it could include even your mouse which is connected through a bluetooth connection [00:14:49] so the communication with the mouse will be handled by the input output controller [00:14:58] the memory controller is different which will interact with the memory to obtain the data to [00:15:03] get the data into the cpu on the same way input output controller will be able to [00:15:09] communicate with the input output devices such as keyboard mouse screen [00:15:15] anything it could be any resources that is part of the system can be part of this [00:15:21] now we know that when we are going to start our desktop or server [00:15:30] we are going to consume the power and bring up the components to the execution stage [00:15:44] including cpu so that means cpu needs to have a consistent power the most important thing is [00:15:52] consistent power then we can expect the maximum from the cpu so now we have understood that cpu [00:16:05] is a unit that has a lot of components inside it and each has its own role now let us look at the [00:16:17] cores, these are the cores that is going to process, and these cores, as I said, first [00:16:28] it will fetch the instruction, it is fetching unit, the instruction generally comes from [00:16:36] the memory, so we have the memory controller which will connect to the memory and this [00:16:41] component which is a fetch will fetch the code from the memory to the CPU now this [00:16:52] will be given to the instruction decoder if it is not already there in the [00:16:56] machine language it will be decoded then provided for further references so now [00:17:03] we have four cores and each core has its own capacity and the instructions would [00:17:14] differ from time to time so we really need to keep that also in mind so we [00:17:27] have seen the components what are they going to but the most important thing [00:17:32] is this is the CPU package the entire all the components are going to be inside [00:17:39] this package and that would be not even more than a palm size [00:17:47] So now you can understand how critical the CPU is for processing our application or data. [00:18:00] Okay, cool. [00:18:04] So now, if we have seen this, it would be good, no? [00:18:10] If we can see that what is happening if a program is passed on to the CPU execution, how it works. [00:18:21] So let us look at the flow of a program. [00:18:23] Now keep the previous slide in mind. [00:18:26] Do you want to just skip this slide for a minute? [00:18:28] Go through this slide and let this slide be in your mind. [00:18:32] And then we can definitely look at the flow and how it is going to happen. [00:18:39] We might have just enabled the support email ID and probably you can. [00:18:47] Okay, so now keep that in mind. [00:18:52] Now let us look at it. [00:18:55] So there is a program which is available in the secondary storage, [00:19:00] which has stored [00:19:01] not only this program, any program [00:19:04] that we have written will be stored in the hard disk [00:19:06] drive or [00:19:07] any alternate SSDs. [00:19:14] So in that case, [00:19:17] the program is going to get [00:19:19] loaded. How is it going to have access [00:19:21] to the CPU? [00:19:23] How is it going to access it? [00:19:25] It will have its own path from [00:19:27] wherever we are. [00:19:29] And the program [00:19:35] is going to display on the screen [00:19:37] and the user is going to enter two integers one is 10 and 50. [00:19:42] So basically it is an input user input and this input how it is taken it is [00:19:46] taken from the keyboard and where is this keyboard connected to [00:19:49] it is connected to one of the Ivo controller [00:19:54] so that we will get access to the key there are some settings at the [00:19:59] operating system level also but our focus is going to be here from the [00:20:04] hardware perspective [00:20:07] So now 10 and 25, that's what has been entered [00:20:11] in this example on the wall. [00:20:14] Now concern would be something like if we go there, [00:20:19] like how are we going to make it up? [00:20:21] I have no problem, it's your choice. [00:20:27] So now the user has given the input [00:20:29] and it has gone through the input device, [00:20:31] that is the keyboard and keyboard also [00:20:33] is connected to the IO controller. [00:20:35] So now who is identifying these properties? [00:20:38] is the controller who is identifying these properties and then forward it to the memory [00:20:48] so now the second step is whatever user has input into the terminal now it is going to [00:20:54] get transferred to the memory which is ram so ram will create instructions ram would create [00:21:05] instructions and there are types of instructions available we will see that in detail but at least [00:21:12] here it has been told that somebody was trying to abduct the theta again in ramayana something [00:21:25] like that so now it will create its own registers what is register register again is a small unit [00:21:35] of the storage it would be as small as possible because so that it can be as fast as possible as [00:21:42] well there is no point in having 20 million aircraft but we don't know we thought that we [00:21:49] will do it but we never got done can we say that from the memory memory has allocated the program [00:22:01] instructions the program instructions simply say that i have received an input 10 and 25 [00:22:09] and we want the result what is the result we want the addition of 10 and 25 so that's the [00:22:18] stuff which is there in memory at this point of time and now we have a memory controller so [00:22:24] which is always connected with the memory so now it is going to take the instruction [00:22:33] and then execute it in the platform so now we have cpu receipt [00:22:43] so without having a signature like it would be possible okay so now the registers is within the [00:23:04] cpu so as a third step now the memory data needs to go into the cpu so that the process of addition [00:23:13] can happen and once it is successfully computed it can send it to the ram back [00:23:19] so now cpu is temporary for transactions it's a permanent entity in the architecture but it is [00:23:28] sort of a temporary requirement that could be somebody who might have not paid the rental [00:23:35] charges so there are time if it is like something that we need to yes we can discuss and close it [00:23:41] so this is what is [00:23:43] exactly happening [00:23:45] so now we have registers [00:23:48] and the registers we know [00:23:50] that it is very small [00:23:51] and the data is [00:23:53] so now [00:23:56] the data has been moved from the [00:24:00] RAM [00:24:01] this input data [00:24:04] when it has been moved [00:24:06] to the RAM [00:24:07] the control unit is going to [00:24:10] control the flow, it is not going to [00:24:12] handle the data [00:24:13] We need to be very clear about this. [00:24:16] The control unit is only to control the flow of the incoming data, [00:24:20] and it is not going to handle the data itself. [00:24:26] So an instruction will be created, [00:24:28] and the instruction will be given to the CPU, [00:24:31] and the CPU will perform the instruction. [00:24:34] How instruction? [00:24:35] Because we do have the decoder. [00:24:36] Decoder is going to decode the app that we have asked [00:24:41] for better clarity and information. [00:24:45] so now we are looking oh we have so many programs see these microsoft services and it would have [00:24:50] been done point of testing so we're not going to really bother about whether all the 10 steps will [00:24:58] be covered in detail and hoping that yes so now this is the whole life cycle for 10 plus 25 that [00:25:11] is going to give back the answer and if you look at carefully the answer provided is from okay so [00:25:23] somebody has joined i believe okay so it actually disturbs the flow okay fine anyhow i'll manage it [00:25:31] so now the cpu core will receive will register and there are three things in this [00:25:39] execution one is integer one second is integer two and the third one is the property of addition [00:25:47] so the property of addition should reach 35. now we have three registers and all the three [00:25:58] registers are storing the data and now when the cpu is ready the cpu is going to hit 3 [00:26:05] and then see that if that works for us it should but let us wait so now do we still have participants [00:26:26] joining okay we waited for more than five minutes okay cool no issues and your recording is there [00:26:34] so guys who are joining a little late can access the okay so now this is the example we have seen [00:26:46] From the control unit, it has gone to decoder and decoder has decoded the program into a machine language. [00:26:55] And that machine language is going to travel from here on to add the integers and give the result as 7. [00:27:05] So what is the format of this? [00:27:10] Sorry. [00:27:24] Okay, cool. [00:27:24] so now we have understood from cpu it has gone to its own subcomponents such as [00:27:31] from the register's perspective we have r1 r2 r3 r1 is going to have one integer r2 will have [00:27:43] another integer the operand is and add that means addition so basically 3 plus 4 if it is then we [00:27:51] should get 7. So, once that [00:27:58] execute addition, basically [00:28:01] execute addition is happening, then it will happen [00:28:06] in the ALU unit. Because ALU is one of the unit [00:28:10] that is, sorry guys. [00:28:18] So, once that addition has been executed, now the [00:28:23] result will be stored in R3. So, [00:28:26] So what is R3? R3 is another register. [00:28:29] What is a register? [00:28:30] Register is a small storage with a limited capacity. [00:28:37] So now we have seen how the addition happens. [00:28:42] The addition will become part of the instruction in the machine language [00:28:45] to be provided to the CPU so that it will process and it will close. [00:28:50] While closing, you want a couple of emails to be notified [00:28:54] that it has been successfully completed. [00:28:56] so you can definitely inform whenever you see that happening so now this is the view of the cpu [00:29:07] based on the target audience and based on the 1980 so this is not [00:29:15] essentially what my they might be looking for okay cool so in the meantime you can go you can [00:29:23] session up here come and then we will continue with this so it's going to be a little dry but [00:29:33] i'm trying to put as much as much masala as possible and i will be connecting back to [00:29:38] the environment that we were trying to create yesterday so all those things will happen but [00:29:42] still you need to provide your commitment for this session that is my only expert [00:29:48] okay cool so we have a program that adds to integer it goes through the keyboard it went [00:29:56] to the ram from ram it has gone to the cpu cpu received it using the io controller given it back [00:30:04] to that owner of their table and they can perform they want to fix it permanently as you can do that [00:30:16] okay cool so now what we have seen is we have seen a flow [00:30:24] that is flowing from a source code that's what coming from the hdd getting loaded in through [00:30:30] the iowa controller but before that if you look at it there is called something system bus as part [00:30:36] of this architecture what is the system bus so basically it is the bus that we have seen in the [00:30:40] last slide this is the one so it can be of any network you need not have the mother but [00:30:50] the responsibility lies with the team that is managing this application okay [00:30:58] so now we understand the flow we understand the components the role that each component is playing [00:31:05] very very 15 beats or other other than that anything else from anyone if you are not able [00:31:20] to understand please let me know i can just repeat with another analogy that you are able to [00:31:25] understand in case if you are not understanding please give a thumbs down okay so is there any [00:31:36] thumbs down just give a minute for you guys to okay can you explain the cache okay [00:31:47] now let me go back to the presentation let me be in this example only so there are [00:31:54] two questions i see in the chat one is about control unit and another one is about the cache [00:32:03] so now we know up to memory where the data comes in now memory will have only diverted [00:32:11] sorry classified as per the program so in the program we would have defined the variables [00:32:17] we will say that these variables are integers and whatever user input is going to be there [00:32:24] these variables are going to store the data in the memory now when it is storing here in the [00:32:33] program we would have defined an another variable called r3 where we are going to store the result [00:32:39] from the operation that addition is happening so we would have defined the three variables so for [00:32:44] each variable the memory is going to define that in the memory now another line in the program [00:32:53] would have been written saying that i'm not going to assume what is the value of the variable but [00:33:00] i'm going to ask the user to input a line would be asking the user to input the data and the first [00:33:06] integer second integer at 10 and 25 and these values are getting assigned to these variables [00:33:12] now the third variable result at this point of time is going to be having the initialized value [00:33:18] maybe zero now where am I going to process this 10 plus 25 and that operation is going to happen [00:33:26] into the CPU and control unit so the control unit is job is basically to fetch decode execute [00:33:36] and control signals it is not going to carry the data let me make it very clear control unit has [00:33:43] no relationship to the data that is getting processed control unit is just going to control [00:33:48] the cpu and which component is going to do what and upon its signal only the individual components [00:33:55] of the cpu is going to perform for example it has fetched the data now it will ask register [00:34:02] to store probably the variable x is equal to 10 variable y is equal to 25 so the x would be in r1 [00:34:11] what is this r1 r1 is a storage within the register a small storage that is the reason the [00:34:17] storage inside the tpu are very small now these registers are going to post it variable now this [00:34:28] has to be processed for the addition which is going to process for the addition the alu all [00:34:36] these are executional units alu will process it because this instruction is all about addition [00:34:46] So it will go to the ALU, and the ALU will process the data, 10 plus 25. [00:34:51] And it knows that the value is 35. [00:34:53] So now it is supposed to go to the registrar. [00:34:59] The registrar has the third variable, wherein R3 will have the result that is 35. [00:35:06] Now it is available in the registry. [00:35:08] It is available in the register. [00:35:10] It is available in the CPU. [00:35:11] It is supposed to go back to the RAM or go back to the hard disk. [00:35:15] that the result is either stored in the memory or in the hard disk. [00:35:19] Otherwise, if you are reinitializing the CPU for another circle, [00:35:23] and if CPU is not providing this result to the memory, [00:35:28] then the memory will not have the value, but it will not miss. [00:35:33] So now the variable processing is done. [00:35:37] Value is noted. [00:35:39] Now this value for R3 needs to be given back to the end user. [00:35:43] How it will go? [00:35:43] It will go via the IO. [00:35:45] it will go to [00:35:47] the screen [00:35:49] and it will display the addition is 35 [00:35:51] what are message you would like to hear [00:35:54] you can also write [00:35:56] the last statements according to [00:35:58] your wish because it may be [00:36:02] required here on please do not [00:36:04] mind doing that [00:36:05] so coming back to our thing so now [00:36:08] here we [00:36:10] also have cache [00:36:11] which is not shown here [00:36:14] within the CPU but if I [00:36:16] go back here it is you do have l1 cache l2 cache and l3 cache three types of cache cache is a [00:36:24] temporary storage suppose if it is available in the cache and your program is running again for [00:36:32] the value of 10 plus 25 it knows that this is already processed so it will not process it will [00:36:38] take the value from the cache and give it back to the user how is it going to give it back to the [00:36:47] user using the iowa controller wherein it will give it back to the screen where is screen attached [00:36:55] to the screen is attached to the motherboard using one of the ports we have seen here now [00:37:02] this is iowa controller which controls the keyboard and the mouse and it also controls the [00:37:09] monitor monitor keyboard mouse and all will get connected you might have seen the usb 5 port or [00:37:15] USB 2.0 port or some hard ports or something like PS2 to connect the [00:37:20] keyboards and mouse, wired keyboards and wired mouse. So whichever is appropriate we [00:37:27] should get it done. So now that is the role of this cache role is basically to [00:37:36] keep it with itself unless this entire program is completed it will be [00:37:42] available in the cache what will be available in the cache the result 35 the values of 15 sorry 10 [00:37:51] and 25 that's not going to be available in the cache it will be available in the ram only [00:37:57] taken directly from the so now in this scenario we have seen both where is it processing where [00:38:08] it is getting stored okay cool any other queries questions before we move ahead let me just check [00:38:21] the chat i do see a couple of questions and there are a couple of hands up also so what is the role [00:38:28] of l1 and l2 cache between ram and cpu registers okay before that let me see what is the role of [00:38:36] flag okay where are you seeing the flag flags are updated here so now once the computation is [00:38:42] completed result is available 35 and this result is going to this then this process has to be [00:38:50] flagged with the status whether it has been completed or whether it got stuck whether it [00:38:56] was not able to process or whether this needs to be carried on that status will be updated to the [00:39:04] flag so this is basically for the operation that the cpu has completed there will be a flag because [00:39:11] it has to communicate to the other devices that yes i have completed i'm going to post it again [00:39:16] but if you're coming back i will not have it the result will be available in the cache [00:39:20] but the entire thing other things will be removed like r1 r2 r3 r3 will be in the cache [00:39:28] other things will be removed from the memory once this particular instruction is completed like this [00:39:34] In our program, you can have add, subtract, multiply, divide, mean, median, mode, whatever. [00:39:42] Any processing. [00:39:44] So this is how it works. [00:39:45] So suppose if you have, there are three add, subtraction, and division you have added. [00:39:51] There are three. [00:39:52] So that means this will go through, each one will go through one cycle. [00:39:57] What is that one cycle? [00:39:58] One cycle is nothing but starting from the morning [00:40:01] until the evening from our life perspective. [00:40:05] It's the same thing for office also. [00:40:09] Okay, cool. [00:40:10] That's the role of the cache. [00:40:12] What is the difference between cache and registers? [00:40:15] Cache will hold only the results. [00:40:17] The register is a temporary [00:40:19] where it will hold the input given by the RAM [00:40:22] through the control unit. [00:40:26] and it will hold it until the operation is [00:40:29] completed. So once [00:40:31] the operation is completed, R1 and R2 [00:40:33] will be reinitialized and released [00:40:35] for another process, but [00:40:37] R3 will be cached [00:40:38] to the cache. [00:40:41] So that if somebody is going to ask [00:40:43] about 20 plus 35, [00:40:45] you can answer the 55. [00:40:48] So that's pretty much [00:40:49] what you can do. So whether [00:40:50] you are getting hit or whether [00:40:52] you are hitting, it's all [00:40:55] because of so that's we know the flag okay role of l1 and l2 cache between ram and cpu [00:41:07] okay i'm not sure where you are saying l1 l2 cache between ram and cpu let me go back here [00:41:14] so here the l1 cache is going to carry the instruction that is the addition add 25 plus 10 [00:41:23] and L1 cache is going to carry the data. [00:41:28] R1 is equal to 25 and R2 is equal to 10. [00:41:31] R3 is equal to question mark. [00:41:34] This cache will carry. [00:41:36] Where it will carry, it will carry and give it to the core. [00:41:39] So the core is exactly the point where all these are getting performed. [00:41:44] The core will give it back to L1 cache. [00:41:47] Now the L2 cache is in the queue. [00:41:53] Why this design? [00:41:55] because suppose while processing is happening if it is a multi-processing multi-cache then the way [00:42:03] it works is a little different so that's the reason that compartmentalization has been done so that [00:42:10] this is going to be the standard in architecture but it can also demand so now that is the role [00:42:18] of cache between ram and cpu so now we mainly use intel processor to understanding the core [00:42:27] architecture okay modem cpu architecture is looking like a microprocessor even system cpu [00:42:36] is a microprocessor only thing is the size of that microprocessor may be smaller in a modem [00:42:45] and the layout of the modem [00:42:47] processor also will be very similar [00:42:49] but what is getting processed [00:42:51] by the modem [00:42:53] processor is totally [00:42:55] different. There [00:42:57] it is data heavy [00:42:59] and connection monitoring. [00:43:03] So [00:43:03] components are same, layout will be the [00:43:06] same but the way it works will be a little different. [00:43:10] Whether [00:43:10] R1 and R2 and R3 are [00:43:12] fixed, no, no, no, we will see that. [00:43:15] Hold on. [00:43:15] It is only an example what I have shown. [00:43:18] It's not like, okay, this is how it is getting fixed. [00:43:21] No. [00:43:22] Every memory have it, every CPU inside the registry [00:43:26] will have its own address. [00:43:28] And those addresses, we will see that soon. [00:43:31] But R1 is a reference point. [00:43:33] R2 is a reference point. [00:43:35] Okay, cool. [00:43:37] So now this result has come. [00:43:45] The result is going to the R3. [00:43:47] and the memory controller is going to give back the result to the memory [00:43:56] and the result as of now is 0. [00:43:59] It will get updated to 35. [00:44:01] Once this is done, R1 will be released, R2 will be released, R3 will get cached. [00:44:07] It will go into the L3 cache. [00:44:10] Because L3 is, see, L1, L2, L3 also indicates the priority. [00:44:14] so since it is going to cache it but it's not going to use it frequently until [00:44:19] the system is going to ask again so that's going to the l3 cache the current processing will be in [00:44:27] l1 and what is there in the queue will be in the l2 processed will go to the l3 [00:44:32] so this is how it works so basically registers enable fast data access and are used to hold [00:44:42] input values and immediate results not stored results so what will be storing into the secondary [00:44:52] storage and why are we storing in it secondary storage is nothing but our hard disk suppose in [00:44:58] your program if you have written the instruction to calculate 10 plus 25 and then you are going to [00:45:04] store it in your hard disk that time the result will be stored in the hard disk [00:45:10] So let me give you an example where it is pretty much relevant. [00:45:19] Now your application is running. [00:45:21] Definitely there is something called an application log. [00:45:25] Even the application log processing is also done with the CPU in the same manner. [00:45:31] Now that is also an application which is storing the log. [00:45:37] It could be a one line, one-and-a-half line, and it will store it. [00:45:45] If you are not going to store the log in a device, then you will not be able to access [00:45:51] it later, because memory is a temporary, and hard disk is a thing. [00:45:58] So now if you are going to, if I'm going to restart my laptop, laptop also has the same [00:46:04] architecture. [00:46:05] It is x86. [00:46:07] So now, if I reboot, whatever is currently there in the memory will get vanished, but [00:46:13] whatever is there in the hard disk will never get vanished until we say, please get lost [00:46:21] by using the delete command. [00:46:24] And secondary storage is basically for permanent storage. [00:46:30] So is this program addition of two numbers? [00:46:35] What is the role of the program counter? [00:46:37] LL will come to that, we are going to see that in detail. [00:46:42] So now this is the flow of a program. [00:46:47] When it reaches the memory, it goes back to the CPU and comes back to the memory. [00:46:53] Once it comes back to the memory, memory also will clear its data. [00:47:00] The moment Krishna has suggested in the first session itself, [00:47:10] It is available in the first day presentation. [00:47:14] You can please refer Krishna. [00:47:16] It is shared in the Moodle. [00:47:19] And even the same books are referred in the syllabus. [00:47:30] Okay. [00:47:31] So now, this is the instruction. [00:47:36] Add R1 and R2 and store in R3. [00:47:39] Now, this is, while this is processing, there is another program which says that open the word file. [00:47:49] That is in the queue. [00:47:52] So, in case if I am having four cores, then four instructions will run in parallel. [00:47:59] And if the program is big, then the program might be using two cores. [00:48:04] It may use four cores. [00:48:05] If you are having 12 cores, a program can use 3 cores, 4 cores, whichever is available for the speed. [00:48:13] But if I am having only one core CPU, then currently this adding of two integers is going on now. [00:48:22] Only one CPU, so no parallel processing. [00:48:27] So now open the word file is the next instruction. [00:48:30] so the next instruction which is going to wait for execution will be in the program counter [00:48:37] so now once this process is completed once all these registers cache everything is cleared the [00:48:47] cpu is going to pick up the next instruction from the pc program counter so that program [00:48:54] counter will have the next instruction which will get loaded in and then getting processed [00:48:59] That's the role of program counter. [00:49:03] Okay, cool. [00:49:05] Now, if you look at from the overall understanding, [00:49:14] we have program in the CPU core from the register's perspective, [00:49:22] not considering the other thing. [00:49:27] From the register's perspective, we are going to have a program counter [00:49:31] and we have an instruction register. [00:49:34] These are all different types of registers that are available within the core. [00:49:41] And you have general purpose registers. [00:49:45] This IR is the current instruction that is being instigated and general purpose registers [00:49:54] is basically to store currently you say add R1 and R2 and suppose you have R3, R3 will [00:50:02] get into the general purpose register, and it will be there. [00:50:05] Once the processing is done, it will go to the R3, [00:50:09] and this instruction will come out of the IR. [00:50:13] And then IR will pick up and say, open the world file. [00:50:17] It's all going to happen in split of a microsecond. [00:50:21] So that's the reason you are not seeing a delay [00:50:24] whenever the processing is getting up. [00:50:28] So how to decide which core of CPU [00:50:30] execute the instruction and arithmetic [00:50:32] operations. I'm not going to [00:50:34] go in depth [00:50:35] because our objective is not [00:50:38] to understand [00:50:39] CPU in and out. [00:50:42] But we need to understand how our [00:50:44] requests are getting processed [00:50:46] with the components that [00:50:48] is available. [00:50:50] So there is a methodology which is being [00:50:52] used within the CPU that will decide [00:50:54] which core is going to be occupied [00:50:58] by what type of applications [00:51:00] and how many cores are going to be allocated [00:51:03] based on the availability of the course to the program. [00:51:08] And from there, IR, how is it going to go to ALU? [00:51:13] How it is? [00:51:15] Everything will have its own way. [00:51:20] So I'm not going to go in depth. [00:51:23] I do see responses in the chat. [00:51:26] Hope that helps. [00:51:32] So we do have general purpose registers. [00:51:33] we have instruction register which is current program counter is having the next [00:51:40] instruction code in it and we also have memory address registers [00:51:47] this holds the address in memory to be read from or written to for that particular execution [00:51:56] so the location of the input data in memory and what is mdr or mbr it's basically the memory data [00:52:03] register it holds the data being transferred to or from the memory so these two are part of the [00:52:09] memory controller and finally you have the flag status so it will have the status zero carry zero [00:52:20] sign zero overflow zero if if it is overflowing not able to execute again the status will become [00:52:27] overflow colon one it's basically zero and one that's it [00:52:30] So based on this flag, the memory controller will decide whether to give back the result [00:52:40] to the memory or not. [00:52:43] The memory controller is within this CPU itself. [00:52:50] Now this is from the CPU registers for adding process. [00:52:56] This is the same thing it works for any other operations, but adding is something that I've [00:53:00] taken an example. [00:53:03] to show you this. [00:53:04] Now, we have registers. [00:53:07] Registers, we know it is a small storage available to the CPU [00:53:13] for temporarily storing the values of variables [00:53:16] that needs to be used for the processing. [00:53:21] It's pretty quick. [00:53:24] Pretty quick. [00:53:27] So the swapping that is happening [00:53:29] or the data that is getting replaced [00:53:32] is like in minutes. [00:53:34] moment you know it gets done so now how does it look like in a storage perspective because [00:53:45] registers are basically storages so now how does it compare to other storage [00:53:52] the storage hierarchy the fastest is the register but it has the smallest capacity [00:54:01] Of all the capacity, it would be only few bytes or few kilobytes, depending upon the core that you have. [00:54:11] So each registry would be normally in bytes to kilobytes. [00:54:18] And it holds operands, addresses, data, everything. [00:54:25] Now the next level of registers is basically the cache that is still available within the CPU. [00:54:31] cache will have more capacity compared to registers because cache is also going to [00:54:41] store the information that is going to be so now next is cache cache is bigger [00:54:52] but it is little slower compared to the registers now next level of the cache [00:55:00] is basically the memory with this RAM random access memory so if you are [00:55:06] speaking about few kbs for registry and probably few mbs maximum for the cache then you will have [00:55:17] ram in gbs that is how it is related and structured now if you have 32 gb ram then you have a storage [00:55:27] which is probably a petabyte or a terabyte whatever is applicable so with these components understanding [00:55:38] We'll be able to understand the real case scenario before getting there. [00:55:44] Let us look at something else also. [00:55:50] Storage hierarchy, we see registers, it is available in the CPU, [00:55:55] the smallest but the fastest, among others. [00:55:59] The reason that it is fastest, because that is what is the requirement by the CPU. [00:56:04] It has to be the fastest possible. [00:56:06] there are no two parameters that is going to define the fast access and slower access [00:56:17] so suppose if your program is going to occupy more memory memory oriented program [00:56:23] and if you have just left for the user to disconnect from the session then [00:56:28] even after everything you might have to this is what is about the storage hierarchy but [00:56:40] i'm not going to pause i'm not going to stop sharing but what am i going to do is basically [00:56:48] both alu and control unit work simultaneously why okay control unit are two and alu's are [00:56:57] two different components within the cpu uh can it functions parallely yes simultaneously yes [00:57:05] but it it is two different units what alu using it will just depend on the control unit for the [00:57:13] input but it has nothing to do with a control unit beyond that so arithmetic operations are [00:57:21] done in alu how of how other operations like running what do you mean by running [00:57:27] any operation will be like even if you take the example of the file file can be opened [00:57:34] it can be closed [00:57:36] it can be deleted [00:57:37] it can be modified [00:57:39] all those are instructions [00:57:42] that would [00:57:43] change your [00:57:45] that is how it works [00:57:48] any queries, any questions [00:57:53] until now [00:57:54] neither thing, okay I do see a couple of [00:57:58] concepts [00:57:59] Priyanka I am opening your [00:58:04] I am allowing your mic [00:58:06] if there is anything please [00:58:07] you can unmute and ask [00:58:09] okay good [00:58:11] afternoon sir [00:58:12] sir actually I have [00:58:15] a doubt where is the syllabus [00:58:17] for assignment [00:58:18] whatever we cover [00:58:21] that is for the assignment [00:58:23] until today [00:58:24] whatever we cover that will be for the assignment [00:58:27] but I have not [00:58:27] uploaded the assignment yet [00:58:30] probably doing by Tuesday [00:58:32] okay [00:58:35] okay cool thank you [00:58:40] So, now Uday, anything I am allowing your mic. [00:58:51] Sir, hello, good afternoon, sir. [00:58:53] Yeah, Uday. [00:58:55] Sir, am I audible, sir? [00:58:58] Yeah, you are pretty much. [00:59:00] Go ahead. [00:59:00] Sir, I understand the CPU process, how the executions will work. [00:59:06] But it is similar for the GPU process also. [00:59:09] does the same [00:59:10] fashion [00:59:10] GPU will [00:59:12] execute the [00:59:12] instruction [00:59:13] okay [00:59:15] there is [00:59:18] the logic [00:59:19] is little [00:59:19] different [00:59:20] but [00:59:24] overall [00:59:25] functioning [00:59:25] is very [00:59:26] similar [00:59:26] the units [00:59:28] are going [00:59:28] to be little [00:59:29] different [00:59:30] because [00:59:30] graphical [00:59:32] processing [00:59:32] it is all [00:59:33] heavy [00:59:34] it's not as [00:59:35] simple as [00:59:36] program [00:59:37] instructions [00:59:37] because most [00:59:38] of the [00:59:38] program [00:59:39] instructions are going to be textual we might submit an object as a image or a video [00:59:49] but those are all values for the variable to be stored in the register [00:59:55] but if you are going to handle image video for example if you're going to play a game [01:00:04] then the communication needs to be faster both from the system and from the user [01:00:09] and there might be a lag from the user but it has to balance it so all these things gpus are [01:00:15] good at handling it so yeah at a very high level 30 000 feet the logic is same but in terms of [01:00:23] components it is like that's like very very high end and the way it gives instruction and receives [01:00:33] output also is little different so that it can balance what all we think is gpu is for [01:00:41] high speed faster processing that is correct but it also has the ability to match with the speed [01:00:47] of the end user and if there is no dependency with the end user for the processing then gpu will [01:00:53] process immediately to its strength that's the difference between any other processor makes sense [01:01:01] yeah yeah yeah yeah thanks so sir in others what's can can we say that a key uh gpu have a multiple [01:01:10] c kind of cpu to process the education fast and fast uh no no no you're confusing two different [01:01:20] things uh all this course whatever it is we are is with the cpu not with the gpu so the cpu will [01:01:31] not be used in the gpu processing it will be processed by the gpu and cpu will be ideal and [01:01:37] it will be available for other processor that is coming for cpu non-gpu processes make sense [01:01:49] are we good okay cool thanks thanks okay cool so now uh vikesh kumar i'm allowing your mic [01:02:03] Hello sir. Good evening. Sir, yeah, so I had a question I think somebody has replied in the chat. I had a question around ALU unit. So when we do the arithmetic operation, that arithmetic operation gets executed in the ALU. But what about let's say I have some other instruction set apart from arithmetic operation, let's say there is some [01:02:36] for loop or while loop so where exactly those instruction sets get executed [01:02:44] okay all the instruction set is going to get executed with the core and core is going to take [01:02:51] the help of independent units which is going to process so your for loop okay you are looking from [01:03:01] the programmer perspective okay but as as far as as far as system is concerned [01:03:11] it for it every every iteration within the loop is a process so your addition [01:03:21] so you are starting with zero for i is equal to zero between zero and 25 until it is not more than [01:03:31] 25 which unit is going to process this it is alu you are increasing your loop value at the end of [01:03:40] the loop that will go to the alu but within the program instruction also if you have values [01:03:47] assigned and processing is done perfect so you you need to look that loop as if you are a system [01:03:55] not as a programmer so within the loop if there are arithmetic it will go to arithmetic if there [01:04:02] are other processes there are so many like arithmetic is very popular everyone tells that [01:04:10] but there are so many deciding units that we will see that one by one later it will go to the [01:04:17] respective okay so even the far loop if there is an arithmetic calculation it goes to alu only [01:04:23] Okay. [01:04:25] Yes, please. [01:04:26] Makes sense. [01:04:27] Yeah. [01:04:28] So I have a follow-up question. [01:04:30] So there is something called assembly language. [01:04:32] I think somebody has replied on my question. [01:04:35] So where exactly this assembly language comes into picture? [01:04:40] Is it a part of CPU or it's altogether a different component in the system or the machine? [01:04:47] Hold on. [01:04:49] I'll answer you, but we are going to see that. [01:04:52] So there is a stage called fetch, the control unit. [01:04:58] When it is fetching, it is going to fetch as an assembly language only. [01:05:04] Sorry, it will fetch as a normal language, [01:05:06] and the decode will change it to the assembly language. [01:05:11] And that will be passed on to the unit. [01:05:14] So control unit has four phases. [01:05:21] which is basically which will fetch from the RAM decode is going to decode from our language [01:05:27] to the machine language and then it will go further that will be fed into the ALU not your [01:05:34] line right yeah okay yeah I'll take two more questions uh yes Priyanka I think yeah I'm [01:05:48] allowing your mic again yes actually i didn't i forgot to click on the raise again so i had [01:06:03] one question sir for example we will have for assignment we'll have mcq objective types only [01:06:09] right i think so that's a clarification i requested once i have it then only i'm going [01:06:16] to prepare the assignment i would request you to confirm with your coordinator also [01:06:21] I'm also waiting for that [01:06:23] clarification [01:06:24] okay [01:06:25] Sunil [01:06:31] I'm allowing you [01:06:32] yes hello sir [01:06:34] hello sir my question is [01:06:37] with respect to I've also posted [01:06:39] in the chat like with respect to [01:06:41] the cloud or in the VPN [01:06:43] when we are having everything is [01:06:45] in the cloud there is no hardware [01:06:47] physical hardware [01:06:48] so how can there can be [01:06:51] a difference between a RAM and a hard disk [01:06:53] and how at all [01:06:55] will it make a difference if we [01:06:57] make a table buffered or not buffered [01:06:59] because [01:07:01] everything is in the cloud and processing [01:07:03] is also happening in the cloud so [01:07:05] this physical [01:07:06] I would say limitations that [01:07:09] we had is it not [01:07:12] kind of [01:07:13] you know taken care [01:07:15] in the cloud [01:07:16] first and foremost thing [01:07:19] even in the cloud [01:07:21] only these type of servers are given to you okay the only only thing is they are using a [01:07:28] virtualization software they are virtualizing the physical hardware into a virtual hardware [01:07:34] and then they are giving it to you so when you are asking for ec2 instance with aws [01:07:40] actually you are getting piece of hardware from a permital only so it will have all these properties [01:07:49] it will have control unit it will have registers you will get the alu part of not the whole alu [01:07:57] of the system if it is your own laptop then the entire alu is at your disposition but in case of [01:08:04] vmware whatever you ask for you will get it if you say 8gb ram only 8gb ram you'll get it [01:08:11] and along with that i need two cores you'll get two cores i understood that that part is fine i [01:08:18] I mean, I'll have a virtual machine with all everything, same to same, but then will our parameters still hold when we deal with performances and speed in terms of visibility? [01:08:30] It is the same. [01:08:33] See, the only thing is you are using, you are, it is something like you build a flat in a site and you got a flat, only that area you will be able to use for your residential purpose. [01:08:47] you cannot enter into another flat [01:08:50] but your overall site has a higher dimension [01:08:54] probably it is like 2,400 square feet [01:08:58] and your flat is only 460 square feet [01:09:00] so the rest of 2,000 square feet [01:09:03] is given to someone else [01:09:05] they will use it [01:09:07] but still all rules and everything is applicable [01:09:13] the functionality is the same [01:09:15] even your door also is going to open [01:09:17] it also will have the lock [01:09:19] only thing is [01:09:21] it is just virtual [01:09:23] it's not [01:09:24] everything is not yours [01:09:26] that's all [01:09:27] everything else is same [01:09:29] except for that aspect [01:09:30] but like the turnaround time [01:09:32] which is like physical movement of [01:09:35] you know [01:09:37] instructions [01:09:38] it's all going to be the same [01:09:40] it is all going to be the same [01:09:42] see [01:09:44] if you see i'm just looking at only one instruction at this point of time [01:09:49] but in the realistic world there will be millions of instructions that will get processed by the cpu [01:09:56] so if you are going to have only two cores then the processor is going to take two minutes to [01:10:06] process that million [01:10:07] processes. If you are going [01:10:12] to have four cores, [01:10:13] then the million request will get [01:10:16] processed probably in half a second. [01:10:20] That's all is the difference. The time [01:10:22] taken to process, but ability, [01:10:24] capacity, capability, [01:10:26] everything is same. [01:10:29] Okay. [01:10:30] Yeah, that's [01:10:33] fine. Okay. Thank you. [01:10:35] Okay. [01:10:37] Somewhere I saw like [01:10:39] okay someone asked is i3 and okay i think that has been answered by someone okay thank you very [01:10:49] much for answering guys that's where we need to share the knowledge nobody can have everything [01:10:55] and we don't have time for everything also thank you so much um let me take the question from sunil [01:11:04] yes sonal i think i i think i already i already asked then then you please lower your hands [01:11:22] okay harshit i'll take this last okay we have only two that's fine i'll take both the questions [01:11:30] so my question is i have a two question one is the how sdd work more faster than sdd [01:11:40] and second like we are storing the data into the temporary cache memory is there a chance if we [01:11:49] lost the temporary memory before giving the output to the cpu so it is creating uh its own backup or [01:11:59] not no no no there are no backups okay the the uh what we have is very limited [01:12:11] okay so memory itself if you take it how much memory do you have in your laptop [01:12:17] 8 gb 16 gb 32 gb no so is it a possibility a casey lost uh it's on memory before uh [01:12:27] display the output no that will not happen suppose your cash can become bad physically [01:12:37] but it will not miss the process if you are like how your memory can go bad your [01:12:46] cache also can go bad cpu also can go back the probability is one in probably one billion that's [01:12:54] all and how HDD work more faster than HDD okay that's that's too much of a depth [01:13:04] to get in you need to understand the physical architecture of both types of [01:13:10] hard disk at a very high level HDD is pretty old architecture and SSD is a new [01:13:23] architecture and hdd depends upon the spin role and other things it will have a needle to access [01:13:30] the part of the metal to retrieve the data so that that time is actually more compared to the ssd [01:13:41] so at this i'm definitely going to be stopping there uh so rest i've given you how to find it [01:13:49] out so can i ask the one question related to azure because uh topic is too much old [01:13:58] uh but i have tried to ask uh but i did not get a chance so can i ask yeah yeah please go ahead [01:14:06] uh so sir uh actually i'm working on the bm so i have seen uh we can create a multiple user for [01:14:12] one big single vm so uh at a time uh both can both are accessing uh the bm at the same time so [01:14:20] uh is there a chance like uh uh uh my question is like uh is there a chance uh the memo we are [01:14:28] sharing the same memory with uh two different users so uh what is the process here uh we are [01:14:35] following like cpu we are we have a limited cpus and uh both one is using the parallely [01:14:42] so what is the concept behind of uh this uh can i create a same uh same user session in our [01:14:51] local desktop as well okay i think you have mixed two different concepts into one [01:14:58] okay so here this is hardware and now user is a physical user so [01:15:07] To identification, you are creating a user. [01:15:10] Now, user is part of the operating system. [01:15:14] And users can give instruction. [01:15:18] I can run Microsoft Word. [01:15:20] You can run Microsoft Excel. [01:15:22] Now, both of us are giving request. [01:15:25] The request is a little different. [01:15:27] You are asking to open the Microsoft Word. [01:15:30] You are typing and you are saving. [01:15:33] I'm also opening the Excel sheet. [01:15:35] I'm viewing it. [01:15:37] closing it all these creates instruction to the cpu and yeah definitely in a laptop [01:15:47] even though you have multiple users you can log in only as one user at a given point of time [01:15:55] so the resource is available for that particular user but if you are thinking from a server [01:16:02] operating system perspective there the concept changes to multi-user multi-threading multi-processing [01:16:13] so that capability is built in the operating system and not in the cpu so the operating system [01:16:20] is going to drive how many processes will be processed by the cpu in parallel how it is going [01:16:30] to be submitted so definitely if it is a server you will provide more resources not for course [01:16:36] you might probably have 32 cores and that too you might have i7 generation so generation [01:16:44] basically gives you an idea about how many instructions can be processed within a minute [01:16:53] So, if I say i7, and if I can have seven i3 processors, is that the same? [01:17:01] No. [01:17:04] So, yeah, core is master chef and thread is assistant chefs, but this core and the thread [01:17:12] is managed by the operating system and not by the control unit. [01:17:17] The control unit will get that information from the operating system, and then it only [01:17:22] processes. [01:17:23] Okay. [01:17:24] It doesn't have any intelligence of, shall I take Sunil's request, shall I take G1's request. [01:17:31] No, everything is in the queue. [01:17:34] If it is a single user system, then everything is in the queue, one by one. [01:17:38] Availability on the core, your request will be processed and you will get a response. [01:17:45] And that is the reason sometimes you see that systems are a little slower because processor is busy. [01:17:51] or hard disk [01:17:53] may be full [01:17:54] any one of the [01:17:55] resources if they [01:17:56] are beyond the [01:17:56] threshold then it [01:17:58] will slower the [01:17:58] performance and [01:18:00] most of the time [01:18:01] it would be [01:18:02] processes or [01:18:03] storage [01:18:05] these two [01:18:07] hope I answered [01:18:09] you Harshit [01:18:09] are we good [01:18:10] yes yes [01:18:12] thank you [01:18:13] good [01:18:13] so the last [01:18:15] question I'll [01:18:15] take from G1 [01:18:16] so as G1 [01:18:17] what happens [01:18:21] that [01:18:21] yeah [01:18:24] Actually, I work on VDI, okay? [01:18:26] So before you answer that virtualization, everything remains the same. [01:18:32] But I feel in my VDI, we have the same configuration, RAM, ROM, whatever. [01:18:37] I have my local, okay? [01:18:39] But still our VDI behaves slow. [01:18:41] So what is the case behind it? [01:18:43] What is the reason behind it? [01:18:46] If you're going to give me a scenario, then you need to give me all the information. [01:18:50] A generic question, I will not be able to answer. [01:18:54] but let's see uh see suppose i have my local correct i have a 60 gb ram but some hard disk [01:19:01] this is a file system correct all those things but if i'm doing same structure on my video also [01:19:07] if i i work on the video okay i generally see 9 video this is a ram this is the hard disk space [01:19:12] and although this uh cpu is uh whatever i understand i understand so the same configuration [01:19:19] if i'm getting as a virtual desktop yes i'm seeing that there is a performance difference [01:19:25] it will be there right everything is in your local motherboard okay there in the vdi it is [01:19:34] sitting somewhere else in one corner of the world so it depends on your network connection it depends [01:19:40] on your bandwidth it depends on the stability because the data has to be transferred between [01:19:46] your laptop you only your network card is being used to nothing else your core is not being used [01:19:53] the core is used from the virtualized desktop which is probably sitting in [01:19:59] us east or london or singapore or mumbai wherever wherever it has been whichever region it has been [01:20:05] hosted so it also requires data transfer from your physical device to that virtual desktop [01:20:15] so there are so many so many parameters which can contribute to the lower performance but [01:20:20] generally if you have a good connectivity you should not be able to see much difference yes [01:20:26] slight difference will be there but you should not be able to feel much difference like how you are [01:20:32] describing oh sorry my left broadband is 100 mpbs now in current project also i'm working vdi [01:20:39] previous project also i have the vdi but same issue is there so i thought you told in the [01:20:44] previous answer that only the virtualization difference is there otherwise everything [01:20:49] remains same then i thought why it is a performance flow all those things happening if [01:20:53] everything remains same so due to that i i i i i told you very clearly not only the network [01:21:01] connectivity whatever restrictions your network has put i can also process the processing also [01:21:11] i can control in the virtualization you might think that you are getting two cores but do you [01:21:16] know you are getting two cores of i5 or do you getting two cores of i7 in your local laptop you [01:21:23] know that yes correct there are there are so many dependencies we just cannot compare straight like [01:21:31] that, but if you do an analysis, [01:21:32] we can get to know. [01:21:34] You can get to know what [01:21:36] of core you are getting and what generation and everything, [01:21:39] but have you ever checked it till date? [01:21:42] You might have not. Nobody does that. [01:21:45] Nobody does that. [01:21:47] So if you have to use it, [01:21:49] you have to use it, you don't have a choice, [01:21:50] so why do you get into this? [01:21:52] That's what any user will think about it. [01:21:55] If it is slower, they will report it, [01:21:57] and if you are an executive, [01:21:58] you will get a faster virtual machine. [01:22:02] But for normal users, they have to go with that only. [01:22:06] So there are so many factors around that. [01:22:10] And in the virtualization, I can also queue my queuing mechanism also within the same bare metal. [01:22:16] I can define. [01:22:17] If you are a normal user, power user, my operating system queue will get a preference than your queue. [01:22:27] Because at the end of the day, if my bare metal is not running, you are not getting your desktop. [01:22:30] so there are so many things [01:22:33] but you can't compare [01:22:35] one is apple and another one is orange [01:22:38] but definitely if you want to know [01:22:40] then you need to dive deep [01:22:42] because it won't be the same [01:22:44] yes [01:22:46] yes Ganesh [01:22:49] I'll take your [01:22:51] I think you are waiting for some time [01:22:53] I'll take your question [01:22:53] good afternoon sir [01:22:56] I'm audible [01:22:58] you are pretty much [01:23:00] thank you sir when we run a program inside virtual operating system [01:23:06] using like software python or turbo c id how this program actually executed in stepwise [01:23:18] okay virtual virtual operating system means you have containerized yes yes okay so whether you [01:23:29] running as a container, whether you are running as an on-prem, has no difference to the CPU. [01:23:38] End of the day, it is going to get the instruction from the RAM, and RAM is not going to look [01:23:44] at your operating system, whether it is on-prem or virtual. [01:23:49] So the instruction is what is going to get into the RAM, and from there it will get assembled [01:23:55] to the machine language, and further it goes. [01:23:59] The purpose of running your software as a container is totally different. [01:24:05] Suppose if your software fails, [01:24:07] you do not want to reboot the entire server to bring the application again. [01:24:14] You'll have to just restart the container, [01:24:16] which is equivalent to the reboot of a server, [01:24:19] so that only that application will get impacted. [01:24:22] It is totally isolated environment given [01:24:26] only for that particular application as a small system. [01:24:29] So that concept is totally different, but end of the day, when it enters the hardware, everything enters the same way, whether it is a container, whether it is a application installed directly on your operating system, or whether your operating system is on-prem, or your server is bare metal, whichever may be the case. [01:24:52] Did I answer your query? [01:24:54] Yes, thank you. [01:24:56] Okay, cool. [01:24:58] Cool, guys. [01:24:59] So dissembler, not sure. [01:25:05] Okay, Sankit. [01:25:06] Okay, I read it wrong. [01:25:08] Sankit, what is that you mean by I've done it for reverse engineering dissembler? [01:25:16] I'm not sure. [01:25:17] I'll allow your mic. [01:25:19] I just want everyone else to hear you. [01:25:21] What do you mean by that? [01:25:22] uh sir regarding the cpu basically registers and everything that basically that you have [01:25:29] discussed today right like i just wanted to like understand that it is the same thing right when [01:25:33] basically let's say we have a dll or an exe file in windows like there are some softwares we run it [01:25:39] we are able to get those ad num and all those things so it's it's basically that thing only [01:25:43] right like the complete because any high level program that gets like converted like from a [01:25:48] is when it gets compiled there is one machine language that's get like right and it is specific [01:25:55] to each and every like is instruction set architecture right like for example i7 series [01:26:00] so right basically i'm just getting it i'm just understanding able to connect the dots correctly [01:26:07] it's that thing only right so your dots are perfect but connecting the dots okay okay let [01:26:15] me explain uh there are two types of programs right one is compiled program another one is [01:26:23] instructional programs if you're writing a shell script it is instructional line by line it will [01:26:29] get executed if you're writing a java program if you compile it it becomes a jar or war and then [01:26:34] you host it so the war files and all is already has been decoded into the assembly language so [01:26:42] When it enters the CPU, [01:26:44] it just gets converted only to the machine language and it goes off. [01:26:47] The DLLs are all compiled. [01:26:49] It's already coded. [01:26:53] It need not have to be decoded by the CPU, [01:26:57] so it will definitely be faster. [01:26:59] If you are writing a third-party application, [01:27:01] something like this to add two numbers in a Python, [01:27:05] and if you're not compiling that Python, [01:27:07] we can compile and we can also make it as an interpreter. [01:27:10] So if you're going to run it as an interpreter, then it has to get decoded at two levels. [01:27:16] One is from English to assembly and assembly to mission. [01:27:20] But if you're going to compile that program, it is already, when you do the compilation, it is already decoded for assembly. [01:27:28] So only one conversion needs to happen at the decode level, which is only from assembly to mission. [01:27:35] so compiled programs the reason why it is running faster is this interpret program interpreted [01:27:43] languages why it is a little slow is the reason is this there are two levels of coding that has [01:27:50] to be done by the cpu before it gives to the unit to process your dots are all correct but [01:27:58] Connecting the dots is what I just want. [01:28:01] Yeah, please go ahead. [01:28:01] Sir, one follow-up question here. [01:28:03] At the very low level, when we speak at the CPU level, [01:28:06] the instructions at architecture I have in basically the assembly code. [01:28:11] That assembly code, is there some conversion happens at low level also? [01:28:16] Because computer only understands signals, right? [01:28:18] So is there any low-level conversion happens after the assembly also? [01:28:24] Assembly code, because my CPU is able to directly interpret [01:28:28] it and work on it okay assembly is not binary just for the benefit of everyone i'm making this [01:28:35] statement machine language is binary so even if it is enters the cpu as an assembly it has to be [01:28:43] decoded to the machine language which is binary end of the day hardware understands whether on [01:28:49] or off that's it so everything will get converted so for example anyhow we are going to see that [01:28:56] down the line i'll just tell you get a system a configuration and it says that your cpu is 32-bit [01:29:08] it will support 32-bit operating system that is what it says what does it mean [01:29:14] so it can process up to 32-bit in a given go if your operating system can support 32-bit [01:29:22] then the hardware can support 32-bit also now in this with this CPU if you are going to install [01:29:29] an operating system that operates at 16-bit then CPU will support only 16-bit it is underutilized [01:29:37] suppose if you are going to install an operating system for example Linux operating system Debian [01:29:43] Ubuntu Red Hat they all support 64-bit so if you install a 64-bit operating system [01:29:51] and you have a 32-bit CPU, [01:29:54] the processing is going to happen only for 32 bits [01:29:56] though you have a 64-bit operating system. [01:30:01] So what is this 32-bit? [01:30:03] We will see that soon. [01:30:05] Make sense? [01:30:11] Yes, sir. [01:30:13] Okay, just for the benefit, [01:30:14] because for everybody, [01:30:17] I just wanted to understand [01:30:18] what you are trying to post [01:30:20] and give clarification to everybody. [01:30:22] Thank you so much, Sanket. [01:30:25] appreciated [01:30:27] okay [01:30:29] so EX is assembly [01:30:34] and it gets converted to mission [01:30:36] that's right [01:30:37] cool [01:30:39] last question [01:30:42] and after that we will take a break [01:30:44] Krishna Chandra [01:30:46] I am allowing your mic [01:30:47] sir good evening [01:30:55] very good evening [01:30:57] sir my question is here [01:31:00] anywhere [01:31:01] in this particular example [01:31:04] where you can recite the [01:31:07] cache memory exactly. Post the RAM [01:31:09] or inside the CPU somewhere [01:31:11] the cache memory will be utilized or not? [01:31:13] For this example particularly I am asking. [01:31:15] It will be the result [01:31:17] whatever in this example [01:31:19] the result it has given [01:31:20] the result will go to cache and rest [01:31:22] everything will be flushed. [01:31:25] Okay only the result [01:31:27] right? Yeah only the result [01:31:29] will go to [01:31:29] cache. [01:31:31] cache memory is also very [01:31:34] small yeah go ahead [01:31:36] correct that's why I told [01:31:38] for this example particularly [01:31:40] but while we are [01:31:42] providing any inputs [01:31:43] okay so is [01:31:46] there any role of the cache memory [01:31:47] in case of huge inputs we are providing [01:31:50] no no [01:31:52] cache is something which is being [01:31:54] stored after [01:31:56] processing [01:31:57] suppose if you are opening a [01:32:00] Word file. Let me go away from [01:32:02] this example. Suppose if you [01:32:04] are going to open a Word file, [01:32:07] it has some 3MB [01:32:08] size. Now it is [01:32:10] getting loaded into the RAM [01:32:12] and now you [01:32:14] are typing. [01:32:16] Now there is a change [01:32:18] from what it has opened and what [01:32:20] the status has of it now. [01:32:22] Now unless you give the instruction [01:32:24] to save, it won't save. [01:32:26] But where is it? It is in the RAM. [01:32:29] But when you give the instruction [01:32:30] to save then the difference will go to cache why it goes to cache until you close the file [01:32:37] it want to have what has changed and that is where if you look at sometimes if you're opening [01:32:44] excel sheet or if you're opening the word document it says that we have something in cache which is [01:32:52] not there in your file do you want to recover where is it coming from it is coming from the [01:32:59] cache and if you say [01:33:01] no I don't want I have everything in [01:33:03] my document can I clear it [01:33:05] you say yes it will clear the cache [01:33:07] cache is for post processing [01:33:11] not for pre processing [01:33:12] okay sir thank you understood thank you [01:33:17] sir [01:33:17] great [01:33:20] I was introduced to raspberry [01:33:25] pi by my colleague is it [01:33:27] in this case the same cpu [01:33:30] setup or [01:33:31] that's a different [01:33:32] there is different [01:33:36] okay cool guys so let us [01:33:42] quickly take a break of [01:33:44] five minutes it's [01:33:46] 56 now I'm going [01:33:48] to pause our recording at this [01:33:50] point of time [01:33:51] once I'm back I'll [01:33:54] start the recording in case if you find it [01:33:56] is not started please feel [01:33:58] free to [01:33:59] put me in the chat [01:34:02] so [01:34:03] oh i'm not able to pass okay let it go uh i don't know one session is something different [01:34:11] another session is different okay cool so let me stop sharing i will probably put for the [01:34:19] indicator because it is getting recorded for the indicator i'll put for five minutes so we'll come [01:34:25] back in five minutes take care guys yes prashant hi guys i'm mac i'm back we'll wait for another [01:39:16] 30 seconds okay guys can you please give me a thumbs up so that i understand that you are also [01:40:05] back p29 participants good to see guys i believe you also will understand that it'll be very [01:40:21] difficult for me to give opportunity for everyone to talk in a small number of participants it's [01:40:30] easy for me to do okay so in case if your query is being asked by someone else please help me [01:40:36] by not not raising the hand okay cool thank you so much so let's proceed now we are getting we [01:40:48] have discussed this so i'll be going a little faster in this example if you look at it there [01:40:56] is within the cpu core we have program counter this program counter is going to track what is [01:41:04] the next instruction that needs to get executed so that there is no delay between the transfer [01:41:11] of instruction from the component to component even within the CPU core. [01:41:19] So IR is the current which is getting processes. [01:41:24] General purpose is where all the variables are stored, the data is stored. [01:41:29] Memory address register is basically it is holding the address of the memory, which is [01:41:34] RAM. [01:41:35] from where it has read from or to be written to. [01:41:42] And MDR or MBR, that is memory data registered, [01:41:48] it holds the data being transferred to or from to. [01:41:52] So there is a difference. [01:41:53] We'll speak about this pretty soon. [01:41:59] And flag is basically to get the status of that particular instructional set. [01:42:05] Once it is completed, then it will get transferred to the memory. [01:42:11] So the CPU gets the next transaction to complete. [01:42:18] Storage hierarchy we discussed. [01:42:21] Fastest access but smallest capacity are register. [01:42:25] Register is inside the CPU. [01:42:29] Cache is having a better capacity than register. [01:42:34] You can say small capacity. [01:42:35] It is just the difference between KBs and MBs. [01:42:40] So it will have faster access, but slower than register. [01:42:46] But it has higher capacity than register. [01:42:49] Because whether it is L1 or L2, it is attached to the core for the processing. [01:42:55] But L3 cache is basically the storage area for the CPU. [01:43:00] and L3 is common to all the cores that is present in the CPU. [01:43:08] So if you have 4 cores, this L3 will be shared by all the 4. [01:43:13] If you have 12 cores, if you have 32 cores, [01:43:15] it will be shared by all the cores, the L3 cache. [01:43:21] The memory is going to have a bigger capacity. [01:43:26] Probably it is denoted by GBs. [01:43:29] 4gb 8gb 16 32 64 256 so it will have it is directly accessible by the cpu [01:43:39] irrespective of the capacity of the ram it is directly accessible by the cpu [01:43:45] it's the main memory of the system larger in capacity but slower access compared to [01:43:52] either cache or [01:43:54] register. [01:43:58] Now you have a secondary storage [01:44:00] which can go up to petabytes. [01:44:07] It can be [01:44:08] made out of one hard disk or [01:44:09] it could be by multiple hard disks [01:44:11] or it could be LUNs. [01:44:13] There is no limit. [01:44:16] Which one? The secondary storage. [01:44:18] But that is the slowest [01:44:20] among these categories. [01:44:23] When we are [01:44:23] Speaking about the speed fastest and the slowest, the difference would be in microseconds, not more than that. [01:44:33] But still, as we go down the hierarchy, capacity increases, but speed decreases. [01:44:43] Now, executing an instruction. [01:44:48] Register A to register B and put the result in the register C. [01:44:55] How it happens. [01:44:56] now the instruction from the control unit where will this control unit get it it will get it from [01:45:05] the memory just now we understood memory is directly accessible by cpu so the control unit [01:45:16] decodes the instruction it changes to the assembly your program will be converted into [01:45:26] add A, B, direction C. [01:45:30] And it generates control signals to set up the data path. [01:45:36] Now the control unit is the one which is going to give directions [01:45:40] for rest of the units within the CPU. And it will have [01:45:45] storage bins, which is registers. So now the control [01:45:51] unit will, where is this data path available within the [01:45:55] CPU, that is the connectivity which is available inside [01:46:00] the cpu these are all individual units which is connected by the circuit so the circuit is the [01:46:09] data path so the data has to be transferred from one unit to another for example if register has [01:46:16] to give it to alu how will it give the instruction how will it give the data both only then the alu [01:46:24] will be able to do the arithmetic and give the result and the circuit here is the data path [01:46:33] it is part of your overall motherboard and generally it is referred as a bus [01:46:40] so the architecture of the bus we are not getting into the depth but [01:46:43] there is a difference in which architecture it is developed that also will have a correlation [01:46:50] to the speed that you are having so the generation what you see i for example x86 you see i3 i6 i7 [01:47:00] that's basically the layout of the circuit so it will have a higher speed of the data transfer [01:47:07] so it will be a little faster in processing so if you are having two i3 is definitely not [01:47:14] equivalent to one i6 because the differentiation is in the layout of the circuit and it is not about [01:47:23] adding so it is not simply like you have two hard disks my capacity has increased [01:47:30] so i can store more data that is from the storage perspective but if you have two different hard [01:47:35] disks one is hdd and another one is ssd one hard disk the ssd will perform faster compared to the [01:47:43] the HDD. So, you might start using your data storage as SSD drive and not HDD. If at all, [01:47:50] you are able to make the difference. Now, CPU data path is interconnected by the bus. [01:47:58] Now, if register A has to go to the ALU, register B has to go to the ALU, [01:48:04] register C will not go to the ALU. Only A and B will go along with the operation. [01:48:13] So two operands and one operation will go to the ALU. [01:48:17] And the ALU will calculate all this input is in binary. [01:48:21] It will not say decimal. [01:48:24] A is equal to 10. [01:48:25] No, it will not be. [01:48:26] We will see how exactly this is getting transferred from one unit to another unit within the CPU. [01:48:32] But for now, if we understand that all this transfer happens via binary only, [01:48:37] and this will calculate and give the result. [01:48:40] ALU will give the result. [01:48:41] Actually, I should show it like this. [01:48:44] It might confuse you. [01:48:46] So I'm just showing to the right. [01:48:48] This will give back to the register C. [01:48:52] Now the register C is going to store. [01:48:55] Basically, this and this is same. [01:48:57] It's not two different registers. [01:48:59] The communication is happening between this register and ALU. [01:49:02] ALU is giving back to the register C. [01:49:05] And register C will store it. [01:49:07] Operation is complete. [01:49:09] It will go to the memory first, who will give it to the memory, the control unit. [01:49:15] How it will get? [01:49:17] Here there is an indication that it should be supposed to be stored as C. [01:49:22] That C is nothing but a register C. [01:49:25] All these will also have addresses. [01:49:27] A, B, C is only for your understanding, I am putting it here. [01:49:30] But all these registers also will have addresses within the CPU. [01:49:35] Now, this address will match, control unit will give it to the RAM, and then it asks the CPU to flush, while it is flushing, registers will flush A and B, but move the C to the cache. [01:49:53] Suppose if it is a bigger operation while coming only, then the control unit is going to tell registers to store, [01:50:01] and if it is not able to store within the capacity of the register, [01:50:05] then it will use the cache for storage. [01:50:09] And which storage it will use? [01:50:11] It will use the L3 cache, not L1 and L2. [01:50:14] It will use the L3 cache to store and it will start swapping. [01:50:19] It is very similar to your swap memory concept in the operating system level [01:50:24] where you are using hard disk as a memory. [01:50:27] So here, cache is used as a memory. [01:50:31] Cache is used as a register for the operation. [01:50:35] That also moves the same way. [01:50:37] So the control unit tells the data path. [01:50:40] It will tell register on which data path it is supposed to transfer the data to the ALU. [01:50:46] And ALU will be instructed on which path it has to give it back to whom. [01:50:51] And that will go back to the control unit. [01:50:53] Control unit knows everything what is happening within the CPU. [01:50:57] Whether it is 4-core, 10-core, 12-core, control unit is going to be only one. [01:51:06] L1 cache is for operations, it is not for storage. [01:51:10] L1 cache is attached to every core. [01:51:14] So suppose if you have four cores, there will be four L1 cache. [01:51:18] And that L1 cache is also divided into two. [01:51:22] One cache will have only instructions and another L1 cache will have only data. [01:51:27] It is separated. [01:51:29] So now, are you going to use L1D for storing your data to be processed? [01:51:36] No, it is not. [01:51:37] The design is L3 cache will be used as a storage. [01:51:41] And that's why it is common for all the cores. [01:51:45] L1 and L2 is very specific to the core. [01:51:52] So now we are getting introduced to the data path. [01:51:56] Not just a register. [01:51:57] there is a data path [01:51:59] which connects all the units [01:52:01] not only the ALU [01:52:02] we have so many units [01:52:04] available within the core [01:52:05] like ALU [01:52:07] all the units are connected [01:52:09] using this bus [01:52:11] and this bus is used [01:52:13] for the data transfer [01:52:14] and that direction [01:52:18] is the data path [01:52:20] okay [01:52:22] this is how it will execute [01:52:24] the instruction [01:52:25] fair enough [01:52:28] This is how it looks like. [01:52:31] Now the control unit is only one, [01:52:33] irrespective of how many cores you have [01:52:36] and how many data paths you have. [01:52:38] It doesn't matter. [01:52:40] Control unit is only one. [01:52:42] It just controls the signals, nothing. [01:52:45] It will not even know what is A, what is B. [01:52:50] It will just say, oh, A, B, you transfer, you get it done. [01:52:54] Have you done it? [01:52:55] Yes, I have done it. [01:52:56] That's all. [01:52:56] It is not going to verify whether it has calculated correctly. [01:53:01] No job of that to the control unit. [01:53:04] Suppose if you are going to assume that the CPU is one toll. [01:53:09] Now, there will be a control unit for the toll, which will be away from the toll itself. [01:53:17] And that will monitor all the lanes. [01:53:20] The lanes are nothing but your data bus, which is going to use that bus to transfer the data, all. [01:53:28] Any car that is coming, cars are variables, nothing but your registers. [01:53:34] So, if register A is sent in lane 1, that is one data bus, doesn't mean that register B also is going to go that lane only. [01:53:45] End of the day, it has to be transferred to the ALU. [01:53:49] So it can take two different lanes to reach. [01:53:53] That's why we are making it faster. [01:53:56] And ALU will give it back to register. [01:53:58] See, it might be in another data bus it will use. [01:54:02] But which data bus to be used is controlled by the control unit. [01:54:07] So don't please ask me, driver chooses the lane and not the toll booth manager. [01:54:13] I understand that. [01:54:15] But just for our understanding, I told. [01:54:18] So even if the driver uses the lane, [01:54:21] unless he pays the toll, [01:54:23] control unit will not allow the car to go away from it. [01:54:28] Unless the operation is completed, [01:54:31] it will not be allowed to travel further. [01:54:34] That's all I'm just trying to make you understand. [01:54:39] So control unit is only one. [01:54:42] Whether you have 12 core, 32 core, [01:54:43] it is only. Whether you have 16-bit, whether you have [01:54:47] 32-bit, control unit is only 1 [01:54:49] for the entire CPU. [01:54:53] Okay, cool. [01:54:55] Now, how is this instruction being sent? [01:55:04] Because CPU understands [01:55:07] only binary. Even if you say add [01:55:11] R1, R2, Aromark R2, [01:55:15] R3, it has [01:55:18] nothing to do with that. It will give [01:55:20] back so i think you were working in some other tool you are sending that signal to me i can't [01:55:29] process it so it has to give it in the mission language so how is that structured the instruction [01:55:38] this is where exactly this 32-bit and 64-bit and 16-bit comes into the picture now 16-bit no [01:55:45] no more it is relevant everything that comes is with a minimum of 32-bit and you will get 64-bit [01:55:53] capability also but even now the most popular is the 32-bit instruction format even if your [01:56:01] operating system is a 64-bit operating system it converts the instruction into 32-bit only [01:56:08] So now this is broken up, this 32-bit is broken up as operations code, that is opcode, your register, and it doesn't mean that every instruction should get a 32-bit. [01:56:31] Some of them can be done with 16-bits. [01:56:34] So you will have unused. [01:56:37] You will have unused, but that's okay. [01:56:40] Core understands, ALU understands, register understands. [01:56:45] So this is the instruction code that will go. [01:56:49] So now, what is the upcode? [01:56:51] Upcode is nothing but your ADD. [01:56:55] Every operational code has its own binary equivalent. [01:57:00] So it will get converted into binary and it will occupy from 26 to 31. [01:57:08] Why 31? Because it starts with 0. [01:57:11] So how many bits you have? You have 6 bits for your operations. [01:57:16] In this instruction code structure, the operations is going to occupy only 6 bits. [01:57:24] Then you will have registers. [01:57:28] So registers, every register it is going to be 5 bits. [01:57:34] 21 to 25, 16 to 20, and if you don't have [01:57:38] two, if you have only one, then one, rest everything [01:57:42] is unused. Later, if it is a 64-bit operating [01:57:48] system, all these unused will be used [01:57:52] by the operating system, but not by the control unit. [01:57:56] So this is how it is going to go. [01:58:00] When your register receives, it is going to [01:58:03] receive in this format not the one which is there on the top when it is given back to the control [01:58:12] unit then it is going to convert back to assembly and then it will give it to memory so that decoding [01:58:19] is happening at control unit level so in this example if you look at it the assembled instruction [01:58:27] binary representation will look something [01:58:30] like this. This is [01:58:32] opcode which is add [01:58:33] this is R1 [01:58:36] this is R2 and this is R3 [01:58:38] rest everything [01:58:40] is unused because it doesn't [01:58:42] require more than that. [01:58:44] What if it requires more than that? [01:58:45] No operations will require more than 32 bits [01:58:47] that is how the entire system is [01:58:50] designed. [01:58:51] If you want to, some of the operations [01:58:53] doesn't require [01:58:55] that may be the case but [01:58:57] There is no case that it requires more than 32-bit. [01:59:02] So this instruction tells the CPU what to do in the first six bits, [01:59:08] which registers to use the next respective 55 bits. [01:59:18] And if you give like A square plus B square plus C square is equal to, [01:59:24] if you are going to send that instruction as a format, [01:59:27] sorry instruction as a transaction then the instruction is going to get split [01:59:34] within this 32 gate you have three a b and c now the opcode opcode has [01:59:44] require addition so these two this will get split into multiple instructions by [01:59:53] the control unit everything will get processed and come and it will assemble [01:59:57] and give it to RAM. [02:00:03] That is why you have generation of languages. [02:00:06] How the language instruction is getting converted to the CPU, [02:00:11] based on that, your generation of languages is there. [02:00:15] Is that the only reason for generation of languages? [02:00:18] No. [02:00:18] This is one of those trial reasons that it is something like that. [02:00:23] No, trial is something that odd random number I chose. [02:00:26] There are more reasons for generations of languages. [02:00:29] for example you have oops concept coming into java and python but it was not there before [02:00:35] that is another reason so your instructions becoming more english in your higher generation [02:00:45] languages as you move up in the hierarchy of languages of generation sorry generation of [02:00:51] languages higher the generation more of english now the assembly language is this this is [02:01:01] how control unit understands. [02:01:05] So when this operations is confirmed, [02:01:07] this is like it is going to have 00010. [02:01:13] Now this will get converted into this language. [02:01:16] So R3, R1, and R2, upcode is add. [02:01:21] And this is the instruction memory [02:01:25] has given it to the control unit. [02:01:26] So it will give back to the control unit [02:01:28] where you have R3, [02:01:30] the result is available now your program is going to pick up the r3 and display on the screen [02:01:38] so that transactions is totally different how is it happening from memory to program to output device [02:01:46] that mechanism is totally different but our focus is only cpu today so we are looking at it [02:01:53] so yes rohit you have raised your hand any questions do you have [02:02:01] yes sir so i have the question regarding uh regarding the format you have uh you have just [02:02:08] uh so like you have uh like mentioned the specific positions of the off code [02:02:13] uh the various registers that we have so they they like uh are the fixed positions or they juggle up [02:02:19] like uh they would uh change or that they are fixed okay so i think this will answer the another [02:02:27] question from Sashank also so generally the output will be the first [02:02:35] that is for sure in this example also you have register C coming after the [02:02:41] upcode and after that it is variables so now whether it is A first to B first it [02:02:50] makes no difference look at the beauty of the design the operation happens there [02:02:56] and it is storing in the first. [02:03:02] So now, in this machine code, this is our result. [02:03:07] This will get assigned to the R3. [02:03:08] Even in the machine language, [02:03:10] sorry, from machine to assembly, R3 is here. [02:03:14] In assembly, it will be add R1, R2, arrow mark R3. [02:03:20] That is assembly. [02:03:22] Now, R3 here is first because it has decoded from the machine code. [02:03:27] and then it will rearrange the assembly language [02:03:30] to that format [02:03:31] and then it will give it to the RAM. [02:03:35] Kobi, I answered your query, Rohit. [02:03:38] Yes, sir. [02:03:39] Sir, and one more thing I had [02:03:41] regarding the cache, [02:03:43] like we have three levels of cache [02:03:45] and you said that for the L1, [02:03:49] like we have assigned to each code [02:03:52] and also the L2 is also assigned to each code. [02:03:57] that you shared. [02:04:00] So why do we have like two caches [02:04:02] like they are actually assigned to each code [02:04:04] like L1 as well as L2 [02:04:06] and then we have another L3 [02:04:08] that is shared. [02:04:11] Okay. [02:04:12] See the L2 cache size is high [02:04:15] and the instruction comes [02:04:17] it is going to sit [02:04:19] in your program counter. [02:04:22] The program counter is going to move it to L2 cache [02:04:25] and L1 cache is the current in. [02:04:27] instruction in the instruction execution you require both instruction as well as [02:04:34] data here it is both together it gets split into two when it gets into the [02:04:40] core so core will pick up from l1 cache i cache from further instructions your [02:04:48] opcode and it will pick up the data r1 and r2 that is why your r3 is always [02:04:54] first instruction is the first data followed by the data and that's why it has two l1 caches [02:05:02] so that it is faster i don't have to split it is somebody so you are sitting in a counter where [02:05:09] you are accepting all the payments and if somebody in the queue they are helping you okay so you are [02:05:17] going to pay by credit card okay go to counter number three if you go to the passport office [02:05:23] you will understand this very clearly so you have come here okay you are allowed you can get into [02:05:29] the passport office seva kendra now you have a counter a why counter it counter a because they [02:05:37] will verify your documents that is your l2 cache once your documents are verified they will split [02:05:45] all the documents they will rearrange the documents in the order that the counter b requires [02:05:52] So they will split the documents, [02:05:54] they will rearrange the documents, [02:05:55] they will staple it, [02:05:56] they will put the form on the top, [02:05:57] they will put the documents on the below [02:05:59] and then they will give you go to the B counter. [02:06:02] So now the L2 transfer to L1, [02:06:05] when it transfers, it splits. [02:06:08] Now when you go to the B counter, [02:06:11] they know what to look for [02:06:12] and documents are all arranged. [02:06:15] Now it is still in the counter B, [02:06:17] no approval yet, no processing yet. [02:06:19] where the processing happens at the [02:06:21] counter C. So when it [02:06:24] goes to the counter C [02:06:26] they will even remove [02:06:28] all the documents that has been verified [02:06:30] and satisfied. When you go to the [02:06:33] counter C, only the [02:06:34] required document you will [02:06:36] take and go. If you have [02:06:38] gone to the passport office and [02:06:40] processed it recently, you would [02:06:42] have understood this process. [02:06:45] Now in the C, it [02:06:46] is like this. Two, three [02:06:49] things has to be checked. They'll say [02:06:50] okay process are [02:06:53] reject [02:06:54] now while in the [02:06:56] B there is some document missing [02:06:59] so you will be [02:07:00] sent back you will not be allowed to go [02:07:03] to the C now from the [02:07:04] L1 it will not be [02:07:07] picked up L2 will not give it [02:07:09] to L1 so core is not going to [02:07:10] do any processing at that level [02:07:12] now L2 will give it back [02:07:14] to RAM sorry L2 will give it [02:07:17] back to [02:07:17] the control unit and it [02:07:20] will go back to the RAM. If something is not there, counter B will come. But next time if you [02:07:26] have rearranged your instructions properly, if memory gives back to the control unit, the control [02:07:32] unit is going to send it to L1 cache directly. Like you completed A counter, B counter you have [02:07:39] been sent out to bring your other card original. When you come back in the next appointment you [02:07:44] will not be asked to go to the counter A. You will directly go to the counter B. So the data [02:07:49] comes to the l1 cache because they have already split instruction the data cache the reason is [02:07:57] the process needs to be faster for the end user here you are the end user applying for the passport [02:08:03] renewal so you'll be asked to go to counter b directly not counter a if you pass through counter [02:08:09] b counter c passport will be issued you are coming out of the queue same way it will go out [02:08:16] That is the reason this L1 cache and L2 cache is very much attached to every core, it is [02:08:24] not shared. [02:08:25] Suppose if I put in L13 cache, let us assume core 3, then L13 cache is going to be processed [02:08:33] only by the core 3, not by core 0. [02:08:37] But if core 3 wanted to put back some storage, then it will not use its own cache, it will [02:08:44] use the shared cache that is l3 so this l3 cache is shared by all the four cores make sense so can [02:08:56] you please repeat the last part like the sharing part like how that uh sharing uh see core three [02:09:04] core three has picked it from its own l1 cache okay now it is processing at a split of a millisecond [02:09:13] it sees that I want to [02:09:15] store something [02:09:17] basically swapping. [02:09:19] That swapping will happen with L3 [02:09:21] and this L3 cache [02:09:23] is not only for [02:09:25] core 3, it is for [02:09:27] core 0, 1, 2, 3, for all [02:09:29] these core 4s [02:09:30] this only one [02:09:33] L3 will be there and that will be shared by all [02:09:35] the 4s. [02:09:37] So core 3 when it is [02:09:38] storing temporarily for that particular [02:09:41] split of a segment [02:09:42] it knows where is it [02:09:44] storing and it will pick it back [02:09:46] so L3 cache is shared [02:09:49] but it will have huge capacity [02:09:51] L2, if this is like KBs [02:09:54] this is MBs, this will be [02:09:56] bigger than L2 [02:09:58] because it is shared with everyone [02:10:00] if the CPU repeatedly [02:10:04] yes please go ahead [02:10:06] sorry [02:10:07] to interrupt sir [02:10:08] I understand that it might have to [02:10:12] put some data back [02:10:14] and then it's using the L3 cache. [02:10:16] So, like, why [02:10:18] it would not use L2? [02:10:20] Because the L2 is an incoming [02:10:23] cache. [02:10:26] Okay. [02:10:27] Incoming traffic, right? [02:10:28] It also has two, right? [02:10:30] It has to accept process and give it back. [02:10:35] Okay, it's like [02:10:37] one way and like here L2 [02:10:39] is like [02:10:40] only to receive the input [02:10:42] from the RAM through the control. [02:10:45] Yeah, yeah. See, [02:10:46] It is not received from RAM, control unit. [02:10:51] Control unit is the one which is going to receive from RAM. [02:10:58] Because RAM will have an assembly language. [02:11:02] It needs to be converted to machine. [02:11:05] Control unit will do that. [02:11:10] So it will come to your program counter, [02:11:12] and from program counter only, it will go to the instructional register. [02:11:16] And when it comes to the instructional register, it enters L2 first. [02:11:21] Go to L1. [02:11:21] l2 will split instruction and we have 32 bit right the first six will go here and the rest [02:11:28] 26 will go here and core knows what to do now instruction is in l1 data is in l l1 l1d [02:11:37] as simple as that so if i'm going to write if core 2 is going to write back to l1 cache [02:11:44] which one it is supposed to use is it l1i or l l1d so no confusions it will put it to l3 [02:11:54] It will pick it up from L3, it will put it to L3, L3 will be giving it back to control unit. [02:12:02] Output also is going to come to the L3 cache only, not L2 or L1 output. [02:12:12] Would there be a scenario that the L3 cache may be used within the cores, like if they are processing parallelly? [02:12:24] like if yeah yeah yeah see all the four cores are going to work parallel no the first instruction [02:12:31] goes to core zero second instruction will go to core one there is a request there is a question [02:12:38] in the chat if the cpu repeatedly access a of i if i is not greater than 20 so that means 20 [02:12:49] instructions. The 20 [02:12:51] instructions will come into the program [02:12:53] counter and from there it will be [02:12:55] queued. First will go to core 0, [02:12:57] second will go to core 1, third will go [02:12:59] to core 2, fourth will go to core 4 [02:13:01] and this cycle will follow and all [02:13:03] the 20 will get [02:13:05] completed. When it [02:13:07] gets back to [02:13:08] control unit, it will, it has to [02:13:11] give only result, right? [02:13:14] We are not going to give [02:13:15] unless you ask within the [02:13:17] program I want to see what is happening within [02:13:19] the for loop it doesn't have to so that means for every instruction do you want to give me the [02:13:26] result or do you want me to give the result of the overall it is overall only one result will [02:13:32] go back to the control unit and control unit unit will give it to ram in your for loop if you have [02:13:38] said okay export this result then for every loop the result will go back to control unit and ram [02:13:46] will receive so you will also receive so whether you use for loop whether you use if condition [02:13:56] end of the day it will be made as instruction if you have a loop of three million instructions [02:14:04] that is the reason in case of data engineering scenarios and all if you look at it [02:14:09] the data that is getting you know transformed and then loaded before that it has to extract [02:14:16] from the source, that is the process [02:14:18] of data engineering. [02:14:26] Aditya, that's too much. [02:14:27] I don't have a motherboard, otherwise I would have done it. [02:14:31] So, you asked a question. [02:14:33] Yeah. [02:14:34] Yeah, sir, maybe [02:14:35] it's a very naive question, sir. [02:14:38] The set of registers [02:14:40] that you have shared, [02:14:42] like we have registered, three sets of registers, [02:14:44] so that is fixed or like [02:14:45] it would [02:14:47] change? [02:14:48] like in the [02:14:50] you want to know how many types of registers [02:14:52] are available [02:14:53] no no I am just I am curious to know [02:14:56] like the number [02:14:58] oh you are speaking about R1, R2, R3 [02:15:00] yes yes [02:15:01] that numbers are fixed [02:15:04] no no nothing like that [02:15:06] if you have 10 variables then there are 10 registers [02:15:08] ok [02:15:12] here I have only [02:15:16] 2 variables [02:15:19] and 1 result so 3 registers [02:15:21] ok [02:15:27] Okay. Thank you, sir. [02:15:29] That would go for myself. Thanks a lot. [02:15:35] Cool. [02:15:36] Thank you. Thank you, Varun. [02:15:40] So, I guess [02:15:41] you used your prompt. [02:15:43] Answer is [02:15:44] very clear. [02:15:47] Shows that you have used the prompt. [02:15:49] Okay. Cool. [02:15:50] Thank you. So, now [02:15:56] let us go back [02:15:58] to our flight. [02:16:02] So, [02:16:03] categories. [02:16:04] so that all this time we were just uh [02:16:08] vikish kumar you have to okay yes vikish i have allowed your mic [02:16:17] thank you uh sir i have a huge case uh since you mentioned about the data engineering [02:16:24] so i am from data engineering background and i work as a big data engineer so we process a lot of [02:16:31] data so i have a huge case let's say i have a file of let's say 10 gb and i have given a cluster [02:16:41] or let's say spark cluster having uh 10 cores so when we when we split the file and process the [02:16:50] data then that data will go go to registers and as as you explain the registers has limited capacity [02:17:00] it doesn't have much storage so how data processing happens over there will the data [02:17:06] get spilled to cash or some some other storage or how how it happens okay since you have asked [02:17:15] very specific let me answer you uh others if you are able to understand well and good [02:17:21] if you are not able to understand still we are good so you say that you have a 10 gb of data [02:17:28] uh what is the format of the data it could be an csv file yeah okay so it is a whether it is json [02:17:38] or csv it is all robust so there is a value for every column in that row assume that you have [02:17:45] seven columns now your program is just validating every row of data if the data is valid you will [02:17:53] push to some database if not you will correct it and then push to a different database for [02:17:58] somebody else to look at it this is the logic of elt now you are looking at the data row wise [02:18:06] record wise even if it is a no sql database it is still row wise except it is a columnar database [02:18:15] everything is row wise so every row you will take now you have an instruction what is the [02:18:21] instruction you have there are five fields to be checked is the date format in the right format [02:18:26] do we have the name in the first capital rest everything small do i have the phone number in [02:18:34] six digits these three i'm sorry the pin code is in six digits these three i'm checking for every [02:18:43] row now every row is a data within that every row i have three instructions what are all those [02:18:50] three instructions. One is [02:18:52] if the data is correct, sorry, [02:18:54] date is correct. Second is [02:18:56] if the name is in the right format. [02:18:58] And the third is whether the pin code [02:19:00] is six digits. [02:19:02] So now every row will have [02:19:04] three instructions. So now [02:19:06] three instructions will go to the core [02:19:08] but all the three [02:19:10] are from the same row. [02:19:13] So how is it getting [02:19:14] reassembled? It is reassembled by your [02:19:16] program. [02:19:18] Not even by the operating system. [02:19:20] So, operating system will break this into three instructions and give it to the control, to the memory, load it into the memory. [02:19:28] When it loads into the memory, it will load only three instructions. [02:19:32] It is not bothered about the other four columns, what you have. [02:19:36] So, the first instruction is validation. [02:19:39] So, date is first instruction, second is name, and the third is pin code. [02:19:44] If any of these things goes wrong, it is just going to give the result that date is not in the right format. [02:19:50] Once your program receives that input, there is an instruction for the program to move that record somewhere and delete it from this source file. [02:20:02] So here there is no CPU involvement for calculation. [02:20:06] CPU involvement is only to move data. [02:20:09] So again, moving that data, it will be split into seven instructions and it will get into the core. [02:20:14] moving data, seven instructions [02:20:17] and seven instructions [02:20:19] can go into any of the cores. [02:20:22] If it is parallel, if you have given [02:20:23] ten cores, [02:20:25] you have seven instructions, [02:20:27] the instruction will happen in a split [02:20:29] of a millisecond, data will [02:20:31] be moved. And that is the reason [02:20:33] you are seeing that almost [02:20:36] a thousand records are processing within [02:20:37] a minute. So this is how it [02:20:41] works. And all [02:20:43] your split is done by [02:20:45] your spark not even by the operating system so basically uh my question is around so uh as i [02:20:55] mentioned earlier so let's say i have a function and that function contains two data frame which [02:21:00] is basically the chunk of the file okay and then we are joining these two data frame in order to [02:21:06] produce the final result in data frame so when we will put these two data frame and when uh since [02:21:13] this is in a function all the processing happening in a function that function will go [02:21:18] as an instruction set to the cpu and then we we have a chunk of data that's loaded in the memory [02:21:27] so far it's in the memory it's not rich to register so when the execution when the execution [02:21:35] will start the instruction set will go to the cpu and then the further depending on the number of [02:21:41] partition it will get divided into into course so let's say if i have four course so four course [02:21:50] will process four partitions parallelly right so okay so now now you are trying to combine [02:21:59] hold on hold on you are trying to combine two different concepts your partition is a software [02:22:05] partition okay you cannot partition the hardware if you want to partition the hardware then you [02:22:18] will not you cannot use spark you have to use vmware or virtual box your spark cannot partition [02:22:28] hardware so spark does only the software partition of your data and it identifies the instruction [02:22:35] and data and gives it to the RAM [02:22:37] RAM gives it to control unit [02:22:39] control unit differentiates [02:22:41] that and put it into L1 [02:22:43] data and L1 instruction [02:22:44] so when you are giving it to the core [02:22:47] it has to be split clearly [02:22:48] between instruction and data [02:22:51] so that is done by your [02:22:53] Spark [02:22:54] so if you are speaking about bifurcating the data [02:22:57] or accumulating the [02:22:59] data, that is done by your [02:23:01] software, not by the hardware [02:23:03] so instruction [02:23:05] in that case will go to the cpu is not about uh you know making a single data frame [02:23:13] the instruction will go is about moving the data there you are moving the data from one spark [02:23:20] partition to another spark partition one data frame to another data frame so the instruction [02:23:26] is not about copying it's about moving so we have different types of instructions to the cpu [02:23:33] it's not only ALU there are so many units that is part of [02:23:37] so the core is going without the help of these units [02:23:41] core cannot work we will see that example [02:23:45] exactly if you are still not convinced with the [02:23:49] answer you can ask it again are we good [02:23:53] okay sir little doubt [02:23:57] I still have little doubt so basically I was saying [02:24:01] that let's say as you have given the example of adding two numbers so instead of two numbers i'm [02:24:07] passing two data frame as an input and i have the function so that function and the data frame [02:24:15] basically okay so within the data frame can you tell me what is there in your data frame [02:24:23] is it an array it's uh it's a data it's a tableau data [02:24:29] what is i agree but what format it is in it's in i mean it's a in memory of format it doesn't [02:24:40] contains i mean it's a tableau format that's it okay basically hold on hold on the tabular format [02:24:50] is called as metrics okay okay if you have only one row of data it is called as array [02:25:00] if you have only one value it is a variable if it is a variable it is only one register [02:25:06] if it is an array whatever is the size of the array is your number of registers [02:25:13] if it is a metric you know how to product your metrics so many registers [02:25:17] it is not going to sit as a single data frame in your processor in your register [02:25:25] it will get split and this split will be done by the control unit [02:25:28] not by your spark when it goes back to the spark it will go as a metric [02:25:36] makes sense yeah that's what i told you just wait we are going to cover that if we still have [02:25:47] we can but anyhow no problem [02:25:49] sure enough [02:25:52] I still have [02:25:53] Aditya you have raised [02:25:57] so I'm going [02:25:59] to lower over [02:26:00] and be cash [02:26:02] so that I will not get disturbed [02:26:05] so allow mic for Aditya [02:26:07] yes Aditya [02:26:08] Aditya if you have any query you can unmute and [02:26:17] ask [02:26:19] ok thank you [02:26:27] so now these are all the categories [02:26:31] all these times what we have seen [02:26:33] is this example add [02:26:36] now these are all the only [02:26:39] instruction categories that we have [02:26:41] known a lot [02:26:43] sorry I'll allow you and I'll [02:26:46] take your quick question just [02:26:47] be a little quick [02:26:48] good evening sir [02:26:52] so basically I have this question [02:26:55] when you are showing the things like [02:26:57] 32 bit instruction even if [02:26:59] the operating system supports [02:27:01] 64 bit underlying the hood [02:27:03] it will be 32 bit so why is it basically only the 32 bit not uh comparatively to the operating [02:27:09] system of 64 bit okay great question see the operating system is operating over the hardware [02:27:22] and cpu's job is only to process operating system is not dealing only with cpu [02:27:30] it has to deal with memory [02:27:32] it has to deal with hard disk [02:27:34] it has to deal with your Bluetooth [02:27:36] it has to deal with your network interface card [02:27:39] it has to deal with [02:27:40] whatever you have in your system [02:27:42] but CPU's job [02:27:45] is only processing [02:27:46] and this is one of the [02:27:48] connect point to your operating system [02:27:51] so it does not [02:27:53] require 64 bit [02:27:54] and most of the thing is being processed [02:27:57] by CPU [02:27:58] so 32-bit is sufficient. [02:28:01] If you look at the communication of other interfaces, [02:28:06] some of them are having only one bit, [02:28:11] either zero or one. [02:28:12] So it depends on the type of communication [02:28:14] and the type of output what you are going to produce. [02:28:17] That is how it works. [02:28:19] So it has to deal with so many... [02:28:21] The moment CPU gives the result, [02:28:23] it is supposed to give it to the screen. [02:28:26] Where is the screen? [02:28:26] screen is connected to the input output modular so it is supposed to give it to the iowa controller [02:28:35] which will give operating system will give so that means it has to do more work than cpu [02:28:41] so it has been provided with more instructional pixels [02:28:49] yeah sir the other question would be like even if even in today's modern computer as well where [02:28:54] we are supporting most of the operating system are of 64 bit and as we know the hardware has [02:29:00] also been upgraded and it is more efficient nowadays even in today's scenario it is the [02:29:06] cpus are of 32 bit yeah that is right when you get operating system 128 bit then probably we'll [02:29:13] think about making cpu 64. okay so so basically if that means uh the instruction uh the instruction [02:29:22] length would be of 32 bit right for the uh that is received by the cpu that is right [02:29:29] and so there is another one very small doubt regarding this cache thing uh which i'm not able [02:29:34] to i know i have some references but i'm not able to get the clear picture like l1 cache l2 cache [02:29:40] and l3 cache because as far as i uh understood properly it is like any uh any instruction that [02:29:47] has been given by the control signal it would be like going to the registered only if there are no [02:29:55] spaces left in the register then the cache will be used i is that the right so [02:30:02] okay if that is the case then why l1 cache is split into two yes that is what i'm asking is [02:30:11] it directly going to register or is it something we are using like it'll go okay hold on hold on [02:30:17] from register to cache to four register is only a temporary storage like your ram okay cool [02:30:40] but sir i'm i'm actually i'm not able to connect the dots regarding that [02:30:46] register cache because from memory to register or cache it is clear how is it transferring from [02:30:53] secondary to primary memory and from primary memory to like this thing from register cache [02:30:59] these are confusing a bit i'm confused because sometimes as you said in the one of the thing [02:31:05] like if any core is processing and register doesn't have enough spaces we'll be sorry [02:31:12] just hold on are you in front of your screen yes sir okay now are you able to see the key components [02:31:19] of cpu yes sir where is your register registers are with under the course [02:31:29] Where is your cache? [02:31:34] Cache is with like below core 2 and core 3 you have L1 cache and L1 cache. [02:31:42] It is outside of the core? [02:31:45] Yes. [02:31:47] So now where will core get the instruction from? [02:31:51] Okay, it will get the instruction from cache. [02:31:54] Is it clear? [02:31:56] Okay, so yeah, it's clear. [02:31:58] that's great thank you thank you sir hi so aditya you have raised again so do you want me to give [02:32:07] you an access because the last time you said you're good and you lowered your hand so yes [02:32:20] quickly aditya yeah i have little doubt related to like this os related things you will go through [02:32:27] cpu side only like gpu related like if we some transfer forming over gpu so if something hardware [02:32:35] related access or something it will come it will go via cpu to os or how it will be like this is cpu [02:32:44] okay as the second part of this course we are going to look at the operating system functionality [02:32:52] also definitely i will address it in detail there but for your understanding cpu is a different [02:33:01] component and gpu is a different component whatever is getting processed in the gpu [02:33:08] need not be processed by the cpu because the cpu is slower and we require a higher processing [02:33:16] capability we get a component called gpu so now which instruction goes to cpu which instruction [02:33:24] goes to gpu is clear to the control unit so accordingly it will send to either cpu or gpu [02:33:33] and the return path is also through that only your gaming application will go through gpu [02:33:40] only it doesn't require cpu and gpu is an another form of cpu with a higher capacity and ability [02:33:48] are we good okay so like os does all the scheduling so like gpu like the it can [02:33:56] schedule over gpu over also directly something yeah yeah yeah see okay you want to know the [02:34:03] sequence of it [02:34:04] we will see that in the [02:34:09] operating system [02:34:10] definitely we'll do that [02:34:14] because if I get there then [02:34:17] we will lose more time [02:34:18] okay [02:34:20] we'll see [02:34:23] two hands up okay fine [02:34:25] thank you Gyan [02:34:29] has put through that [02:34:30] can go through [02:34:33] Fine. So now, the categories of instructions. [02:34:37] Asunil, I'll come back to you. [02:34:39] We have categories of instructions. [02:34:41] One of the categories is what we were discussing until now, that is addition. [02:34:46] So this comes under arithmetic and logic. [02:34:49] So that means there are more categories available, yes. [02:34:53] The categories is not only about ALU. [02:34:56] There are categories for data transfer. [02:34:58] There are categories for control flow. [02:35:00] you can use conditions [02:35:02] and there is machine control [02:35:04] you want to haul to the CPU [02:35:07] you can do that [02:35:08] CPU won't process anything more [02:35:11] so these are all the [02:35:13] instruction categories that is [02:35:14] frequently used is something that I have [02:35:16] put across, again it doesn't [02:35:19] mean that only these many categories are [02:35:20] these many instructions [02:35:21] each category will have at least another half a dozen [02:35:25] instructions [02:35:25] so for example data transfer, load [02:35:29] Load means what? [02:35:31] You are asking to open the Word document. [02:35:35] So the first thing is it has to load it into the memory. [02:35:38] Where is that instruction? [02:35:41] Even if it has to be loaded to the memory, [02:35:44] it will be processed by the CPU [02:35:46] and then it will be available into the memory. [02:35:49] So that's why CPU and memory have a direct access to each other. [02:35:54] So that time, the instruction, the first six digits, [02:35:57] will have LW [02:36:00] wherein the binary opcode is [02:36:01] 1 0 0 0 0 1 1 [02:36:04] but if you want [02:36:06] to move, code is different [02:36:08] if you want [02:36:10] an addition, there are [02:36:12] two codes in that, let us focus [02:36:14] only on opcode, it's full [02:36:16] 0, that is why in our example [02:36:18] if you look at it, all the codes are 0 [02:36:20] this is the most [02:36:22] frequently used [02:36:23] coming up, if you are using [02:36:26] excel you know like you'll be using 10 times summing up probably two times difference that's [02:36:33] why it is on top now you also can do a bitwise now control flow jump you have cues in the [02:36:45] program counter you wanted to prioritize you can give jump that is true a program with millions of [02:36:56] lines of code is never sent to the cpu all at once only one instruction per cpu if you really [02:37:06] want to understand how that code works you need to understand three more layers your code is in [02:37:13] the application layer the code will be compiled by an another application the compiled code is going [02:37:24] to run in an operating system the operating system first needs to understand what it is [02:37:30] then it will do its own splitting and give it to the control unit and control unit is going to give [02:37:36] only instruction if you have i'm not sure who is going to write millions of lines of code in today's [02:37:43] world where we are speaking about microservices and contents and in one of the largest project [02:37:52] that I have worked in my career [02:37:53] for a micro service, [02:37:56] we did not have more than 8,000 lines. [02:38:00] That was the standard we maintained [02:38:01] because we wanted to [02:38:03] have the end user experience [02:38:06] the highest for that bank. [02:38:08] And their transactions, [02:38:10] they were transacting at least [02:38:12] 8,000 transactions per millisecond. [02:38:16] So if I have to do that, [02:38:17] I cannot have the code running so long. [02:38:19] so millions of lines of code is not the way we write code today 8000 10,000 lines if you get [02:38:29] then definitely the architect is going to come and look back at your code or he will look back [02:38:36] at the architecture okay cool so guys we discussed yesterday i think you should start using prompts [02:38:57] that will give you a better answer than me also. [02:39:02] Okay, so we have different categories of instructions [02:39:04] and each category of instruction has different code. [02:39:09] So based on the code, [02:39:10] only it is going to decide which unit it is going to use. [02:39:16] And that is the reason the instruction goes to the CPU core first. [02:39:20] And from there, it is using all other units [02:39:23] that is available within the CPU. [02:39:25] tpu is not a single unit it is made of multiple units [02:39:29] it's just the architectural difference xh6 is your intel [02:39:37] so mips probably you can you can at a very high level say macintosh [02:39:43] and we also have risk cyscs all those things [02:39:47] um when you are we will speak about it when we are speaking about it in the next session [02:39:56] but at this point of time you understand that there are two different [02:40:01] is what is isa we saw it in the last session so the reference isa is xxxx so definitely we will [02:40:13] understand that more so here if we are good with there are different types of categories and each [02:40:19] category has its own list of instructions that can go to the cpu core and based on the category [02:40:28] based on the instruction it will decide to which it is targeting which hardware block it is [02:40:36] targeting and i just given the sample codes for you to understand and it would be better if you [02:40:42] try to expand this table [02:40:44] to the whole table and see [02:40:46] what you are able to make it out. [02:40:49] And I'm telling you, [02:40:51] this is very interesting, [02:40:53] but from our perspective, [02:40:55] we just need to [02:40:56] understand the flow. [02:40:59] Unless you are a system administrator [02:41:01] or a system architect, [02:41:02] you need not have to go beyond this [02:41:05] level. [02:41:06] Okay, perfect. [02:41:09] Now this is the [02:41:10] four-phase instructional cycle. [02:41:14] For this program, there are [02:41:17] four phases that it is going to go through. One is the [02:41:19] fetch. This is from RAM to IR. [02:41:24] So, the address of the [02:41:26] next instruction is in the PS. How it works? [02:41:30] Current is IR. The next [02:41:32] is in PC. The instruction is read [02:41:35] from the memory and loaded into the IR. [02:41:37] The PC is incremented to point [02:41:41] PC will not have the instruction. [02:41:44] PC will have the location where the next instruction is there. [02:41:49] So the communication is between only RAM and IR. [02:41:53] But IR will get to know which part of RAM I need to read to get my next instruction. [02:42:01] That is how it works. [02:42:03] So hardware, program counter for the next instruction, [02:42:08] it also communicates with MAR MDR. [02:42:10] and IR is [02:42:12] the fetch process. [02:42:18] IR will run the [02:42:19] current process. [02:42:22] Decode is the second. [02:42:24] That is done by the [02:42:26] control unit. It splits. [02:42:28] Read R1, read R2, [02:42:30] select ALU, that is [02:42:31] add. So the verb [02:42:34] that it is using, ADD, [02:42:36] will get converted into binary of [02:42:37] six zeros. That it [02:42:39] decides where it goes. It will go to [02:42:41] ALU. If [02:42:43] Control unit wants to use ALU, it will give. [02:42:47] There are set of commands that goes to ALU. [02:42:51] SUB is also subtraction, it will go to ALU. [02:42:55] So you can get the list. [02:42:58] You can get the list from every depth for all the categories. [02:43:03] And you can see that. [02:43:05] And execute is the execute phase. [02:43:08] if you look at it [02:43:10] execution is not happening [02:43:12] in the control unit [02:43:13] it is not happening in the IR registers [02:43:16] it is actually happening [02:43:18] in the units that the core has [02:43:20] here in this example [02:43:22] the actual execution is happening [02:43:24] with the arithmetic and logical unit [02:43:26] and that execution [02:43:28] only will give you the result [02:43:29] and if you look at how it works [02:43:31] the result is sent to the destination register [02:43:34] that is R3 [02:43:36] via the internal buses. [02:43:40] So, IR is only holding the instruction [02:43:44] that is currently getting processed. [02:43:47] It is not processing anything. [02:43:50] And right back, the result has to be given, right? [02:43:54] So, this is the four-phase it follows. [02:43:57] In the right back, [02:43:59] basically the ALU is returned back to the destination register [02:44:02] and CPU is now ready to fetch the next instruction. [02:44:07] The moment result goes, [02:44:09] CPU is cleared, [02:44:11] that particular core, [02:44:13] it is ready to fetch. [02:44:15] So if you have million lines of code, [02:44:17] let me take this example only. [02:44:19] That million lines of code will be split into [02:44:21] 10 million instructions [02:44:23] and 10 million instructions will be [02:44:25] put into the queue. [02:44:28] Now, the queue will be in the RAM [02:44:30] and CPU will process one by one. [02:44:34] So how much time it is going to process [02:44:36] a 10 million request [02:44:38] depends on how many cores you have, [02:44:41] what is the capacity of the core. [02:44:44] But instruction is going to be 32-bit only. [02:44:49] And how fast it does [02:44:50] depends on the generation of your processor also. [02:44:55] So, but it will go through these four phases. [02:45:00] generally when it enters control unit it is instruction wise you write a program for adding [02:45:10] two integers it will get split into at least three instructions minimum minimum three instructions [02:45:20] it will it has to transfer the data it has to calculate the data it has to give back [02:45:26] that's how it works [02:45:31] so this instruction cycle repeats [02:45:34] for every instruction in a program [02:45:36] if your program has [02:45:38] 30 million instructions [02:45:40] then 30 million instructions will be [02:45:43] in the queue to get processed [02:45:44] so probably you might [02:45:47] get the result after 3 minutes [02:45:48] that is where you see [02:45:50] the performance [02:45:51] ok cool [02:45:55] so this is the real world [02:45:59] scenario [02:46:00] I have given 2 scenarios [02:46:02] one is calculator i've given the entire process how it gets the calculator is a program basically [02:46:11] adding two numbers in calculator it's not about only two numbers you can add three numbers it [02:46:17] can add five numbers now this is how it gets translated into the calculator program this [02:46:26] program gets here you see load r1 that is the first instruction i told you minimum three but [02:46:34] in this case if you look at it there are five assume that we want to store it in a hard disk [02:46:42] 10 instructions will increase all you said is 25 plus 30 is equal to but how many instruction is [02:46:53] going. You are not storing anywhere. [02:46:55] How many instructions? Five instructions. [02:46:57] These five instructions will go into [02:46:59] registers one by one. [02:47:01] Then it will get done. [02:47:03] CPU registers will receive. [02:47:05] Give it to RAM. It will get displayed. [02:47:10] Tuck, tuck, tuck, tuck, tuck. [02:47:11] It will process. [02:47:14] And you can see [02:47:18] how many instructions are going for one [02:47:19] A plus B. [02:47:24] And I have also [02:47:24] given another scenario. [02:47:26] ATM withdrawal. [02:47:28] how does the cpu do it yeah if you are pretty much aware of coding yes we can do and all this [02:47:42] multi-threading and all is done only by the program it is not designed in hardware it's a [02:47:52] design of a software okay so this is the scenario so all i want you to do is i want you to build [02:48:00] this scenario [02:48:01] like this. [02:48:06] We are going to meet next week. [02:48:09] And if you can make this [02:48:10] split for this [02:48:12] scenario, then you have understood [02:48:15] the subject. [02:48:17] Don't worry about whether it is right or wrong. [02:48:20] What is important is whether [02:48:21] you are able to place the right thing on the right [02:48:23] stuff. [02:48:27] The scenario is ATM withdrawal. How does [02:48:29] the CPU do it? [02:48:31] At the end of the day, everything is an instruction done by [02:48:33] the cpu within this atm machine there is a cpu it does all the calculation and sends only the [02:48:42] information over the network to the server server is not doing any calculations within the [02:48:49] atm so that's why if the connectivity is not there you are not able to withdraw because [02:48:57] it is not authorized to it is authorized only to process it is not authorized to dispense [02:49:05] so result it cannot give [02:49:07] to you, it can give only to the server [02:49:10] so [02:49:13] this is the scenario [02:49:15] and this is [02:49:18] what is an [02:49:19] assignment for you [02:49:22] but today it has nothing to do [02:49:24] with assignment 1 [02:49:25] so if you can make this [02:49:29] then you are good [02:49:31] for all the topics that we have [02:49:33] covered until today [02:49:34] I need to check [02:49:42] I have not gone through the whole [02:49:44] stuff [02:49:46] it should be there [02:49:48] I think if you are referring to the pattern [02:49:51] recognition [02:49:52] that's fine [02:49:55] so I understand you will have other [02:49:57] classes as well, perfectly fine [02:49:59] you can log off if you don't have any questions [02:50:01] if you have questions and don't have [02:50:03] a class again, I will be [02:50:05] available for another couple [02:50:07] of minutes, yes Aditya [02:50:09] I am loving your mic [02:50:13] Sir, one doubt I have, like these Intel different processors they released. [02:50:18] Now they were telling something Intel G1 6400. [02:50:22] So like these improvements they do by just increasing a number of cores [02:50:26] or any specific task related they do. [02:50:31] Like I am from telecom background. [02:50:34] So they were telling something like RAN or telecom related things [02:50:39] like for those purposes [02:50:41] this processor they will be [02:50:43] releasing so like [02:50:45] how it is related to [02:50:47] this specific task [02:50:49] these processors [02:50:51] the processors are [02:50:53] generally designed [02:50:55] upgraded new [02:50:57] comes only on [02:50:59] their ability and [02:51:01] capacity it has [02:51:03] nothing to do whether it [02:51:05] is for telecom or whether it is for [02:51:07] finance or whether it is for [02:51:09] Logistics are airports. [02:51:12] Processors are processors. [02:51:14] There are special processors available. [02:51:17] Something like GPU. [02:51:20] So it will have a different instructional set. [02:51:23] It will have a different instructional pattern. [02:51:29] But otherwise, processors are processors. [02:51:32] It is all the same. [02:51:34] Yeah, but like they were telling something, [02:51:36] geon 640 like a rickson ujs these will be used by nokia like that they were a specific vendor [02:51:43] they were naming so i was confused at that time how it is related with that uh which phone are [02:51:49] you using i am using pixels google pixels what operating system it is running it is on android [02:51:59] now that android os it is okay if i'm using a samsung what operating system it is using [02:52:06] Samsung is also Android only. [02:52:09] iPhone it is on Mac. [02:52:12] Okay. [02:52:13] Is my operating system and your operating system same? [02:52:16] No. [02:52:19] For your Android phone it will be same. [02:52:22] I am using Samsung. [02:52:24] You are using... [02:52:25] Then it will be same. [02:52:26] No, it is not the same operating system. [02:52:29] Because Samsung will customize. [02:52:32] Android is open source. [02:52:33] You are aware, right? [02:52:35] Mm-hmm. [02:52:36] So I will modify the code. [02:52:38] I get the code, I will modify. [02:52:41] The instructions that what I am giving, I can modify. [02:52:44] Google can modify the Android. [02:52:47] So how can it be the same? [02:52:49] So the way the Google handles calls, the way the Samsung handle calls, it might be different. [02:52:56] It may be same also. [02:52:57] But like Android releases their version, something like C15, C16. [02:53:01] So those updates, every mobile get and same update, everyone get. [02:53:06] So it is related to... [02:53:08] No, hold on. [02:53:10] Getting a next Android version [02:53:12] doesn't mean that [02:53:14] Samsung has to upgrade. [02:53:16] If they want to upgrade, they will upgrade. [02:53:20] If they don't want, they will ignore. [02:53:24] When you receive an upgrade for the Samsung [02:53:25] phone, you will receive [02:53:27] the upgrade for Samsung [02:53:29] from Samsung. [02:53:31] For Samsung, from Samsung. [02:53:34] You will not... [02:53:35] Just because Android C17 is received, [02:53:37] can you update that into your samsung phone will samsung allow yeah so basically what i am trying [02:53:49] to say here is it is customized by the vendors so you have to use you have to use the vendor [02:53:58] operating system see i don't have any clue about what you are talking about in the telecom [02:54:04] but all i can tell you my understanding is the vendors might have customized it and they might [02:54:10] have named it so if you can tell me what it is exactly i can do some research and tell you [02:54:16] but i have also told you how to research so you can also get it done but to me it looks like [02:54:24] it is customized and you can give any name no normal culture is our pro i can modify the android [02:54:32] and i can say like any name only thing is i am not supposed to sell it i will give my own series [02:54:40] Samsung gives its own series [02:54:42] right for its operating system [02:54:44] and Google gives its [02:54:46] own series for its operating system [02:54:48] both doesn't match [02:54:52] so to me [02:54:54] it looks like so but if you want [02:54:56] me to do some research you please give me information [02:54:58] I can do some research [02:55:00] and I can tell you what exactly is it [02:55:02] or you can also try [02:55:04] yourself I told you how to do that [02:55:06] I will make some points like [02:55:08] what points [02:55:10] city will cover in this process next class i will ask no but you need to you need to give me the [02:55:18] information so that i can do offline research before i can tell you something aditya i'm not [02:55:23] the person i know everything in this world i can answer everything that is something nobody is [02:55:30] so yes i have worked in telecom domain but i'm not a telecom expert are we good [02:55:43] yeah [02:55:44] okay guys [02:55:46] thank you very much [02:55:47] I will upload this [02:55:49] and assignments also [02:55:50] I will be uploading [02:55:51] the assignment one [02:55:53] and [02:55:54] then [02:55:57] we will [02:55:59] basically [02:56:01] meet next week [02:56:03] and take it further [02:56:04] thank you very much