Question Video: Evaluating the Output of Multiple XOR Gates Using Truth Tables | Nagwa Question Video: Evaluating the Output of Multiple XOR Gates Using Truth Tables | Nagwa

Question Video: Evaluating the Output of Multiple XOR Gates Using Truth Tables

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

05:24

Video Transcript

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

Okay, so, before we get to answering this question, we should first have a look at the set-up that’s been given to us in the diagram. So, what we’ve been given is an XOR gate which has two inputs, input A and B, and the output of this XOR gate becomes one of the inputs of another XOR gate. As well as, of course, input C which is an independent input into the second XOR gate. And then, the output of the second XOR gate has been given to us in the truth table, based on the values of input A, B, and C.

Now before we have a look at the truth table, let’s have a look at what an XOR gate actually does. So, an XOR gate, otherwise known as an exclusive OR gate, behaves according to this truth table. Now an XOR gate has two inputs, which we’ll call as a general term input 𝛼 and input 𝛽. So, if the first input, input 𝛼, is zero and the second input, input 𝛽, is also zero, then the output ends up being zero. If the first input is zero and the second input is one, however, then the output ends up being one.

If the first input is one this time and the second input is zero, then the output ends up being one yet again. And if both the inputs are one, then the output is zero. This is why it’s known as an exclusive OR gate. Because in order for the output to be one, then either the first input or the second input need to be one, exclusively. In other words, one of the inputs must be one in order for the output to be one. But if they’re both one, then the output is zero, hence the exclusivity.

This is why an XOR gate is very slightly different to an OR gate. And the only difference between an OR gate and an XOR gate is that for an OR gate this value of the output would’ve been one as well.

But anyway, so we’ve got two XOR gates connected in this fashion. So, let’s try and find the value of 𝑝 in the table. Now, looking at the table, we can see that 𝑝 is here. And that value is the value of the output which corresponds to an input A-value of zero, an input B-value of one, and an input C-value of one. In other words, if input A is set to zero, if input B is set to one, and if input C is set to one, then the output is going to end up being 𝑝. So, let’s figure out the value of 𝑝.

Let’s do this step-by-step by first considering the first XOR gate. Now in this first XOR gate, the first input value is zero and the second input value is one. That corresponds to this row of the table. The value of the first input is zero. The value of the second input is one. And the output, therefore, ends up being one. And so, we can say that the output of the first XOR gate is one. But then this one ends up being one of the inputs to the second XOR gate.

And so, at this point, what we have is an input of one and another input of one for the second XOR gate. That corresponds to this row of the truth table. The first input is one, the second input is one, and so the output is going to be zero. Therefore, the output on the second XOR gate is zero. But as we said earlier, this value is equal to 𝑝. And so, we can say that the value of 𝑝 in the table is zero.

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

Okay, so, looking in the truth table, we can see 𝑞 over here. Now 𝑞 represents the value of the output when the value of input A is one, input B is zero, and input C is one. So, let’s write those down. Input A is one, input B is zero, and input C is one. Once again, starting with the first XOR gate, we can see that the first input is one and the second input is zero. That corresponds to this row. The first input is one and the second input is zero. And so, the output of the XOR gate is going to be one.

So, we write down one as the output. And then, this becomes the input for the second XOR gate, yet again. So, now for the second XOR gate we’ve got an input of one and yet another input of one. That corresponds to this row of the table. The first input is one, the second input is one, and so the output is going to be zero. So, we can say the output of the second XOR is zero. But as we said earlier this output corresponds to the value of 𝑞. Hence, we can say that zero’s equal to 𝑞. And so the value of 𝑞 in the table is zero as well.

Looking at the next part of the question then. This part of the question asks, what is the value of 𝑟 in the table?

So, in the table, 𝑟 is directly beneath 𝑞. And this time 𝑟 represent the value of the output, yet again, but when the value of input A is one, B is one, and C is zero. So, input A is one, input B is one, and input C is zero. Starting with the first XOR gate yet again, we can see that the first input being one and the second input being one corresponds to an output of zero. And so, the output of the first XOR gate — now this becomes an input for the second XOR gate yet again.

So, we’ve got an input of zero and zero. And that corresponds to this row. The first input is zero, the second input is zero, and the output is going to be zero. So, the output here is zero. But then this corresponds to the value of 𝑟. And so, we know that the value of 𝑟 in the table is zero.

Finally, what is the value of 𝑠 in the table?

Now 𝑠 is down here, once again an output value, but this time corresponding to all of the inputs being one. So, input A is one, input B is one, and input C is one. Looking at the first XOR gate, having the first input and second input being one corresponds to an output value of zero. So, the output of the first XOR gate is zero. And so, we’ve got two inputs now of zero and one into the second XOR gate. Looking at this row then, the first input is zero, the second input is one, and so the output is going to be one. Hence, we can say that one is here. But we saw earlier that this corresponds to 𝑠. And therefore, we can say that the value of 𝑠 in the table is one.

Join Nagwa Classes

Attend live sessions on Nagwa Classes to boost your learning with guidance and advice from an expert teacher!

  • Interactive Sessions
  • Chat & Messaging
  • Realistic Exam Questions

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