# Question Video: Finding the Output of Logic Circuits by Inspection Physics

The diagram shows a logic circuit consisting of multiple logic gates. How many different possible combinations of inputs are there for this circuit? How many of the possible combinations of inputs to this circuit produce an output of 0? How many of the possible combinations of inputs to this circuit produce an output of 1?

12:04

### Video Transcript

The diagram shows a logic circuit consisting of multiple logic gates.

So in this diagram, we can see that we’ve got an OR gate here, another OR gate here, and an AND gate here. So let’s start by giving them their respective labels. Now, we can see that in our logic circuit, there are two inputs, input A and B, that go into the first OR gate and the output of the OR gate becomes the first input to the AND gate. Similarly, we see that input C and D are inputs to the second OR gate. And the output to that OR gate becomes the second input to the AND gate.

Now, based on all of this, we need to find out the following. Firstly, we need to find out how many different possible combinations of inputs are there for the circuit. Secondly, we need to find out how many of the possible combinations of inputs to the circuit produce an output of zero. And finally, we need to find out how many of the possible combinations of inputs to the circuit produce an output of one. Okay, so let’s start by looking at the very first question: how many different possible combinations of inputs are there for this circuit?

To answer this, we need to remember that logic gates have binary inputs. In other words, every single one of these inputs, inputs A, B, C, or D, can take the values zero or one. And so for each single input, we have two different options. This means that the total number of different possible combinations of inputs is equal to two possibilities for input A multiplied by two possibilities for input B multiplied by two possibilities for input C multiplied by two possibilities for input D. And so, we find that two times two times two times two is equal to 16. And we can convince ourselves of this when we build the truth table to help answer the next two questions. But for now, we found the answer to the first question. The number of different possible combinations of inputs for this circuit is 16.

So now that we’ve answered that, let’s look at the next part of the question. How many of the possible combinations of inputs to this circuit produce an output of zero?

In other words, how many combinations of input A, B, C, and D are there that gives us an overall output of zero? Now to answer this, like we said earlier, we are going to need to build a truth table. So let’s clear some space on screen so that we’re able to do that. Let’s firstly write down the question that we’re trying to answer over here and then realize that the truth table that we’re going to build is going to be based on the truth table for an OR gate as well as for an AND gate. We’re gonna have to combine these gates in the specific way to reflect the behavior of this particular setup, which, in other words, is two OR gates. And the outputs from these OR gates go into the inputs of the AND gate.

But before we do this, let’s start by recalling the truth table for individual OR and AND gates. So let’s set up a truth table for an OR gate here and one for an AND gate here. Let’s say that the two inputs for the OR gate are called 𝛼 and 𝛽. These will be our general input names because we’ve already used A and B. And similarly, let’s say that the output is 𝜔 because we’ve already used the word output here. And we’re gonna do exactly the same with the AND gate: inputs of 𝛼 and 𝛽 and an output of 𝜔. Then, we can fill in the values.

We can recall that in an OR gate, if either one of the inputs or the other is one, then the output is going to be one as well. And for an AND gate, we need both input 𝛼 and input 𝛽 to be one in order for the output to be one. So these are the individual truth tables for an OR gate and for an AND gate. Now let’s start building our true table for the setup that we have here. Because we know we’ve got four inputs, inputs A, B, C, and D, we know that we’re going to need a column for each one of these inputs A, B, C, and D, and then one more for the output. But actually, in this case, it might help us to have some intermediate columns as well.

Let’s say that the output from the first OR gate we will call 𝐸 and the output from the second OR gate we will call 𝐹. This way, 𝐸 and 𝐹 become the inputs to the AND gate. So let’s say that our truth table will have columns for input A, B, C, and D. And as well as this, we’ll have columns for 𝐸 and 𝐹. Now 𝐸 and 𝐹 are neither inputs nor outputs. Or rather, technically, they’re both. But they are not the inputs or the outputs of the entire system. So we’ll just call them 𝐸 and 𝐹. And then, of course, we need to finish off the table with a column for the output. So let’s start filling in some values now.

Let’s start by assuming that all of the inputs are set to zero. Input A is zero, B is zero, C is zero, and D is zero. And let’s work out what the values firstly of 𝐸 and 𝐹 are going to be in this situation. Well, 𝐸 is the output for the first OR gate and the value of 𝐸 is dependent on the values of input A and input B. So we can see that when A and B are both zero, if we go over to the OR gate truth table, this results in an output of zero. And so to recap, if these two values are zero, input A and B, then the output of that OR gate, which is 𝐸, is going to be zero as well. Therefore, we can fill in a zero in this row. And the same is true for the value of 𝐹. Both inputs C and D are set to zero.

And so coming back to the truth table, for an OR gate, which is exactly what we have here, the value of 𝐹, which is the output of that OR gate, is going to be zero as well. And so, we can put that into our truth table. And then at this point, we can stop thinking of 𝐸 and 𝐹 temporarily as the outputs to the OR gates and start thinking about them as the inputs to the AND gate. Because now what we’ve got is a value of zero going into the AND gate in the first input and another zero going into the AND gate as the second input. Well in that situation, when both inputs to the AND gate are zero, the output is zero as well. And so, our overall output is going to be zero here. At which point, we filled in one row of the truth table. We’d just need to repeat this process now.

Let’s keep the values of inputs A, B, and C the same, but change the value of input D to one. And so what we can say is that input A is zero, input B is zero, input C is zero, and input D is one. Based on this, we can work out the consequences for 𝐸 and 𝐹 and then work out the value of the output. But before we do, here’s a nice way to build these truth tables or specifically, the values of the inputs in the truth tables and how to do this systematically. A good way to do this is to think about how we count numbers in the decimal system.

So let’s say we start with a number zero, which in this case, we’re representing with five zeros. And then, if we want to increase that number by one, we simply change the last zero to a one. And at this point, we’ve incremented by one. Then if we want to increase by another one, we change that number to a two. And we can keep doing this. We can keep increasing the number on the right-hand side to a three, then a four, then a five, and so on and so forth until we get to nine. At which point, what we do is to cycle that last number back to a zero again. But then increase the second number from the right to a one. So now, what we’ve got is 00010 which is a representation of the number 10 in decimal.

And then, we go through that whole cycle again. We change the number on the right-hand side to one, then to two, then to three, then to four, and so on. And then when we get to 19, we cycle that last number back to a zero again and increase this number by one once again. And then when we’ve cycled through all of the 90’s, we then cycle these two numbers to zeros and we increase the value of this number by one. And this kind of logic can be used in the binary system as well.

The way to do this is to represent the values of the inputs on our system, starting with all zeros and then increasing the final number by one. At which point we’ve exhausted all of the possibilities in terms of what value this input can take. In the decimal system, we could cycle all the way to nine, but in the binary system, we can not. So instead, what we do is to reset this value to zero and increase this value by one. And so we’re left with 0010. Then, we can increase this value by one to give us 0011. At which point, we then need to increment this value. We increase the second digit to a one and reset both of these to zeros and so on and so forth. Now, if we do it this way, then we will systematically go through all of the possibilities of input A, B, C, and D and how they combine together.

So based on this information, let’s fill in the first four columns of our truth table in their entirety. So we’ve already filled in a row representing 0001 or where input A, B, and C are set to zero and input D is set to one. So let’s fill in the next row. This one is going to be 0010. Then, we have 0011. Moving on, we’ve got 0100 and then 0101 The next one is going to be 0110 and then 0111. Then, we have 1000. The next one is 1001. Continuing on, we have 1010, 1011, 1100, 1101, 1110, and finally the last possible combination that we haven’t filled in, 1111. And so at this point, we can count the total number of possible input combinations or, in other words, the total number of rows that we filled in on this truth table. And that ends up being 16, which exactly corresponds to the answer we gave to the first part of the question, the number of different possible combinations of inputs for this circuit.

But anyway, so now that we’ve filled in all possible values of the inputs for this truth table, let’s go back to looking at the values of 𝐸 and 𝐹 and eventually the output. So looking at the second row of the table, input A and B are set to zero and input A and B directly influenced the value of 𝐸. So we look at the truth table for an OR gate to see that when both inputs are zero, the output is zero as well. Therefore, the value of 𝐸 is zero. For 𝐹, however, it’s slightly different because now what we have is that input C is set to zero, but input D is set to one. And so, the second input in this OR gate is set to one. Therefore, we’re now looking at this second row here: first input zero, second input one. That gives an output of one. And remember, the output of that OR gate is 𝐹. So 𝐹 is going to be one.

And then, finally, we combine 𝐸 and 𝐹 to be the inputs of the AND gate. And we see that when the first input is zero, but the second input is one which is exactly what we have here. Then, the output of the AND gate, which is also the output of the entire circuit, is zero. And so, we say that this output here in the second row is zero. Now, let’s go through this process just once more to be sure. So to do this, let’s look at the third row of the truth table.

Inputs A and B are set to zero. Input C is set to one and input D is set to zero. So inputs A and B influence the value of 𝐸. And so we see that if both inputs are set to zero, then the output of the first OR gate, which is 𝐸, is going to be zero. And then we see that input C and D are set to one and zero, respectively. And so, in this truth table, we’re looking at the third row. The first input is one, the second input is zero, and the output of the OR gate is one. So we can say that 𝐹 is one. And then, we’ve already seen that for an AND gate, if the first input is zero, the second input is one, then the output is zero. And so we put a zero here in this output value. And then, we can repeat this process for the number of remaining rows. When we do this, we find that our completed truth table looks like this. Feel free to pause the video here and check the truth table that you’ve drawn against this one.

But anyway, coming back to our question, then we’ve been asked to find how many of the possible combinations of inputs to the circuit produce an output of zero. In other words then, how many of these rows have an output of zero? So let’s count that: one, two, three, four, five, six, seven. And so, the number of possible combinations of inputs to the circuit that produce an output of zero is seven. So now that we’ve answered that, let’s look at the final part of the question.

How many of the possible combinations of inputs to this circuit produce an output of one?

So we need to count the number of rows in our truth table that have one as the output. But actually, we don’t need to count this because remember, we said earlier that there are 16 different possible combinations of inputs or 16 different rows on this table. And seven of those rows have an output of zero. So the remaining rows must have an output of one. Because remember, the output to a logic gate is a binary output. We can only have a value of zero or one. And hence, the remaining nine rows on our truth table that we haven’t yet accounted for will have an output of one. And just to make sure, let’s confirm by counting. So the number of rows that have an output of one is one, two, three, four, five, six, seven, eight, nine, just as we suspected.

Nagwa uses cookies to ensure you get the best experience on our website. Learn more about our Privacy Policy.