Transcription
In the name of God, the Most Gracious, the Most Merciful. Peace, mercy, and blessings of God be upon you all. May God give you all good health. Your quality is blessed, O Lord. Lecture number 9, continuing the explanation of Digital Logic material, God Almighty willing. Today, we will continue with the questions we agreed upon last lecture, and also other new questions. As we agreed, God willing, with detail and analysis. All you have to do is focus with me on how I solve for you and how I work with you on the question, step by step, and God willing, you will be satisfied. And the thing you must know is that I do not solve the question for you based solely on it being just this question, so I will solve it for you. Its idea is no, I solve the question for you and what the professor might change in it so that you are prepared from all sides. Okay. We don't want to prolong, so let's say "In the name of God" and continue and start completing the questions for Chapter Four. The first question asks me to look at these design questions. These are very important questions. Oh God, how important they are. I will solve three questions for you now. It says "design systems". It says, "Make me a design for the BCD system." We know the BCD system from zero to nine, right or wrong? The BCD numbers are from zero to nine. Now, after nine, which are A, B, C, D, E, and F, these, we, sorry, F, we cannot represent. I have never solved them for you and put them in a truth table or anything. We did not use them. What do we do with these? We always put them as "don't care." Always remember that the BCD system is only for the highest number, which is nine, from zero to nine. After nine, it becomes "don't care." Okay. And a single output. If that is equal. Single output means you want to make a system with A, B, C, D all as inputs, and it gives you one output, F, that is equal to 1. It says, "Make me a system A, B, C, D such that F always gives a result of 1 when the input BCD number is odd and greater than three." Look what it says. It says, "See how I will break down the question." It says, "Make me a system with inputs A, B, C, and D, in addition to the output F always being 1 when the BCD is odd and also greater than three." What does that mean? It means greater than three. Pay attention, greater than three, not greater than or equal to. Only greater than three. "The function is minimized in a simple form." Look what it said. "Hint: Don't forget to use 'don't care' conditions." A is MSB. First, what is it doing? I say, "Look, at the beginning, I have the BCD system: 0, 1, 2, and 3, 4, 5, 6, 7, 8, and 9. I'm done." First condition, it said it wants the odd numbers. I say, "So take 1, 3, 5, 7, and 9, and all these even numbers, what are you doing? Cross them out. I don't want them. You didn't ask me for them." The second thing, it said they should be greater than three. It means, is three included? No. So cross out 1 and cross out 3. What's left for you? 5, 7, and 9. So, F equals 1 when it's for these three, which are from terms 5, 7, and 9. Where are the don't cares? I say, "The don't cares are 10, 11, 12, 13, 14, and 15, because in the BCD system, we only have up to nine. Everything after that becomes a don't care." Now, the question is finished. Really? Yes, the question is finished. Go ahead and do what? Let's see the recording. Okay, this is better. I say, "Let's make K-maps as follows." I have four inputs, A, B, C, D, meaning 2 to the power of 4 is 16. If I distribute 16 squares, regardless of the drawing, please, I draw quickly. We don't need to plan now. We must finish quickly. 0001, 1110, 0001, 1110. I say, "Okay, what is mentioned, I put a 1, and what is not mentioned, I put a 0." I say, "0, 1, 2, 3, 4, 5, 6, 7, 8, 9, and the rest, I make it all don't care because 10, 11, 12, 13, 14, 15 are don't care." Yes, now you pause for a bit, look, and say, "Let's make an equation." Now, to be able to do it, you have to try to think of a way to make the largest group. I say, "Listen, the 1 and the 1, what is the largest group it forms?" Look, under the two don't cares, meaning if I put a 1 here and a 1 here, I can form a group of four, 100%. So, let me remove the don't care here and put a 1 in its place, and remove the don't care here and put a 1 in its place. I say, "If you covered these ones and closed it like this." Now, what can this 1 do? This 1 and this 1 and this 1. It has a don't care. Remove it and put a 1 in its place. Can you make another group of four like this? Does this benefit me? No, really, zero. Does this benefit me? No, really, zero. And this is zero. Don't come and say, "Why didn't you put a 1 here and a 1 here and make a four?" I make the don't care the largest group based on the original ones I have from the beginning, which are these. And I build on them, not from myself. I can build. Do you understand? There is no group that makes me more than four. That's it. There is only this one, and I build on them. What is this? It's that I take the constant B and the constant D, and I come to this, where the constant A and the constant D remain. So I say, "The design of F is A plus B, taking D as a common factor. Take D as a common factor, and thus I have made the design for this question." Just imagine how far this is. This is the whole idea of the question. Okay. So, we have finished the first design question. Just try when you see design questions to analyze them first, then work on them step by step. Look at this question. Sorry, but let's look at this question. The question looks heavy and dense, but when you see the solution, you will laugh. It says, "Design a four-bit combinational circuit to complement." Focus with me, please. Here it said, "Make me a design for four bits and make it two's complement." And it said, "Take the number." It means you have the inputs as binary, meaning the system is 0 and 1, and the output must be the result. It means you entered a binary input. We know this. When we make a truth table, the output must be a binary result and have two's complement. It says, "Assume the inputs are A, B, C, D, and the outputs are W, X, Y, and Z." What is it asking for? Look, it's asking. It says, "The first step is to find the output X." Someone might say, "I want the output W." Someone might say, "I want the output Y." Someone might say, "Z." All normal, عادي. It will give you anything. Here it asked for one output. Then it says, "The second step is to find the minterms of X." Then you have to find the equation for X. Then it says, "More simplification." It means just simplify it, and simplify, and simplify. It means simplify it three times. I say, "Okay, you're welcome. Now what do you have to do?" It's my job to work. Look what I'm going to do. First, here's A, B, and here's C, D, and here's X, W, sorry, W, X, Y, and Z. What am I going to do? I'm going to enter the inputs and give them outputs. Here's 0, 1, 0, 1. Of course, there are 16 possibilities. 8, 10, 12, 14, two, and two, and two, right? 2, 4, 6, 8, 10, 2, 4, 6, 8, 10, 12, 14, 16 possibilities. Then I'll fill in here: four zeros, four ones, four zeros, four ones. And here I'll put eight zeros, then eight ones. The output is the two's complement of this. You'll say, "Man, God, how much we've said it, and you'll feel it's normal." It's done. The question is done. Make two's complement for this. How many times did we say it? Two's complement of zero remains zero. Now, two's complement for this. First, I find a 1. After I find a 1, I flip everything after it. Then it becomes ones. Now, this will become zero. It goes down. I found a 1. Everything after it changes. Then one. Then everything after it changes. Then here, we reached four. Okay, let's divide by fours so as not to confuse you. The solution is like this, and like this. I have zero. It goes down. Then zero goes down. I found a 1. The rest I change. One. Then the rest I change. Zero goes down. One. Then the rest I change. This is done. The second four. Then I come to the third four. Three zeros, one. If it stays as it is, 1000. The next is one, one, one, zero. Then the next is zero, one, zero. The last four will be A, which is zero, zero, one, zero. Then 1. Then 0. Then 1. And by the way, someone might notice it and say, "Ah, I've uncovered it." I say, "What?" It says, "Look, this number started from zero and started going down: 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, and 1." Okay. Someone might notice it directly and work on it. After that, Hagers, what's left for us? You now have to take it as a variable X, right? I say, "You're welcome. Let's make the K-map." Here, I have minterm 0, here I have minterm 1, 2, and 3, and 4. So, X's minterm is 1, 2, 3, 4, in addition to 5, 6, 7, 8, 9, and 10, 11, 12, 9, 10, 11, 12. And the rest, I don't want it. Okay. After we did this, of course, it might ask for W, it might ask for Y, it might ask for Z. You've understood the idea. Of course, someone might come and say, "Why did you do it for the numbers 15 and not put them as don't care?" I say, "Listen, don't mix ideas. A little while ago, it specified the BCD system. Here, it didn't say anything. Here, it said 'design for four bits' and stopped. It means the idea of the question is just to make two's complement." You have found X, summation of 1, 2, 3, 3. What do you do? You have to make a truth table. Go and make a truth table, and I will solve the question in detail, and you are welcome. There is no problem. My goal is just for you to understand and know what you are doing in the exam. Okay. And here we make a truth table. Here you have the inputs A, B, C, and D, right? These inputs, 0001, 1110, 0001, 1110. Please, someone don't confuse inputs and outputs. Inputs are always in the truth table. Don't confuse them. I say, "Okay, from term 0, 1, 2, and 3, and 4, and 5, 12, 15. Let me repeat it again. I have minterms 1, 2, 3, 4. Here are 0, 1, 2, 3, 4, 5, 6, 7, 8. Then I have 9, 10, 11, 12, 9, 10, 11, 12." Okay. What does it want from me? It wants me, of course, to cover them. I say, "Listen, I will cover them in one way or another. How? See what I'm going to do." I say, "First, these two ones, can I connect them?" I say, "No, really." So, connect these two ones separately, which are the zero here, B with C bar with D bar. Done. Someone comes and says, "I want to take these two." Wrong. There are two above. So, take these two separately with the two above. Here, I made a group of four. We're getting closer to the paper. Here, I have these two rows, where B bar is constant, and these two columns, where D is constant. Then someone comes and takes this 1 with the one above. Wrong. Again, take two like this, and two like this. Pay attention. Always look at the edges. I told you, always look at the edges. Maybe there are edges. The secret is in these edges. But the depth always reveals itself. I have the same thing, B bar, then what? It's C. What have I done? I have simplified X. So, X equals B in C bar in D bar plus B bar D plus B bar C. Someone will come and say, "Why did you put it as M? Why didn't you put it as, what's its name, zeros?" I say, "Look what it said. 'Find the output X of minterms.' It asked for minterms, not maxterms. It asked for min, meaning it's interested in the ones. Pay attention to every detail of the question. Everything changes." Okay. Now you have put the minterms in the first square. The second square, you have put the equation. The third square, look what it will be. I say, "Really, it's B C bar D bar plus, take B as a common factor. What will it become? D plus C. Look what I'm going to do. Just look at this. Maybe someone won't notice it. It's what? It's B C bar D bar plus B bar and here, it's the same. D bar C bar, the whole bar. Is it the same or not? You'll say, "Really, you're right." And maybe some people will do it and say, "Listen, it's the same as B C plus D, the whole bar, plus B bar and D plus C." It's the same solution, but let's remove it. I want to try working on the second one. Okay, let's work on this. It's not the same. It's what? It's originally a group and it's raised to a bar. Okay. Now, what do you notice? You put this in the first square, minterm. The second square, you put this equation. The third square, you take out a common factor. The fourth square, you put this. Okay. What about the fifth square? Look what I'm going to do. B XOR C plus D. Someone might say, "Ahmed, this is not logical. What is this?" I say, "Listen, it's B and it's bar B. But this is without a bar. So, consider C plus D as A, for example. Isn't it the same as B in A bar plus A in B bar? It's XOR. The first in the derivative of the second plus the second in the derivative of the first." Okay. This is all its story, and thus the five squares are filled. Okay. A well-organized design question, and at the same time, it makes you sweat. With all due respect, this is how we finished the question. Let's look at another design question. So many design questions today. Really, this design question is well-organized. I will give you its idea and I will keep going. I will not solve it to the end because it's not logical to keep solving it. It will remain ordinary things for you. Okay. It's impossible for someone who has reached Chapter Four to have not exploded these things, which is the story of making a truth table and K-maps and these things. Really, it says, "Design a combinational circuit to complement 9 BCD digits." Here it said, "I want you to make a design for BCD. BCD is a decimal system from 0 to 9. It asked for the 9's complement." So, what does it mean? The first complement, which is R minus. You'll say, "Really, you're 100% right." Okay. It gives me inputs A, B, C, D, and the output W, X, Y, and Z. So, I say, "Listen, here's A, here's B, here's C, and here's D. And the output is W, X, Y, and Z." This is what we know. Since it said BCD, I say, "0, 0, 1, 2, 4, 6, 8, 10. I stop." Okay. Now it says, "Why did you stop here?" I say, "You asked for BCD. So, everything after this will be what? It will be what? It will be a don't care, right? Because everything after nine is a don't care." Regardless of what this is. Okay. What do you want to do? 9's complement. What does 9's complement mean? It means subtract 9 from the numbers. This number is 0. Subtract 9 from it. 9 - 0 = 9. How do you write 9? Not like this. Pay attention. Don't go and make its first complement. No, I mean, you make its 9's complement. What did we used to do? We used to say, "R minus." What did we say? We used to say, "10 minus 1 equals 9." Subtract 9 from all the numbers. And 0 - 9 = 9. 1 - 9 = 8. How do you write 8 like this? Okay. The next number is 2. 9 - 2 = 7. How do you write the number 7? You say, "Like this." Okay. Number 6. Like this. Number 5. Like this. Number 4. Okay. 3, 2, 1, 0. Done. The question. What do you do? Now you have W, X, Y, and Z. Here they are. Everything that is not present is a don't care. Okay. So, from 10 to 15, all are don't care, because it specified BCD. Okay. What did it ask you for? Look what it's asking for. It says, "I want the output X, and the output Y, and the output Z, and W, Y, and Z." And it says, "And what are the don't cares?" I say, "Easy. The don't cares, we talked about them. The don't cares are summation of 10, 11, 12, 13, 14, and 15. All are don't care." And you're done. Of course, each one has a truth table of 16. The truth table is for these 16, because I enter 16 values. 10 values are available to me from 0 to 9, and the remaining six are what? They are don't cares. Complete this question and find each one with its truth table and work on it. And thus, the design question is finished, God Almighty willing. Let's look at the recording. God Almighty willing, things are good and easy. Let's come to this question. Of course, I put it like this at the beginning because it's a series of steps, a series of properties. Of course, I prefer that you don't memorize them. Now, when you work on the full adder and work on the half adder, you might understand them quickly. But I want to apply it to you here quickly using the normal mathematical method. It says, "Match the phrases applied to the exclusive OR." Okay. It gives you, it asks you, it says, "Is X XOR Y bar the same as X bar XOR Y?" I say, "I can't judge unless I work it out." Okay. Now, what does XOR mean? Imagine I have inputs X and Y. Okay. And here I have 0, 1, 0, 1, and here 0, 0, 1, 1. I want to ask you a question. Look how I'm going to work on it. X XOR Y bar. It means X plus Y bar. Multiplied by what? Now, what is X XOR Y bar? Ah, okay. Sorry, sorry. I really forgot it. X XOR Y means the first in the derivative of the second plus the second in the derivative of the first. Right? Really, I forgot. The first in the derivative of the second has a bar. You have to add another bar. Plus the second in the derivative of the first. What is this? It's X Y bar. Twice cancels out. So it becomes X Y plus Y bar X bar. Notice that this term is the same as this term, but negated. So the answer is 1. Let's come to this. The first in the derivative of the second plus the second in the derivative of the first. Because it has a bar, it becomes two bars. Now, this is X bar, and this is Y bar, plus double bars cancel out. So it becomes Y X. Look, this term is the same as this term, but negated. So the answer is also 1. Are the two equal? Yes, 100%. Okay. I'm sorry. It says, "X plus Y bar." What is it equal to? Here it is. It says, "X XOR Y bar." What is it equal to? The first in the derivative of the second, in the derivative of the first. It's X XOR Y bar. It asks you a question. "X XOR 0." I say, "Okay, you're welcome. X XOR 0. How do we work on it?" I say, "Okay, the first in the negation of the second, because zero negated is one. Plus the second in the negation of the first." Now, is X negated or not? It doesn't matter because it's multiplied by zero, so it becomes zero. It all went away. And here it becomes X. So, X, because X plus 0 equals X. It comes to me and says, "X XOR 1." I say, "Okay, you're welcome. The first in the negation of the second is zero, because one negated is zero. Plus the second in the negation of the first." Here it's gone, zero. One in X bar, so the answer is X bar. Okay. It says, "I want X XOR X." I say, "Okay, you're welcome. The first in the negation of the second. Anything multiplied by itself in negation, with a bar, is zero. Here it's zero, and here it's zero. So the answer is zero." Okay. Again, it told me, "I want X XOR X bar." I say, "You're welcome. X XOR X bar becomes X twice, plus X once in X once." Because, as we said, the first in the negation of the second. This is the first. Negate the second again. Here it is. Plus the second, which is originally negated, in the negation of the first, which is not negated, so it became negated. Here, negation and negation cancel each other out. So it becomes X, because X in X and X bar in X bar is X. X plus X bar is 1. Really, I confused everything, but it's okay. We solved it. We wanted to do it using the truth table method, but now it will take time and effort, so let's keep it with the mathematical equations. It will be done. The XOR means the first in the derivative of the second, in the derivative of the first. Why do I tell you this in the mathematical way? So you don't forget it. So you don't forget it. Okay. And this question is finished. Let's come to this question. Of course, this question is quick and simple. It says, "The carry output of a circuit can be expressed." Pay attention. Now, in the half adder, we have a carry out and a sum. I say, "Always remember this. Keep it with you. The sum in the half adder is X XOR B, which is the input XORed with the second input. And the carry is always its equation is A in B." It means we call it C. C equals A XOR B. And the carry out is, of course, C. It's not G. C is A in B. So I say, "Really, you asked me for the carry output in the half adder. Half adder means part of the full adder. It's A in B." Okay. Memorize these. They are here. Memorize them and don't forget them. Okay. This question is also finished. Let's come to the next question. A quick and easy question. Okay. Really, it says, "What does it say?" It says, "For the given..." Pay attention, just because it might not be clear to you. It's D3, D2, D1, D0, and Y, X, and V. Of course, what is this? It's an encoder. What is the principle of an encoder? It takes the output and gives you the input. Do you remember what we used to say? Okay, enter input A, B, C, D, and get output Y. Now, I'm entering Y and you're giving me input A, B, C, D. Do you understand? We reversed it. This is the method of the encoder. So, it says at the beginning, "Listen, this circuit is what?" I say, "It's a priority encoder." You'll say, "Why did you put high priority and not low priority?" Now, high priority means, it says, "You pressed three buttons or four buttons." So, the device will depend on the highest button. And if you put low priority, it will depend on the lowest button. Imagine you have a device, and you pressed five different numbers. If it was high priority, it means it takes the highest button. Really, I have numbers 5, 10, 20, and 30. I pressed them. If it's high priority, it takes the five presses. So, it will take 30 alone, because the encoder presses only one button. Okay. If it presses more than one button, then either it takes high priority, it takes the highest one, or it takes low priority, the lowest one. So, this, notice that D3, then D2, then D1, then D0. D3 is the main one. The main one in the design. Actually, if you press buttons, D3 will be the one that does things. It means it will take the highest value. It will be the basic principle. Notice that it gives Y and it gives X. Okay. It's the main output. So, I say, "High priority." If you reversed it and made it D0, D1, D2, D3, it would become low priority. Okay. Remember this. Always, high priority means that the device, the principle of the encoder, you cannot press more than one button at a time. If you press more than one button, then it will depend on the highest one if it's high, and if it's low, it will depend on the lowest one. God Almighty willing, I have been able to convey the idea to you. Okay. It says, "I want to ask you a question. If D3, which you put here, is 1, what will X and Y be?" I say, "Come. First, let's think about it. Really, Y has an OR. So, Y, look how I analyze the question. I say, it's a term plus a term. The first term is D3, and the second term is D2 bar with D1, because it's AND. Imagine you entered D1. Imagine. Will the value of this make a difference?" You'll say, "No, really." Why? Because it's OR, and we explained OR a million times. I told you, OR, if it's 1, the sum of a thousand trillion million terms, the answer will always be 1. So, Y is always 1, regardless of D2 and D1, because it's originally 1. So, the answer is always 1. Okay. Let's come to X. Really, look at X. Its arrangement is AND OR, something with something. What is the first thing? D3, and the second is D2. You have D2. It's 1. Will this make a difference? You'll say, "No, really." Why? Because whatever you enter for D2, the answer will always be 1. So, what is the answer, Hagers? I say, "X and Y will always be, in the short answer options, always 1 and 1." Meaning, their answer is always 1 and 1. It's impossible otherwise, because they are always sums entering an OR. If they were AND, I'd say, "Yes, maybe 0, maybe 1, depending on the values of the other inputs." But since it's always 1. Okay. These questions, my dear brothers and sisters, really, are about understanding. You understand it, you understand it, you work on it logically. Let's come to the next question. Here it gives the opposite. So, now it gave you D3 and got the output. Now it says, "If I gave you the output like this, Y, X, and Z, Y, X, and V, what will the inputs be?" Which are D3, D2, D1, D0. Of course, this depends on the options. So, it says, "Imagine that you gave X with Y with V is 1, 0, 1." Meaning, X is always 1, Y is always 0, and V is always 1. I say, "Focus with me, just quickly." According to the options, I notice that Y is always 0. What does that mean? It's impossible. It's impossible for D3 to be 0, it must always be 0. So, D3, from the moment you see the options, the first option must be D3, it must be 0. It stops at the second option. Really, it gives me that D1 is 1. D1 is 1, and D2 has a value, and D3 and so on. What do I notice? There's an option given to me. It says, "D3 is 0, D2 is 0." I say, "Imagine I gave you D3 is 0, and D2 is 0." If D2 is 0, D2 is 0. Pay attention. What will happen? D0 and D2 will enter an OR. 0 + 0 = 0. It will give X as 0. But I don't want X to be 0. I want X to be 1. So, it's impossible for D2 to be 0. It must have a value. It means it's OR, it must always be 1. So, the correct option must be D3 is 0, and D2 is 1. Okay, Hagers, you applied it to X alone. Where is Y? I say, "Come. Y is 0. Imagine D2 is 1. Its negation becomes 0. So, it's all 0, 0 + 0 = 0. Indeed, it fulfilled the condition that Y is 0." Okay. Go to V. What did it enter? It entered an OR. It entered an OR, which is D3 plus D2, entering a sum, in addition to D1 and D0. What is it? It's like this, which is D plus D2 plus D1 plus D0. This is V. Now, V gives 0. What do I say? I say, "If D0, D2 is 1 alone, then regardless of these, what are they? Since D2 is 1, the answer is directly 1." Okay. This is the principle of the question, my apologies. I am trying to explain it to you in any way. Work logically. It gave you D3 as 1. So, it's impossible for Y and X to be anything other than 1, because it's always OR. Okay. If it says, "If X, Y, and V are like this," you have to work on it. The principle of options. So, I explained it to you in the sense that there is an option that says D3 is 0, and D2 is 1. It didn't give you D1 or D0. Someone comes and says, "So, you gave me this equation for V. So, how do I know D1 and D0?" I say, "Man, D2 is 1. So, regardless of this, this, or this, what do I care? Since it's 1, the answer is always 1." And I fulfilled one condition, which is 1. Okay. 100%. This question is also finished, God Almighty willing. How much time has passed? 34 minutes. Let me explain this last question. I must explain it, so I can finish it for you. It's solved quickly by looking. It says, "Really, I have inputs A, B, and C, and an input, and the output is summation and carry out." Okay. Pay attention. Since this design, look at this design. It's a piece of a full adder. Its inputs are A, B, and C input. So, it says, "The same..." I say, "This is a full adder. It's a full adder. A with B with C input. The three inputs you work on them together. From them, it gives you an output and it gives you a carry out." What is this? This is a full adder. Okay. Let's come to the second one. It says, "Refer to the simple. What are the outputs when A is 1, B is 1, and C in is..." Always remember, when it gives you C in, you have to put it as a third parameter, as if it's a third input. It's an input, of course. For example, it says, "What is the result of the sum?" It's 0, because it's summation. I say, "Come. A with B with C in." Look how I started adding it to the operations, because it's a third input. 1, 0. It's 0 and 1 in hand. So, what will the result be? I say, "The sum is 0, and the carry out is 1." Okay. It says, "What if all three are ones?" I say, "1 plus 1 plus 1 equals what? 1 and 1 in hand." So, the result will be sum equals 1, and carry out equals 1. Okay. Meaning, you enter three inputs. The result of the number is the sum, and the carry out is the result, which is below. This is the design of the full adder. Okay. So, we have finished, God Almighty willing. Although there are still questions left, really, I haven't solved them yet, but time did not allow us, as usual. Forgive us for the long explanation. God Almighty willing, in the next lecture, we will continue with the explanation and details. This is from the one who is flawless. If we made a mistake, forgive us. Please do not forget us in your sincere prayers. May you all be well. Peace be upon you.