Lecture 1 – Introduction High Speed Circuit – Design Recursive Doubling

I am trying to make this course [vocalized- noise] as independent as possible to that course but there will be ah some points where you may have to do a little more work to get in phase with what we are trying to teach here ah because your digital course essentially dealt with only logic minimization but logic minimization and some counter design etcetera hardware design but that was actually one fifth of the course of our course ok so so they have learnt ah for fifth more than what ah you have learnt in that course so we will try and bridge the gap but i should tell you that you have to do a little more homework ah to see that these gaps are bridged ok so that is one thing so ah with this as the background ah let me start this course again this course there are three pillars to computer science the one is the ah computer architecture and organisation another course is the operating systems which we will be doing in the fifth semester and then compilers again you will be doing in the fifth fifth or sixth semester depending upon the curriculum ok and these three pillars actually hold key for you to be a good computer science and engineering student computer science is all machine learning all this stuff computer engineering is another ah you know ah suffix added to your degree called engineering and to be a good computer engineer you need to understand these three subjects in great detail so this is the fourth semester course we will be doing this now and then of course the other course and please note that all these three are highly inter related so lot of concepts in organisation will be used in o s and also in compilers ok so so be very attentive in the class and try to understand and the way i have structured the course is that every time i talk about some concept i will also talk about the operating system issue of that and also the compiler issue of that ok and there are lot of books available in the market so ah lot of books will teach you how and what how something is done and what is done but they will fail to teach you why it is done ok there are several reasons for why the books are missing this why part ok but we will not go into that but this course i will be ah basically teaching you why certain things are done what is the rationale behind those things and you have to understand that so that ah you know we make ah best out of it ok and understanding that why is very crucial fine ok ok so when we look at a ah you know the organisation of a system there are five levels in the organisation of the system one is the basic digital hardware on top of it is the what we call as a micro architecture and top of it is the operating system then the compilers then your application software so there are at least five levels that you need to study to understand the system correct now please note that each level is isolator from the remaining path so each level i could call it as a virtual machine so i can say virtual machine one virtual machine two virtual machine three virtual machine four virtual machine and each of this has a language for example the application software is basically written in a high level language like c c plus plus java then there is an assembler which actually converts this high level language into a language that is understandable by the hardware right so so when i look at say hello world dot c this is a high level language program this gets converted to some a dot out the the software involved in this conversion are the compiler and the assembler so from the application software here there is a compiler which actually converts it into an assembly language and there is an assembler which will convert it into zeros and ones so this is the machine language right so there are two translations that happened the first translation is the application software getting compiled into an assembly language program and then the assembly language program getting converted into a machine language so this virtual machine that you see on the top most layer can understand one language which is the high level language the compiler basically takes the high level language and converts it into an assembly language the micro architecture can understand only the assembly language or it can understand only the machine language so there is an interpreter or an assembler which will convert that compiled ah assembly language program into a zeros and one which is the machine language so every machine here the virtual machine here essentially has an input language and an output language or what you call as an input source language and a target language right and so there is some conversion process so when we go from top to bottom the top most layer is the one that is understandable to the human being much understand easily understandable and as we go down the stack it becomes more understandable to the hardware or the machine right so there is a gradual decrement in the obstruction at the highest level i have a very high level of obstruction and as i go down the level of obstruction comes down and finally you land so land up with ones and zeros is your micro architecture will execute intermediately there is one layer called operating systems of ok one layer called operating system so there are certain functionalities which a program cannot directly execute it needs a help of an operating system for example in the hello world you have printf you never write the code for printf so you ask you ask the help of someone and that someone is the operating system so the operating system basically tries to satisfy some of the needs of your application software right for example in the in the assignments that you did you use lot of classes and libraries correct your math library your ah memory allocation libraries so many things that you use in your assignment here correct those we claimed as those are some of the facilities prevailed at you by the operating system right so so the functionalities that are basically done by the operating system and those are the things which are required by the application software right so in this entire organisation we call this as a structured computer organisation so in this structured computer organisation every machine i call it as a virtual machine virtual machine in the sense that the person working at that level for example if i am writing an application software i need not really bother what my who is going to compile my quote what is the underlining architecture so the entire thing below the application software the four layers below the application software is completely hidden to me for me i see a machine which will take a c program and execute how it executes is not my problem right so thats why we have this adjective virtual there right so virtual machine because we are not bothered about the layers below that and so if we take any layer any say for example operating systems so it has an isolation from the other layers so every every layer is completely isolated from the other layer and so and that is the reason why we call each of these layers as a virtual machine ok so now this course essentially talks we can call it as computer architecture and organisation some years before these two were taught as separate courses but there is no point in teaching them as separate courses because if you if you dont understand the underlining architecture then you cannot understand the organisation and vice versa so we and unfortunately our b tech curriculum is so packed that i cannot have two code courses one for organisation and another for architecture correct so what we are trying to do is that we will try and ah try to teach you both in this course right and the way we have structured so first and foremost one fundamental question is what is difference between computer architecture as a subject and computer organisation as a subject right now why did i create this why did i create micro architecture why did i create a digital hardware because somebody wanted it correct if nobody needs it then there is no point in creating it correct and so so who is needing this who is driving this from say a calculator today we are having a mobile phone with eight processes who drove it right the customers now how did the customers so the customers need is reflected to the hardware through what through the software through the compiler through the operating system right the compilers grew in strength the compilers became more complex they started supporting variety of features right they started supporting variety of computational processes just because the user wanted it correct the operating systems started supporting say they it it it is now supporting large amount of memory it is supporting large different functionalities different types of libraries why that what is the need for the operating system to do it because the user wanted it there is some programming environment there is a software requirement there is an information technology requirement which is forcing the user to basically to ask certain functionalities from the underlining programming language and the operating system and if we start asking those things then ultimately your compiler grows and your operating so operating system also grows in terms of the required functionality and those functionalities it has to realise it they are all software right operating system is a software computer compiler is a software and how will they realise that functionality by executing on the hardware so that means they will require some support from the hardware right you understand this right so what are the supports that are needed and how will the operating system and compiler ah you know communicate with the hardware to get that support so two questions we need to answer what are the supports that are needed what support is needed how will the compiler slash o s get that support from the micro architecture these two questions need to be answered answer to these two questions form the subject matter of what we call as computer organisation right we want answer specifically what sort of support the modern operating system is asking the hardware right i can give you lot of examples here right for example if i am looking at a real time system i did define what a real time system is there in the previous right do you remember forgot ok so what is a real time system can you give an example of a real time system versus a normal system when you drive a car there is some electronics that is supporting or breaking system is it a real time system yes right a normal system is one where the correctness of ah execution is determined by if you get a correct result a real time system is one where the correctness of your execution is determined by not only the correct result but also the time at which that result comes right if you break if you apply break the car should stop thats a correct result but then it should stop within the next few seconds then only it is correct now you apply the break and that it doesnt stop within the next few seconds dashes then its not a correct result right you understand so a real time system is one in which the correctness of execution is not just the correctness of the result alone but the time at which that result is manifested ok right so when i start look so suppose i want to design a real time system there is an operating system running there right the operating system responsibility of that software is to see that i give you a service the moment you ask very quickly within the deadline you understand this now when i want to design a real time system how will an so suppose i am putting a computer in a car to basically look at breaking right how will the processor in that computer understand that there is a break that is necessary there is a that it has to act on a breaking routine how will it realise that there is a break that is applied can you give me a mechanism by which it can sir ah sir electric no thats how the break comes up then how will the processor realise it electric signal electric signal electric signal will come and then it will come in the form of so you type you just press the keyboard how will the system realise that the there is an input coming from the keyboard ah then there is some basically there is an interrupt right there is an interrupt that is coming up now in the case of the real time system that interrupt should reach from the time the interrupt comes to the processor ah the time that the processor realises that the interrupt has come right that time what we call as the first response time should be very very fast so when i am designing an architecture an hardware for implementing real time system one of the thing that i need to ensure is there should be a fast interrupt path you are understanding this so because once the interrupt comes i cannot take long time to realise that there is an interrupt so when the interrupt is generated using your piezoelectric or whatever ah when the break is applied the interrupt is generated from the time it is generated till the time the processes starts responding to that right it should be very very very fast right so that is a requirement from the user or the operating system if the operating system says i am responsible for the safe running of this car then it says the hardware re please give me a very fast interrupt response then i should design my architecture in such a way that the interrupt response is fast correct are you able to follow what i am trying to say right so so what sort of support is needed and how will the compiler o s get that support from the micro architecture these are subject matters of computer organisation and i have just told you one such need or support that is needed by the operating system ah in one context of an automotive example now this is also called like you have a p i right what is the expansion of a p i application program application program interface this interface is called a b i application binary interface right now understanding this a p i is the subject matter of computer organisation now that i have understood what are all the support needed right the type of support needed how will i build that support in the underlining hardware how the support is builded how the support is built so this answer to this question is a subject matter of computer architecture ok in my opinion computer organisation cannot be taught as a theory subject ok so computer organisation if you say i am going to teach its a stupid thing in my opinion ok its my strictly my opinion there are n universities and n profs teaching this so i am going to align computer organisation with the lab so the computer organisation will be taught during the lab hours along with the experiments so i will teach something immediately that that evening if you spend that two hours you will finish off then dont bother till next tuesday ok so so every every day we will give you some exercises and ask you to immediately go and implement it and see it for yourself and we are giving you a excellent environment using the most complicated processor ah every ah done in the globe call the a m d or the ah intel platform we will teach you lot of things there of what could be a possible good ah application binary interface and we will make you work on that we have we have spent lot of time in creating that environment will now available i hope all of you bring your laptop and i actually shared ah the links to all of you i hope at least finish the installation and talk about it tomorrow also ok in the theory class i will cover architecture and then relate it to what is happening in the ah organisation ok so we have to answer both these questions in this course so that we get a good understanding of what is computer architecture and organisation ok fair enough ok [FL] now so we will now start with hardware basic digital hardware right now now we will start with the basic unit of operation called addition ok addition and multiplication i will i will teach you one very good adder and a very good multiplier once i once i understand addition automatically you would have understood subtraction but anyway i will cover some basics tomorrow then we will look at some division algorithms ok and then we will also look at the i triple e seven five four floating point representation is also extremely important ok so we will look at these ah floating point operation how floating point division is basically carried out or floating point multiplication is carried out right so we will look at this thing for two weeks we will concentrate on high performance circuit design right ok right so so these are some things which are not covered ah even the it was not covered for the palghats students also so i have not covered in in the foundation system because it is supposed to be covered now ok so we will do this in the next two weeks ok and i will try to make it as interesting as possible ah but it will be interesting so we have some very interesting ah ways of implementation ok now let us start with this very interesting techniques called recursive doubling technique ok i want to find the prefix sum of eight numbers what i mean by prefix sum is so i want zero zero plus one zero plus one minus two zero plus one minus two plus three so this is zero plus one minus two plus three plus seven ok zero plus one plus minus two plus three plus seven plus minus eight and so on ok this is called prefix sum so at the end this will have zero this will have one this will have minus one this will have two this will have nine this will have one this will have seven and this will have ah whatever seven minus fifteen ok ah minus eight ok or vice versa ok i think we could also yeah yeah vice versa see i want minus fifteen i want minus nine i want ah no no this way ok so so if you do this so if i keep summing this i have a zero a zero plus a one a zero plus a one plus a two a zero plus a one plus a two plus a three a zero plus a one plus a two and so on suppose i want to do this ok and i do it one a ah normal system right how much time will it take assuming addition takes one unit of time how much time will this take to add these to get these results ah sir assume this is an array how much time will it take seven seven units of time right now can id o it faster let us assume that i have a processor for each one so i have seven processors available to me can i do it much faster this is a question you are understanding so if i have one processor it is going to take seven units of time i have seven processors can i do it faster you ok so what i do is this is the algorithm very simple algorithm what i do is at every step so at every step i add the number to which i point and make ah this is the first step and second i will i will point to the pointer of of pointer for example i will add this this element will will add six to minus fifteen so that means you get minus nine and it will now point to five pointer of pointer so fifteen minus seven is pointing to six six is pointing to five at the end of the first step it will now point to what five hm it will point to five and similarly what will six do six will add to minus eight so you will minus two and it will now point to four you are understanding this so i will add to whomever i am pointing the content of whomever i am pointing and then i will point to that fellows pointer hm so are you able to follow this previous step so on the first step i will add minus fifteen seven points to six so the content of seven will be added to content of six and stored at seven and now sevens pointer will point now to six pointer similarly six is pointing to five so the content of six will be added to content of five in parallel because i have one one processor for each right so in parallel i will add six to minus eight and now sixth pointer will be pointing to the fifth pointer so six to four and so on you are able to follow yes or no ok now you see so this is the step one after the step one please understand that seven has minus nine ah six has minus two ah this has minus one four has ten three has one and ah you know two has minus one and all and they are pointing so what will be here this will be a a seven plus a six a six plus a five a five plus a four a four plus a three a three plus a two a two plus a one a one plus a zero ok so at the end of my first step i have added a number which is one away from me it every element has added a number one away from it and it is no pointing to a distance of one away from it right so now please note that whatever is the content of this location is a seven plus a six and it is currently pointing to a location which is storing a five plus a four similarly whatever is stored here is a six plus a five and it is currently pointing to a location which is storing a four plus a eight so in the next step what will happen minus nine will get added to minus one right that means what will be stored here it will be seven to four because here it currently it has a seven plus a six and i am pointing to a five plus a four so i will have seven to four what this is having six to five and this is four to three so this will have six to three and this has five to four and two to three so this will have five to two sorry three to two and this will have four to one a four plus a three this stores a four plus a three and this is pointing to a two and this will have ah three to zero and this will have two to zero and this will have always one to zero and this will have zero able to follow right at the end of the next step when i click this that is step two these elements will now store from step because currently it is storing seven to six and it is pointing to five to four now this will become seven to four correct now where will this point to this will point to pointer of this so this will now point to this at the end of when i go to at the end of step two what will what will happen this now will store the values from say a four to a seven sum of a four to a seven and it will now point to what sorry this will now point to thing storing three to zero correct you are able to follow this ok so so let us see whats happening at this end this will store seven to four six to three five to two four to one three to zero two to zero one to zero and zero ok this is at the end of step and the end of step three what will happen this seven to four plus three to zero will become seven to zero six to three plus two to zero will become six to zero five to two plus one to zero plus five to two is pointing to one to zero it doesnt become five to zero four to one plus zero will become four to zero three to zero two to zero one to zero so next step what happens so you will have the answer from all and this is the answer this is the step able to follow this so if i have n processes so at every step i add the number to which i point i add the content of the location to which i point and i make my pointer as pointer of pointer if i keep doing it please note that at the end of a step first step i am pointing to an element which is two power zero away from me and i have added two elements in the end of next step i am pointing to an so so at the first step i am pointing two power zero at the second step at the second step i am pointing ah sorry so this is two power zero at the end of first step i am pointing two elements away from me so this is the two elements if you subtract the index it is two at the end of the second step i am pointing to four elements away from me right so at the end of ah k steps i will be pointing two power k so i stop when two power k is equal to n so that means k is log n so if i have n and note that all the operations i do in parallel correct so every step is done in one unit of time so there are seven processors and each processor in concurrently in parallel just goes and adds to what i am pointing to and then makes my pointer to pointer of pointer are you able to follow so in log n steps i will be in a position to finish off this prefix sum so if i have one process i am going to take n steps but if i have n processors i can do it in log n steps why is this possible because we are doing addition what is addition addition is a associative operation ok since i am doing addition i can do it because i assume that the operation that i am doing is an addition ah is an associative operation if it is not associative then a plus b plus c is not equal to a plus b plus c meaning if plus is a non associative operator if plus is addition then so i can do this for any associative operator please note that this algorithm will not work if i dont have an if the operation that i am defining is not associative correct you got this so i can do this operation i can do prefix min i can do prefix maximum because maximum of a comma b max of max of a comma b comma c is max of a comma max of a b comma c right max of a comma max of b comma c is equal to max of max of a comma b comma c correct so max is an associative operator similarly min so i can do ah similarly multiply ok so i can do prefix i had addition prefix sum prefix maxima prefix minima prefix multiplication ok so we will just stop here so this particular ah concept of what we call as recursive doubling will be used to construct an adder ok and we will see how we are going to do that in tomorrow class ok

As found on Youtube