 on digital circuits. We shall not be able to do much of digital circuits, so we will learn a bit of Boolean algebra in the last two lectures, 39th and 40th, but the basics only. All we have seen is that a diode as well as a transistor can act as a switch and a diode circuit is, if you have a diode like this, with let us say a resistance and a battery, let us say 5 volt battery and some resistance R sub C, then we have shown in the previous class that if this is high, if this is high, higher than 5 volt, then this will also be high. Whereas if this is low, that is less than 5 volt, then this diode shall conduct and this diode is ideal, there shall be 0 volt drop and that shall also be low. The high level, the high level is characterized by a digital or Boolean 1 and low level is given the status of Boolean 0, logic 0, 1 and 0. There are philosophical interpretations of this. In fact, the Boolean logic arose in philosophy to start with Western philosophy. One is for true, 0 is for not true or false. But in our context, since a circuit is either on or off, that is the voltage level at every, at each point in the digital circuit is either high or low. If it is high, it is termed status 1, if it is low, it is termed status 0. The low level, the low level can have a range, can have a range of let us say 0 to 0.6. The high level can also have a range, may be between 4 and 5.5. And therefore exact level is not important. What is important is whether it is high or low. In a similar manner, if we take a transistor circuit, a transistor, then you know that if VBE, if this voltage is high, if this voltage is high, then this voltage shall be low. If this is high, then the transistor will conduct heavily. The collector current will be large and therefore this voltage will be VCC minus the drop in the collector resistance and therefore this voltage shall be low. And if we overdrive the transistor, then we shall be, we shall be operating in this region of transistor characteristics, which is the saturation region. And this voltage is usually taken as 0.2 for silicon. And therefore the low level for a transistor switch is approximately 0.2 volts. On the other hand, if this voltage is low, lower than 0.7 the threshold, then the transistor does not conduct and therefore this voltage, this voltage shall be high. If the transistor does not conduct, then the total VCC shall appear at this output point and therefore the voltage shall be high. You notice that there is an inversion in the transistor circuit. That means if the input is high, output is low. If the input is low, the output is high. And in general, if the input is denoted by the Boolean variable capital A, then the output is the complement of A. That is if this is high, then this is low. If this is low, then this is high. Capital A can take on, a Boolean variable can take on 2 values, either 0 or 1. This is the basis of digital circuits and all that you see in the modern world, whichever work of life you are in, computers are amassed and computers operate with these 2 basic components. There are modifications to make the switching speed, that is from low to high, switching speed large or small. Interconnection lengths also decide whether switching shall occur properly or not. Those are matters of detail and the digital circuits are made in the form of chips, very small. They occupy very small space and therefore they are very popular and the other reason is the accuracy. Accuracy, that is the actual voltage level is not important. What is important is whether it is low or it is high. Naturally, the arithmetic that is to be used for analysis and synthesis of such circuits because there are only 2 levels, 0 and 1, the most eminent kind of mathematics is the binary arithmetic, the binary arithmetic in which there are only 2 digits, namely 0 and 1. Therefore, decimal 0 is 0, decimal 1 is 1, decimal 2 is 1, 0, decimal 3 is 1, 1, decimal 4 shall be 1, 0, 0 and so on. And you know how to convert a given binary number into a decimal number. A given binary number for example 1, 0, 1, 1, what you will do is multiply 1 by 2 to the 0, 1 by 2 to the 1, 0 by 2 to the 2 and 1 by 2 to the 3 and add all of them, that is the binary. Using a decimal number, let us say 235 to convert it into binary, you know what you do, you go on dividing by 2 and note down the remainders, then you arrange the remainders in the reverse fashion. On the other hand, if this is a fraction, that is a 0.235, you go on multiplying by 2 and collect the carries, not remainders, collect the carries. For example, the first multiplication will give a carry of 0, second multiplication also shall give a carry of 0, third one, 1 and therefore this will be 0.001 and so on. For converting a decimal fraction to a binary fraction, the carries are arranged as they appear. On the other hand, if it is an integer number, if it is an integer number, then the remainders are arranged in the reverse order. Okay, these are known to you. Most of the discussion that we are going to do today, in fact are known to you and if we arrange 2 diodes like this, 2 diodes like this and this is connected to plus 5 volt through a resistance R, alright, then obviously there is a ground, there is a ground because voltages have to have 2 terminals. Voltage is a potential difference, it has to have 2 terminals. This 5 volt battery has a ground. Then you see that if the state of this input is called A and if the state of this input is called B, then the state of the output which we shall call C shall be determined by the states of A and B and you see that C shall be high, C shall be high when both A and B are high and this is represented by the so called truth table as you already know represented by the so called truth table and the possibilities are A and B both can be 0, this can be 0, 1, this can be 1, 0 or this can be 1, 1. These are the only 2, only 4 possibilities, alright and C is high only when both are 1, both are 1 so all the rest must be 0 and this in terms of Boolean algebra is represented by C equal to A and B, this is called an AND operation and this is an AND circuit. This is an AND operation and the circuit that you see is an AND and this is usually represented by A dot B, dot stands for the AND operation but for brevity when you have to write it again and again, we usually omit the dot, alright. Even if it is omitted when A and B are written adjacent to each other, it means that A is ANDed with B, alright. This is the AND operation, this is one of the basic logical operations, the second basic logical operation is OR and the circuit is very similar except that the diodes are reversed. The diodes are reversed and there is no battery needed, there is simply a resistance needed, this is C, this is A and this is B and you can see that C shall be high when either A or B is high. When A is high, the diode is a short circuit, this diode is a short circuit irrespective of what this diode is and the high voltage appears across C or when B is a high then this diode conducts, it is a short circuit so the high voltage appears at C. When both of them are high then also it is high but if both of them are low then obviously C shall be at zero potential, that shall be low and therefore the truth table is once again the possibility of the variables are 0 1 1 0 1 1 and the output shall be 1 when either or both are 1 and therefore this is the only situation in which it is 0, all others are 1 and in terms of Boolean algebra, this operation is represented by the plus sign, now we cannot omit the plus sign okay, this plus stands for logical or operation, so it is A or B, A or B and this is a simple diode logic, usually one does not use diodes to realize such gates, one uses transistors and in various kinds of families, the most popular family at the present time is the MOS family, metal oxide semiconductor which we have not discussed in the class, metal oxide semiconductor because they occupy the least amount of space but as far as speed is concerned, now speed is important here, for example if A is high alright then C is high, suppose from high, suppose from high A is reduced to zero, how quickly C can follow this operation, obviously it cannot, why? How quickly C can follow because if A is high then the diode conduct which means that the, what does diode conduction mean? It means that the space charge barrier, the charges come close together alright, so the diode conduct, as soon as the voltage is withdrawn, the charges cannot receive instantaneously, they take some time alright and this time is the so called, determines the so called speed of operation or the speed of the circuit and in high speed digital computers as they are at the present time diodes, diode logic is out of fashion, diode logic cannot be used. We are using it simply to illustrate the basic circuit to understand the phenomenon of the OR operation and the third basic gate, one is, first is AND, second is OR and the third basic gate is the NOT gate or the inverter which is simply a transistor, a transistor in which in order to make sure that a low voltage, that there is no ambiguity in the low or high operation, what we do is besides R sub C, what we do is we use a resistance here and bias the base negatively alright, maybe 1 volt is good enough alright, so that only when well usually this is also set at the same value as plus V C C alright, we will call this a V B, some voltage V B, then you see this voltage has to, has to overcome the negative voltage in order that the diode conducts alright and as I have already told you, if this is A then this is A bar and this is called a NOT gate or an inverter, one can make a combination of these 3 basic gates that is AND OR AND NOT to be able to derive more complicated gates, you understand why they are called gates because they either allow a high level to pass or they do not allow, so they are called gates, logic gates or digital gates alright, one can make a combination of this, for example if an OR is followed by a NOT, well the operation is NOR alright, have I, yes, pardon me, yes okay, so this kind of a circuit drawing will not be valid in the case of digital circuits, we will have to give symbols, this is why I drew it to be able to create a confusion, this will not, this will not hold in the case of digital circuits, we must draw a symbol, we must indicate the number of inputs, for a NOT gate there is only 1 input and there is 1 output and therefore this type of circuit shall not be valid, our representation, the universal representation or IEEE representation is for an AND gate this is the representation, this is AND to make it specific that this is AND, sometimes a dot is put here, sometimes it is not needed, for an OR gate the input line is carved and the 2 side lines are also carved and there are 2 inputs, this is called an OR gate, so if this is A and this is B then the output is the ANDed form of A and B whereas in the OR operation to make it specific that it is OR, sometimes a plus sign is put but whenever you see this peculiar shape well you know it is an OR and if this is A, this is B then the output is A or B, for a NOT gate 1 input and 1 output and this is usually represented by a triangle, a triangle is used for an amplifier in analog circuits, in digital circuits it represents an inverter, triangle with a dot, this dot represents complementing or inversion alright, a NOR gate shall be represented by an OR to start with, it takes 2 inputs A, B and then an inverter, so this is A or B and this is A or B complement, this is a NOR gate and naturally for a NOR gate the truth table shall be A, B and then A or B complement, it would be simply the complement of the truth table of the OR gate, for example 0 0 shall give you 1, 0 1 shall give you 0, 1 0 shall give you 0 and 1 1 shall give you 0, this is the NOR gate alright, I must mention here that in modern integrated circuits one does not make, the manufacturers do not make all the 3 kinds of gates, they make only a particular company makes only, usually only one kind of gate, it is either NOR or NAND, NAND is NAND followed by a NOR gate and the argument is the logic is that the production of 3 different or 4 different kinds of gates is much more costlier than producing the same gate may be 4 times or 5 times the number because each process step in integrated circuit technology each process step variation costs you a lot of money alright and therefore companies prefer fabrication companies prefer either to manufacture NOR or NAND, however there are companies which manufacture both NOR as well as NAND gates okay and NAND gate as I said is an NAND gate 2 inputs A and B followed by a NOR, this is AB and this is AB bar, this is a NAND gate and the truth table can be written as the complement of the NAND that is 0 0 shall be 1, 0 1 shall be 1, 1 0 obviously shall be 1 and 1 1 shall be 0 okay. If you compare the NOR and the NAND, don't you see a similarity? Yes or no? 0 0 is the same, no there is no similarity, there is no complementarity either NOR and NAND but nevertheless one can realize a NOR function if you have only NAND gates in fact it can be shown and you try this out this must be several tutorial problems in the textbook that given a NAND given any number of NAND gates you can realize any other gate, any other gate including a NOR gate for example if you want to convert a NAND into let's say inverter a NOR gate all that you do is you connect the 2 inputs together alright then this is A and this is AB, is there any other way that I can make it? Is there any other way? I have a NAND gate I want to make an inverter, yes you see only one NAND gate, this is my input A what should I do with the other? One of the ways is I connect it to A, pardon me you have a 1 here then A and 1 is A and pardon me A and 1 is A and 1 is A alright that is it and therefore the output shall be AB this is another way alright there are alternatives also but anyway the point that is interesting is that only one type of gate suffices to realize any other function and before I before I go further let's see the NOR gate the circuit shall be first in OR minus VB and then a NOT is this a NOR or A or B if either is high then this will be high therefore this will be low yeah this is the output shall be A or B complimented given a circuit you must be able to detect what kind of a gate is this, this is a NOR gate alright on the other hand if I want to make a NAND all that I shall have to do is to reverse the 2 diode polarities alright let's see this AB then do I need a negative bias here no I need let me draw the circuit then I will tell you why it is so RB then this require a little bit of little bit of experience to appreciate why it is so and this is connected through a diode the base is connected this is the this is a practical circuit for a NAND gate now why are all these paraphernalia needed why a diode and an RB needed you see when A is when both as I said this is a NAND gate when both A and B are high then the 2 diodes do not conduct alright and therefore VCC through RB and this diode drives the transistor and the output shall be shall be high or low low the output shall be low when A and B are both low when they are both low what happens is both low or one low it does not matter right one of them low then this becomes approximately connected to ground if it is an ideal diode then it is 0 voltage drop if it is non-ideal as is the case in practice if it is a practical diode then there shall be a drop of 0.7 volt now if this diode was not there then this transistor would have conducted because 0.7 is the voltage required here this is why another diode is inserted so that when this voltage is 0.7 this combination requires 1.4 volt to be able to conduct is in the right 0.7 here and 0.7 here so it makes sure this diode you must understand the function of this diode this diode makes sure that when one or both of this both of this diodes conduct that is when A is low or B is low or both are low the transistor does not conduct and the output is indeed high the transistor does not conduct and therefore the output shall be high is the point clear why a diode is needed here it was not needed in the north circuit alright it was not needed in the north circuit so this is a NAND circuit yes yes if the diode was not there and this is low then this would have conducted this diode and because it is a practical diode the drop across it would have been approximately 0.7 and if this drop is 0.7 from here to ground obviously transistor would have conducted we want to make sure that it does not conduct so we put another diode it will require 1.4 volt and for this diode to conduct we require 0.7 and therefore this indeed the diode indeed is needed as an illustration of how a NAND gate can be used to realize any operation any operation can you make an AND out of NAND yes all that you require is another two NAND gates shall be required one is NAND them and then another inversion for an OR circuit for example where what you require is now from now on we shall represent the output of a logic circuit digital circuit as small f alright function if I want the OR operation what I want is that f should be equal to A or B I want to convert this into NAND type of operation so what I do is which we shall do a little later we use De Morgan's theorem what we do is A not A not B then complement alright that is what we shall implement now one NOT gate one NAND shall be required for A bar one for B bar and the third for NAND that is A bar B bar NAND if I can draw them I can draw them very easily what I have is this is A so this is A bar similarly this is B so this is B bar and then I put them together to a third NAND so I shall get A bar B bar whole bar which is equal to A or B similarly try it out how to make other functions well what is the other function left NAND well NAND OR and NOT all the three can be realized by NAND gates similarly try for with NOR try with NOR from NOT to OR is very simple from NOT to N is not difficult either from NOR to NOT nor to NOT how do you do that same as NAND that means you connect the two together there is still another way one of them is to be connected to 0 alright then some terms as are used the computer science boys should be very familiar with this a bit that terminology is used in digital circuits a bit is an abbreviation of binary digit alright this B and IT binary digit 1 or 0 is a bit a word of 4 bits is called a nibble okay and a word of 8 bits is called a byte alright a word of word means a number a binary number consisting of 8 bits if well you understand what you mean by word why by word we mean the number of well it is a binary number it is a binary number and the number of bits making it is called the word length permitted by the ICL system here how many bits are permitted 32 bit okay some standard terminology then some postulates or Boolean algebra postulates and theorems the basic postulates are of course the three operations that means OR and NOT okay OR operation is 0 or 0 is 0 these are the postulate this is what it starts from and you see this can be converted into a digital circuit either it dials or it transistors or combinations 0 or 1 is 1 1 or 0 is 0 and 1 or 1 okay thank you and in end 0 and 0 is 0 0 and 1 is 0 1 and 0 is 0 and 1 and 1 is 0 okay alright in the NOT operation complement of 1 is 0 and the complement of 0 is 1 look very simple but in complicated Boolean expression sometimes one has to refer to this sometimes one has to recall the roots but it is obvious that if I complement a and complement again this should be the original a alright this is the relationship in one variable and if I if I generalize this these postulates these are specific values that we have taken 0 and 1 suppose I take a Boolean variable a which can be either 0 or 1 then its operation with the the two bits that are available that is if we if we OR a with 0 we shall get a okay a with 1 we shall get sure not a okay 1 if we OR a with a we get a and if we OR a with complement of a it is still 1 alright on the other hand if we AND a and 0 it would be 0 a and 1 is a a and a a and a and a and a bar good and NOT operation of course there is only one that is double complement of a is a alright let us take two variables two variables or two or more variables okay two or more variables if we wish to write such rules or such consequences will take a long long list so we group them into rules or laws as they are called one is the commutation rule which says that the order of operation is not important that is whether you OR a with b OR b with a it is not important alright they are identical this is called commutation rule you can bring b first and then OR with a 1 plus 1 OR 0 and 0 OR 1 are the same okay and the other is if you AND a with b the result is the same as b ANDed with a this is commutation rule this is true in ordinary arithmetic also decimal arithmetic also okay commutation then the second rule is association in association rule a OR b OR c there are more than two variables a OR b OR c that is this operation says that b should be OR with c first then OR with a well this happens to be the same as if a is OR with b and then the total is OR with c OR you can make any other combination for example it could be b OR with a instead of a OR with b okay similarly in the case of in the case of AND operation that is a AND b AND c which indicates that b AND c have to be ANDed first and then the result is to be ANDed with a well you can write as a AND b AND c alright this is the rule of association well so far these are all trivial and revisions de Morgan's the third third set of rules is given by the de Morgan's theorem and it states that if you have an OR operation followed by a complementation then this is complementation of the two variables AND and AND operation the two are equal this is one form of de Morgan's theorem you must follow this OR operation is converted to an AND OR is converted to an AND and the result is that both the variables have to be complemented first and the easiest proof of this is by writing the truth table alright easiest proof in fact if you you cannot make a mistake in proof if you go by the truth table but sometimes truth tables are very long to write and things may be obvious we will show examples of this the other is that if a is ANDed with b and the whole thing complemented this is one form of de Morgan's theorem the second is a AND b the result is complemented then this is simply OR operation between complement of a and complement of b once again a AND operation is being converted to OR but complementing is a part of de Morgan's theorem is an inherent part of de Morgan's theorem whenever you want to convert one operation to the other OR operation to AND OR AND operation to OR you must complement okay and de Morgan's theorem without complementation is not valid okay one is to remember this then the fourth set of rules are the absorption rules and these are interesting that is a OR a AND b a OR a AND b is simply equal to a and the proof here is very simple a can be written as a AND 1 and this can be written as a AND b and by how can I do this a AND 1 OR b association distribution which you have not proved yet okay but anyway 1 OR b 1 and therefore this is a and the second distribution law second absorption rule this is one the second follows from this here is an OR operation so you replace this by AND this OR by AND and this AND by OR a AND a OR b is equal to why is it so a AND a is a AND b and a plus a b is a it takes account of the first rule and without distribution the easiest way to prove is to write the truth table if you do not want to take distribution okay if you are barred from using distribution then this is what you do you write the truth table and then the distribution finally you could do distribution earlier distribution rules are again 2 in number that is if you have a AND b OR c you can write this as a AND b OR a AND c exactly like ordinary decimal arithmetic however there is a difference if this is replaced by OR this is first form the second form is this is replaced by OR and this is replaced by AND then this is equal to a OR b AND a OR c and the proof of this easier proof is to go from here to the left if you expand this you get a a a c b a b c a a is a absorption a plus a c is a a plus b a is and therefore this is a is that okay you can have fun there are several problems in the tutorial shift which asks you to prove that the right hand side is equal to left hand side the important thing is why you shall be able to do it blindly if you proceed by truth table but suppose there are 3 variables 3 inputs then how many lines will be there in the truth table 8 4 16 if it is more than 4 then you have had it your one page may not be able to accommodate it it is better to look for simplification and it is important to see which side should you start with and this will come through experience that is if you work out more and more problems now as in analog circuits we can have 2 kinds of problems we can have analysis or we can have synthesis all right logic circuit analysis means given a logic circuit find out the output variable in terms of the input variables exactly that is what we do in analog circuits given an analog circuit find the output in terms of the input or inputs you can have more than one input all right for example in an in a transistor amplifier what do you find out the output consists of 2 parts the ac and the dc there are 2 inputs 1 is the dc where is the dc vcc and the signal all right there are 2 inputs okay so logic circuit analysis means that you want to find the output in terms of the input or inputs all right another another objective of logic circuit analysis is simplification it just does not stop at finding f as a function of let us say the inputs a b c etc etc it does not stop there it is a logic circuit analysis in in this term is implied whether you can simplify the expression that is plus simplification that is one might have an what do you call an immature person immature and immature might have constructed a circuit which can be done with less number of gates and therefore one should look at whether you can simplify this or not and one of the we shall illustrate this by means of a specific problem but you understand the difference between analog circuit analysis and digital circuit analysis logic circuit analysis logic circuit analysis in addition to finding the output variable it also implies whether the output the same output variable could be obtained through the same inputs by a simpler circuit all right an example suppose we have 2 variables a b and we have a series of NAND gates one now I let me tell you what I mean by this and b this means this dot here means that a inversion has occurred to start it for example if I have let us say a and then I apply to an N gate I represent this sometimes it is convenient to represent it not by drawing another gate but by simply doing this which means that the actual input to this gate is complement of a not a all right not a N or T N capital O capital T capital not the English not all right okay so this is this is another gate this is an N gate and the third is now you see I am not bothering to draw these twiddles whenever there is a connection I will show it by means of a big dot like this if there is a crossing like this that means they are not connected to each other because otherwise I will have to draw so many twiddles I do not want to do that all right and the third gate is a similar one but the inversion operation is in b okay all these 3 are brought to an OR gate and this is what is f one can one can very simply see that this is a b complement there is a N gate this output is a bar b is an AND gate with a complemented and this gate is a b bar and therefore f should be simply equal to the OR between these 2 that is a b bar plus a bar b plus a b bar now this is as far as analysis is concerned you have obtained an expression can it be simplified well try this by De Morgan's theorem this is a bar plus b bar then a bar b plus a b bar now you combine these 2 this is a bar and these 2 will give you b bar which you can write as all right and therefore all this is redundant what you could do simply with one N gate isn't that right this is a b bar and therefore all this is redundant this is the work of an amateur and you must look at it all right it is very important for a company that they have expert logic circuit designers because if one is not an expert logic circuit designer the company might go bankrupt all right we shall have a few minutes break before we take the 40th lecture we shall assemble here again at 503 all right.