Transcript for:
CPU Fundamentals and Architecture

hello everybody so today we are going to be looking at what affects the performance of the cpu so first of all we need to understand what is the cpu so cpu stands for central processing unit and that's a common mistake that people make that because people often think that the c stands for computer but we know that it doesn't stands for central and they can't ask that on your exam they might sometimes get you to fill in the gaps and the blanks things like that and you don't want to fill in one of those wrong because it's a very easy mark that you don't want to lose okay so in terms of what the cpu actually does well yeah it actually does billions of what we call the fetch decode execute cycle and we're going to go into more detail about that in just a moment now in terms of where these instructions come from they can come from input devices like your mouse or your keyboard for example or it could be program instructions so the the open programs that you currently got running how did the cpu and ram work together now i've put in brackets their main memory because ram is main memory and you can use those terms interchangeably in your exam it doesn't matter you can you wouldn't lose the mark for using ram rather than main memory and vice versa so the cpu will fetch the instructions from ram that's the proper word for it because that's the f and the fde cycle it will then bring that instruction back to the cpu the cpu will then decode it which is obviously the d in fda once it knows what the instruction is it will then execute that instruction and that doesn't mean to execute it not that kind of execution to carry out that instruction okay and that is the fte cycle which it will just keep on repeating billions of times in one second now when it comes to the performance of the cpu and how well it carries out those fde cycles every second the easy way to remember it are the three c's and the first one is the clock speeds which we're going to talk about in a moment next one is cause and finally it's the cache so your clock speed is measured in what we call hertz but common up-to-date cpus you won't often see just hurts you obviously you're going to be looking at something like in gigahertz so a typical clock speed would be something like this 3.5 gigahertz okay so the g being the giga but we still got hurt in there now what that actually means is 3.5 billion instructions per second per second is actually really important okay so the higher that clock speed if that was a higher number you would be able to carry out more fte cycles per second okay the next thing that affects the performance are the cores so a cpu can have multiple cores and if you were explaining uh why that might affect the performance you could say that each core works independently so let's have a look at some examples combining what we know about clock speed now and the cause so here here's an example of a cpu 3.2 gigahertz dual core okay so when we see the word dual it means it's got two cores okay so we've got 3.2 gigahertz which we know is 3.2 billion but then because it's dual core it can do up to two times that amount so 3.2 times by 2 or multiplied by 2 will give you 6.4 billion instructions per second let's have a look at one more example so here's 3.5 gigahertz quad core so we're going to do 3.5 multiplied by four this time and you can think of quads being like a quad bike with four wheels it's an easy way to remember it so 3.5 times by 4 will give you 14 billion instructions per second and the final thing that will affect the performance of the cpu is the cache so cache holds frequently used instructions and it's located on the cpu it has much faster access to cash than main memory too much cash could be detrimental to the overall performance so some cash memory is good because it does you do have faster access to cash than main memory and that will speed up the performance of the cpu so just to finish this session i wanted to just put some example questions that you can have a little practice of so it's probably a good idea if you want to pause the video now the best way to revise with these kind of questions is try and not rewind the video and try and not look back at any notes inside your book that you may have been making as you were going i want you to try these questions and then check your answers and if you've made any mistakes don't worry about it you can just try it again and that's the whole point when you you keep on trying and answering those questions that's how you will embed that knowledge so today we are going to be having a look at what is an embedded system before we have a look at what is an embedded system we do need to understand what is a computer first so a computer is any programmable machine or electronic device which takes in data processes it and then outputs the results so this is that model the input process output model that we've probably heard of before importantly as well computers are general purpose now when we say general purpose it means that you can have multiple programs installed onto the computer and you can access them you can use the computers for different reasons so that is what is meant by general purpose an embedded system is similar to a computer however it's kind of the opposite so if you're gonna answer a question about what is an embedded system you could quite simply say it is a system that is built into a larger machine that's accepted on the mark scheme and not as a separate answer but something you can add on to your answer you can say that they are built for one purpose and a good thing about an embedded system is once it's been made it doesn't need updating for whichever machine that it's built into so all of the components of the embedded system are usually built into a single circuit board and we're going to look at a few examples now so the first example is a washing machine and this is top of the list on the mark scheme as well so if you think of a washing machine and if you were going to open it up which i wouldn't recommend you've got buttons on the front of your washing machine and inside you've got a single circuit board these buttons will interact with and these buttons can do different things such as starting your wash it could be to to change the temperature it could be to cancel the wash and so on and all of these will interact with that single circuit board that is being built into this larger machine other examples include a microwave or a microwave if you're nigella lawson got a toaster notice that all these are kitchen appliances by the way apart from this you unless you use that in the kitchen you've got a calculator but there are loads more so if you're trying to think of some examples in your exam think kitchen it's probably the easiest way to remember here are some example questions that you can practice i would recommend pausing the video now and giving them a go don't forget try and not look back at any notes that you've got in your book or try and not rewind the video give them a go first and then you can go back and see if you got them ready in this session we're going to be looking at what are the main parts of the cpu and a little bit later in the session we're going to be looking at what's known as von neumann architecture which is less confusing than it sounds so we need to understand that cpu has three main parts and these are the control units the arithmetic and logic units and finally the cache so we're going to start by talking about the control units now the control unit manages the actual fde cycle which we've talked about before so it manages the the fetching of the instruction itself once it's fetched it and brought it back it will then decode that instruction and it will execute the instruction which as we know are the three main steps that are repeated billions of times in one second in the fde cycle so if data needs to be moved around the cpu or maybe moved back into main memory then the control unit is the part of the cpu which will actually do that the next part of the cpu is the arithmetic and logic units if you remember what that one stands for then you'll be able to remember what it does really because you've got the wording in the title itself the arithmetic part of it so it does all of the calculations and it performs logic operations such as and or and not now we'll do a completely separate video on boolean operators and what logic gates and circuits look like uh but all you need to know for now is that the the the arithmetic logic unit does all the calculations and it does perform the logic operations there has been questions in the past where you had to fill in the blanks you had to fill in what these letters stood for so it is worth understanding that the alu does stand for arithmetic logic units in case you are asked to fill in the blanks so once the alu has performed a calculation it then has another part in it which you can see there called the accumulator and the accumulator will actually store the results of the calculations themselves and this is one of the registers of the cpu and finally we've got cash now we have mentioned cash in the previous video and the main the main definition that we understood last time was that it stores frequently used instructions so when the fte cycle is being carried out the cpu will actually check cash to see if the date is there first if it's not in cash then it'll go to ram to fetch it basically now one thing that we didn't mention last time was that there are different levels of cash so level one is the fastest and because it's so fast it does have the lowest amount of storage as well and it kind of follows that pattern so level two is not as fast but then it can hold more data and finally we've got level three again even slower but it can hold the most data out of the three levels of cache but your main thing that you need to know from cache that is stores frequently used instructions so they're the three main parts of the cpu but now we're going to look at what's von neumann architecture okay so put together this diagram which hopefully makes it nice and simple to understand so in terms of what von neumann architecture actually is it's a system where the cpu runs programs that are stored in memory so as we know the fte cycle gets carried out billions of times in one second and that's where the cpu will fetch instructions that are in memory now the other parts that you can see in this diagram are the registers which will actually help this process take place so the program count keeps track of what instruction that it's up to and we'll just increase every fde cycle that's carried out and it will pass that number to the memory address register so let's say it was up instruction number one it will pass that number one to the memory address register now the cpu at that point knows that it needs to look in memory address register one which is in ram or main memory so at that point it will do the fetch part of this cycle where it travels down to ram and it will fetch whatever's in memory address one and it will bring it back and it will store it in the memory data register now at that point going back to what the control unit does it will actually decode that instruction and find out what it is that needs to happen so it might be that it needs to perform a calculation or it might be that it needs to move somewhere else in memory and the control unit will make that happen that's the execution part of it if it was a calculation the alu or the arithmetic logic unit will carry out that calculation and then temporarily store it in the accumulator the process just carried out again so the program counter is increased too and it will then start that cycle again where it will then fetch whatever's in memory address register and then it will bring it back to the mdr and the control unit will take care of it will decode that instruction and it will execute whatever needs to happen next so it's a relatively difficult but short topic that people get a little bit confused on but it's actually fairly simple when you think about what what you need to know and we've got some example questions for you to try out so most of these are based on ones that we've had in the past and try and not look back in your notes when you're answering these and pause the video and then you can go back and check and see if you've got them right the repetition of this is what will make this topic much easier especially when it comes to thinking of the different registers and what their purpose are in with the cpu okay that's it for this session see you next time