### Video Transcript

The diagram shows two AND gates connected as a part of a logic circuit. The truth table shows the output for the various combinations of the inputs. What is the value of 𝑝 in the table?

Okay so before we get to answering this question, let’s first have a look at this diagram here as well as the truth table that we’ve been given, this big table here. Now firstly in the diagram, we can see that we’ve got two AND gates connected together in some special way. Specifically, we can see that we’ve got two inputs on the first AND gate, as expected for an AND gate, but then the output of the first AND gate is becoming an input for the second AND gate as well as another input to become the second input for the second AND gate. Then we’ve got values for the output, which have also been given to us in the table.

Now it’s worth remembering that for a logic gate, any input or output set at zero can also be labelled as false and any output or input set at one can also be labelled as true. This is why this whole table is called a truth table. Anyway, we also need to remember that an AND gate works in the following way. Firstly, it has two inputs and one output as we’ve seen already in the diagram for both the AND gates in the diagram. And secondly, it needs a very specific combination of values on the inputs in order to return a true output.

So for example, let’s say that both the inputs are set to zero or false. Well then the output of the AND gate is also going to be zero. It’s going to be false. Now let’s say one of the inputs is set to one and the other is set to zero. Well then the output of the AND gate is still going to be zero. And it doesn’t matter which input we set to one; if the other one is set to zero, then the output is also going to be zero. However, if both inputs are set to one or to true, then the output of the AND gate is going to be one or true. This is why it’s known as an AND gate because we need the first input to be set to one and we need the second input to be set to one in order for the output to be one or true.

So anyway coming back to this truth table then, this table gives us a different set of values applied to input 𝐴, that’s this input here, same thing with input 𝐵, that’s this one here, and input 𝐶, that’s this one here, and tells us what the output is going to be based on the values of input 𝐴, input 𝐵, and input 𝐶. So for the first part of the question, we’ve been asked to find the value of 𝑝 in the table. 𝑝 is over here. So in other words, we’ve set the input 𝐴 to zero, input 𝐵 to zero, input 𝐶 to one, and we’ve been asked to find out what 𝑝 is. So let’s work through this step by step.

We set input 𝐴 to zero and input 𝐵 to zero. Well as we’ve said earlier, the only way that the output of this first AND gate is going to be one is if both input 𝐴 and input 𝐵 are one, which in this case they’re not; they’re both zeros. And so the output of this first AND gate is also going to be zero. But then this output of the first AND gate then becomes the input of the second AND gate. So what we have is a zero going into the second AND gate. And we’ve also been told that input 𝐶 is one. So we’ve got a zero and a one going into the second AND gate. But once again, both of the inputs for the second AND gate are not one, so the output is going to be false or zero. In other words then, the value of 𝑝 in the table is zero.

Moving on then, what is the value of 𝑞 in the table?

Now here is 𝑞 in the table. So we’ve been told that when we set the value of input 𝐴 to be 𝑞 and we set the value of input 𝐵 to be one and we set the value of input 𝐶 to be one as well the output ends up being zero. So let’s fill in the information that we have. We set input 𝐴 to be 𝑞, we set input 𝐵 to be one, we set input 𝐶 to be one as well, and the output ends up being zero. Now, the only way that the output can be zero is if this input going into the second AND gate was zero as well because if it wasn’t a zero then it would be a one and then we’d have a one in this input and a one in this input, which would result in an output of one. That’s not what the case is though, and so we know that this input for the second AND gate must be a zero.

But then that means that the output for the first AND gate must be a zero because they’re the same thing. But then if the output of the first AND gate is zero, then the value of 𝑞 must be zero as well because the value of input 𝐵 is one, so if 𝑞 was one as well then this value would be one, but it’s not; it’s zero. So 𝑞 must be zero, hence the value of 𝑞 in the table is zero. Let’s look at the third part of the question.

What is the value of 𝑟 in the table?

Looking for the value 𝑟, we can see that it’s in the penultimate row of the truth table. So for that row of the truth table, we set the input 𝐴 to one, we set the input 𝐵 to one, we set the input 𝐶 to zero, and we need to find the value of 𝑟. Once again writing down all the information we have, input 𝐴 is one, input 𝐵 is one, and input 𝐶 is zero. What is the output going to be? Well let’s start with the first AND gate. If input 𝐴 and input 𝐵 are one, then the output of the first AND gate is going to be one. Now this output becomes the input once again for the second AND gate. So we’ve got inputs of one and zero for the second AND gate. But then this is going to result in an ~~input~~ [output] of zero because the only way we’d get an output of one is if both the inputs into the second AND gate were one. But in this case we’ve got a one and a zero. So the output is going to be zero. Hence, the value of 𝑟 in the table is zero.

Moving on to the final part of the question then, what is the value of 𝑠 in the table?

So here is 𝑠 on the final row of the table. Now we’re trying to figure this out, but we’ve also been told that input 𝐵 is set to one, input 𝐶 is set to one, and the output happens to be one. So input 𝐴 has a value of 𝑠, input 𝐵 has a value of one, input 𝐶 has a value of one, and the output is one. So in this case once again, we need to work backwards. If the output of the second AND gate is one, then that means both inputs must have been one as well. This adds up because we’ve been told that input 𝐶 is one, and we can deduce that the other input to the second AND gate is one. But then this means that the output to the first AND gate is one, because once again the output of the first AND gate and the input to the second AND gate are the same thing. Now working further backwards, we can see that if the output to the first AND gate is one, then both of the inputs to the first AND gate must have been one as well. Therefore, the value of 𝑠 in the table is one. And at this point, we figured out all of the unknown values in our truth table.