Loading...
Hello, my name is Mrs. Holborow, and welcome to computing.
I'm so pleased that you've been able to join me for this lesson today.
We are going to be exploring truth tables and how we can create truth tables from both Boolean expressions and circuit diagrams. Welcome to today's lesson from the unit, Boolean Logic.
This lesson is called Truth Tables.
And by the end of today's lesson, you'll be able to construct a truth table to represent a Boolean expression or circuit.
Shall we make a start? We will be exploring these keywords during today's lesson.
Truth table.
Truth table, a table showing the outputs for all possible combinations of inputs into a logic gate or logic circuit.
Boolean expression.
Boolean expression, an expression that evaluates to either true or false.
Today's lesson is divided into two parts.
In the first section, we'll construct a truth table from a Boolean expression, and in the second part, we'll construct a truth table from a circuit diagram.
Let's make a start by constructing a truth table from a Boolean expression.
Truth tables are a really useful way of checking that a Boolean expression represents the logic you intended.
So you start with a Boolean expression.
In this example, we are going to use the expression A OR A AND B in brackets.
Next, we test with a truth table.
To create the truth table, we start by adding all of the possible combinations of choices for the inputs A and B.
So here we have two inputs, we've labelled them as A and B.
And because there are two inputs, there are four possible combinations.
Those combinations are 00, 01, 10, and 11.
We then label the first column with the first part of the expression to be evaluated.
Remember, the order of precedence means that brackets are always evaluated first.
So the first one we are going to look at is A AND B.
So we complete the table for that section.
So remember, the rule of an AND gate is that both inputs must be one to return a one.
So the column from top to bottom reads, 0, 0, 0, 1.
We then finish by evaluating the A OR A AND B using the value of A AND B that we just calculated in the previous column.
So remember the rule here is A OR A AND B.
So we're going to use the two highlighted columns, A, the first column, and A AND B.
And because this is an OR, remember, if either one of the inputs is a one, then it will output a one.
So reading from top to bottom, the output will be 0, 0, 1, 1.
So the expression is true when A is true, it doesn't matter whether B is true or false.
Time to check your understanding.
In the truth table for A AND B, in brackets, OR C, what should the first column after the inputs be labelled as? Is it A, A AND B, in brackets, OR C, B, A AND B, or C, OR C? Pause the video here whilst you have a think.
That's correct! B, which is A AND B, is the first column because it's the first part of the expression to be evaluated because it's in brackets.
How many rows would you need to represent every combination of inputs four A AND B, in brackets, OR C in a truth table? Is it A, 16, B, four, or C, eight? Pause the video whilst you have a think.
That's correct! You would need eight rows to represent all of the different combinations of inputs.
An easy way to make sure you don't miss any is to write the binary numbers until you run out of place values.
So for example, 000, 001, 010, 011, et cetera.
Okay, we are now moving on to the first part of today's lesson.
I'd like you to draw a truth table for each expression.
One is NOT A OR B, two, NOT, A OR B in brackets, three, A AND NOT B, and then finally four, A OR B OR C.
Pause the video here whilst you complete the activity.
How did you get on? Did you manage to create a truth table for each expression? Great work.
Let's have a look at these sample answers together.
Remember, as we are going through these answers, you can check that your workings are correct and make any corrections that you may need to.
So number one, the expression was NOT A OR B.
So because we've got two inputs here, we've got four rows in our table and four possible combinations.
So 00, 01, 10, and 11.
Due to the order of precedence, the NOT A is going to be evaluated first, so that is our first column in our truth table after our inputs.
NOT A is the inverse of A, so basically all we are doing is flipping A, so zero becomes one and one becomes zero, and so on.
The last column in the table to be evaluated is NOT A OR B.
So now we're going to ignore the first column, column A in the table, and we're just going to look at column B and column NOT A.
And because this is an OR gate, if either one or both of those values are one, then it's going to return a one.
So reading from the top of the column to the bottom, it should be 1, 1, 0, 1.
Now for part two.
This time the expression was NOT, A OR B in brackets.
So again, there's only two inputs, so we've got four possible combinations.
But this time we've got some brackets, so due to the order of precedence, the brackets are going to be evaluated first.
So my next column after the inputs is A OR B.
Remember, the rule for an OR gate is if either one or both values are one, it's going to return a one.
So reading from the top of that column down to the bottom, we should have 0, 1, 1, 1.
Then the last column is NOT A OR B.
So this is going to be the inverse of the column that we've just created, so zero becomes one and one becomes zero.
So from top to bottom, that column reads 1, 0, 0, 0.
Three, the expression was A AND NOT B.
So the first column we're going to evaluate is NOT B, because due to the order of precedence, the NOT comes before the AND.
So reading from top to bottom of that column, we should have 1, 0, 1, 0.
And then the last column is A AND NOT B.
So this time we ignore that column B and we just look at the first column, column A, and the column NOT B.
And because it's an AND gate, we need both values to be one to return a one.
So reading from top to bottom of that column, we should have 0, 0, 1, 0.
Maybe pause the video here and just check off your answers on your truth tables and make any corrections if you need to.
Okay.
For part four, we need a slightly bigger table because this time we've got three inputs, so we need eight rows for all possible combinations.
So the Boolean expression was A OR B OR C.
You could also have calculated B OR C first here and then OR the result with the A because we are using two OR gates, so the order doesn't matter.
Again, if you need to pause your video here to check through your truth table, you can do that now.
You're doing a great job so far, so well done.
We are moving on to the second part of today's lesson where we are going to construct a truth table, this time from a circuit diagram.
Sofia says, "I've drawn this diagram to show that you can choose cake or ice cream, but not both.
It's also okay to choose neither." Andeep says, "I'm not sure that's right, Sofia." You can test whether or not you've drawn the correct circuit by constructing a truth table.
Andeep says, "Let's draw a truth table to test the circuit." Sofia says, "Sounds like a good plan." So the first step to create a truth table from a circuit diagram is to label the output from each gate with the Boolean expression it represents.
These will then become the columns in your truth table.
So you can see here I've got the column headings for my inputs, which are C and I, or cake and ice cream, and then I've labelled the Boolean expression, which is C OR I, and that becomes the first column heading after the inputs.
And then the final output is NOT, C OR I in brackets, so that becomes the final column.
Remember, like we did before when we were creating a truth table from a Boolean expression, we start by adding all of the possible combinations for the inputs, which in this case are C for cake and I for ice cream, into our truth table.
Because there are two inputs here, there are four possible combinations, 00, 01, 10, and 11.
We then calculate the value of the expression in the column heading for each combination of inputs.
So C or I.
So remember, the rule for an OR gate is that either one or both inputs must be one to return a one.
So if C and I are both zero, the output for C OR I will be zero, in all other cases it's going to be one.
We've then got the column NOT C OR I.
So remember, the rule for the NOT gate is it's going to inverse, so we're going to inverse C or I, so if C OR I is zero, NOT C OR I is going to be one, and so on.
So we can see quite clearly the circuit is only true when neither C nor I are true, so the logic here isn't quite correct.
Sofia says, "That's not right.
It should be true if only one input is true or neither input is true." Ah, Sofia's been able to fix the circuit.
So she's changed her circuit diagram because she was able to identify the error and she's tested that again by drawing the truth table.
Great work, Sofia.
Time to check your understanding.
What label should replace the question mark in this diagram? Is it A, NOT A, B, A OR B, or C, NOT A OR B? Pause the video here while you have a think.
That's right! The label should be the output of the previous gate.
What label should replace the question mark in this diagram? Is it A, NOT C, B, A AND B, or C, A AND B, in brackets, AND NOT C? Pause the video here whilst you have a think.
That's correct! The label should be A AND B because that's the output of this AND gate.
Okay, we are now moving on to the second set of activities for today's lesson, and you're doing a fantastic job so far, so well done.
I'd like you to draw a truth table for each of the following circuit diagrams. So you've got three in total to do and each diagram contains two logic gates.
Pause the video here whilst you complete the activity.
How did you get on? Did you manage to remember all of the steps to create the truth tables? Great work.
Let's have a look at some of these answers together.
So for question one, we had a NOT gate and an AND gate.
So we've started by labelling the outputs.
So the first output is NOT A, which becomes the input into the OR gate, and then the final output is NOT A, in brackets, OR B.
So we've got our two columns in our truth table for the inputs A and B, and then we've got our first column, which is NOT A, okay? So we have just done the inverse of A here, so we have 1, 1, 0, 0, reading from top to bottom of the table.
And then our final column is NOT A OR B, so we can now ignore the first column, column A.
And we're using an OR gate, so if either one or both of NOT A or B are one, then it's going to return a one.
So reading from top to bottom, we have 1, 1, 0, 1.
Okay.
For part two, we had a slightly more complicated truth table because this time we had three inputs and we've got our two gates.
But remember, the process is the same, so we start by labelling the outputs.
So the first AND gate has the output A AND B, and then the second AND gate has the output A AND B, in brackets, AND C.
So eight rows in our truth table because of all of the possible combinations.
And then the column A AND B has been created.
So remember, both A and B have to be one in order to return a one for this column.
And then the final column, which is A AND B AND C, remember this now needs to be a one in column C and a one in the column A AND B.
So from top to bottom, that final column should all be zeros until the final row.
Remember, if you need to make any corrections or fill any gaps, you can pause your video here and do that now.
Okay, part three.
Again, three inputs for this truth table, but this time we've got an AND gate and an OR gate.
So the output from the AND gate is B AND C and the output from the OR gate is A OR B AND C.
So the final column, which is A OR B AND C, should read from top to bottom, 0, 0, 0, 1, 1, 1, 1, 1.
Again, if you need to make any corrections, remember to pause your video now.
We've come to the end of today's lesson, and you've done a fantastic job, so well done.
Let's summarise what we have learned in this lesson.
A truth table is a useful tool to see whether a Boolean expression represents the logic you intended.
You can also check that a circuit represents the logic you intended by drawing a truth table.
To create a truth table, add all combinations of inputs and then evaluate the expression or circuit in order of operator precedence.
I hope you will join me again soon.
Bye!.