Welcome to the next video on the Boolean algebra and in
this video we're going to look at simple truth tables.
Now before we start to look at examples, I'd like to talk a
little bit about why do we use the three tables and what are
these two tables. For now we use the truth tables because these
are simple visual representation of what an actual Boolean
expression can do. So for example, you have a Boolean
expression combining together two or three input values, and
then you want to know what are all of those different
combinations. Expression can take as an input combination and
you would want to know what is the corresponding output for
every single one of those combinations. So a Boolean
expression using the through table can really easily show you
all of those different combinations. Now, how do we
construct the truth table while a through table which you have
seen in the previous video in their most basic cases is just
showing you the input combinations in the columns and
then. Breaking the complex Boolean expression down into its
constituent parts and then combining those parts together
according to different operations that take place in
the actual expression. Now depending on how many inputs we
have, you can use the following rule to establish how many
combinations of inputs you can have while every inputs can be
true or false or zero or one, so that gives you.
Two possible input values. Now, depending on how many different
input values you have, that will be 2 to a certain power. So for
example, if I have got two different input values, let's
say P&Q, then the possible combination of these input
values will be two to two, which is 4 if I have got three input
values, let's say PQ and.
Are then the possible combination of all of these
input values will be two to three, which is 8.
So how can we build up the start of our three table for these two
combinations if I, let's say, have two input values P&QI know
that I will have to end up with four combinations of these. Now
everyone of these inputs can be true or false. Now half of four
is 2. So if I place down to trues two forces and then just
alternating tuzan forces.
Then I will have all the four different combinations without
repeating any of them. Well, it's my big too obvious for the
two combinations, but let's see what happens if we have three
combinations. So let's say if I had P.
Q. And R as my input combinations, but half
of eight is 4, so I can put down four truths.
And four forces.
Then I can put down to truths.
Two forces, two throughs to forces Alternatingly and then
just one through 1/4 until I fill up the whole table.
Now opposed to the two combinations, which is
relatively simple because you can just follow through OK. Both
of them can be true. Both of them can be false, or 1314 when
it comes to three combinations that starts to become a little
bit more complicated. So if you don't remember this simple rule,
you might end up repeating one or the other of the rows in this
combination, which would end up you producing the wrong or
incomplete truth table for your.
Exercise and other important things when it comes to these
three tables is to being able to breakdown these different
expressions. So let's say that you have got a complicated
expression P and not.
Q.
Or pee.
Now what's going on in here?
But I have got brackets just like in BODMAS. I'm using the
bracket to rearrange the order of operations, so the brackets
will Tammy that I need to combine the inputs of P and not
Q before I can apply the OR operation so that straight away
tells me that the priority to be able to calculate things first
we will need to happen in the bug inside the bracket. Now
inside the bracket I have got P and not Q.
To be able to combine them together, I will need to know
the values of P, which I can just start from the beginning of
the table and then not Q. Now where I'm building up the table,
I will have P&Q input values. Therefore I will need to
calculate and not Q first to be able to combine P and not Q
together. Once I've got not Q, combined it together with the
using the end operation. Then I can combine that.
Partial output with the OR and the P. Now let's see how does it
work in practice.
So be.
Cute.
Not key.
B end not key.
And P and not Q or
P. So these are the different input values that I need to be
able to calculate before I will end up with the final answer, so
I've only got P&Q. I've only got two different letters in my
expression, therefore I'm going to use only two of those
combinations and the truth values to start with are going
to be true to force force through force 3/4. Now what does
the not due to an input?
Drew turns into force force, turns into 2.
So that's what happens if I apply the not operation to
the cube. What I need to do next? I need to pick up the
note Q and I need to combine that together with the P
using the end operation.
And This is why you need to remember what every single one
of these different operations do, because you need to be able
to apply them to certain situations. So true and force
makes it force true and true makes it true. Force and force
makes a force and force, and two makes a force. So now I have got
answers to this operation for each of the different
combinations. But that's not my final goal, 'cause my final goal
is to have the answer for this operation. So for that what I
need to do is pick up this.
Which is this spot?
And I need to use the operation. Combine it
together with P again.
So what I'm going to do in this case? I'm going to look at these
two. Input values and using the rules of the OR operation true
or force gives me true true or true gives me true force or
force gives me force force or force gives me force.
What have I found?
What I found is that what is this operation does to every
possible input combinations of P&Q? What will be the output? So
if both of them are true?
The output will be true if P is true, Q is forced, the output
will be true, but in the other two cases, when PS4's and Q
history, the output overall output will be for Stan. If both
of them are forced, the overall output will be force. So with
this combination I have been able to filter out these two
first input values. I'm letting those go through this
combination. And these two I'm going to stop. Remember that
these input values are always. You can think about the movies
like electric circuits do I let the signal go through or do I
not? And for some reasons it's important for me to only allow
these two signals combinations to and stop these two signals.
Let's look at another example.
P&Q
axor. P. Again, I've only got two different letters
P&Q, so the overall different inputs just P&Q, so I'm going to
have just a combination.
Do again the truth table will be 2 to force force or three
fourths 3/4 now and I'm looking at the expression what are the
different inputs that I need to combine together first before I
can calculate the overall output. Now there is an X or
gate but there is a bracket bracket is my priority just like
him but mass. So I need to calculate the P&Q first before I
can apply. The P&QX or P so the Exor gate will be the final
operation that I'm going to use in here. So for P&Q simply.
Just use the end operation.
The end operation only returns true if both of them are true.
In every other cases, the end will be false.
And the X or what do I know about the X or the X? Or is to
distinguish between the signals being the same both through both
force or the signals being different one through 1 force
and only letting through when the signals are actually
different? That's why it's called exclusive or it's
exclusively one or the other. So what do I need to look? But the
first input will be the combination that we just
calculated. And the other one is the P so.
P and this combination is the same, so the exclusivo returns
force. B and the combination is different, so the exclusive or
gives you true.
These are again the same, so it returns a force and these are
again the same, so it's again returns of force.
So again, what have we found? We know that P&Q can take all these
different input combinations and the expression which is using
P&QX or P. We return these output values. The interesting
thing about this expression is it only let's through one
combination the true Force combination. It stops every
other combination. So you can see it. You can use these
combinations of different operations of filtering.
Out certain inputs and only allowing to go through one
type of input.
The next expression P or Q.
If then. Q.
So how many different letters do I have? I only have P&Q, so this
through table again just gonna have to input combinations.
The start will be again true through Force Force
3, Four 3/4. Now try to breakdown the expression.
There is a bracket again that tells me the priority, so I will
need to find the P or Q first before I can use.
D. Eve, then operation.
So B or Q both of them are true, so this will be true. One of
them is true. This will be true. Both of them are force. This
will be force. So that was very simple. But how about if them
well? Just to make sure that we remember what we've done
is, let's recall.
The truth table of the if then.
3344343 of course. Now what does the if
then do if both of them are true? If then returns true if A
is true, but B is force if then returns force if A is forced but
B is 2 if then returns true, and if both of them are forced to if
then again returns true.
So this is one of the more difficult tables to remember,
so I suggest that you learn it very well so.
Back to our original table.
What are the two inputs that we need to look into now? This one
is my A and this one is my B. So if a is true and B
is true, the if then returns are true if A is true, but B is
force that if done returns a
force. If both of them are true, if then returns a true,
and if both of them are force, which is the last guess in here
if then again returns true.
In the next video we will look at few more simple
examples, but for now I have a couple of practice
questions for you. You will find the answers to these
questions at the end of the video.
So these are the practice questions.
And here are the answers.