OK we're now going to talk about logic gates.
So a logic gate.
There are several different types we have and we have an oar and we have a nots.
Those are the basic ones.
The evidence is such that it obeys this logic if I have P-Q and I'm going to give you the different
cases.
0 0 0 0 1 1 0 1 1.
The output which I'll just call y for an answer is that is this 0 0 0 0 and 1 0 1 0 0 1 and 1 give you
one.
Now what is that logic that the only time when it's true is if they're both true if p and q happens
then it's true.
The or however is a slightly different logic or is as long as one of them is true.
So if none of them are true 0 0 0 1 0 1 is 1 1 0 1 and 1 1 is 1.
If one of them happened or even if both of them happened then it would be true.
So 0 0 0 0 1 is 1 except for we do have something called an X or an X or is when it's an exclusive or.
Which means that it's only true when either one of them happen and not both.
So 0 1 that means one of them happened one that had one zero one of them happened one then it but won
one.
They both happened exclusively or so that x or would be the logic.
That's just right there the knot is very straightforward that's just the opposite.
So if you had a 1 0 that became a 1 to 1 would become easier.
So those are logical it's that's pretty much it.
Now we could put them together to build something we can build hands in words and not in all kinds of
variations.
And we're going to do that right now.
The first thing that we could do is realize that we need to have a symbolism for this.
So if I say p and q that's the end if I say p or q that C or if I say not P.
Or sometimes it's done like this with the not on the top either the squiggly or the the Tilda or the
not on top.
So let's build a logic over here.
I'm going to say p and q or not P and NOT Q That's a Q.
Let's fix that.
So you could read it.
OK I'm going to be very careful to put in parentheses everywhere.
OK so let's draw this out.
I'm going to do p and q first Ok then what I'm going to do is I'm going to do p and q then when I'm
going to do is I'm going to do not P I'm going to do a not.
Q I'm going to do a not p and q doing it step by step.
Each one of these and then I'll call this over here a.
I'll call this over here B and then I'm going to get an A or B OK.
So I'm going to break down this into all different steps.
That way we can follow along what's going on.
So f 0 0 1 1 that's p q is going to be 0 1 0 1 that's all the different cases P and Q is just the and
logic which means that the only time it's true is if they're both true not P is the opposite of peace
so zero would be one p zero would be 1 p 1 would be 0 and that would be that's and not q is the opposite
of q.
So it's 1 0 1 0 because of the opposite of what you is not P and Q is.
And these two statements will that's true.
And the rest are false.
Now if I take a in a or it with B.
This is a.
Over here and I ord with B.
That's my b.
So if I do the or this is what I get I get 1 0 0 I get 1 0 0 1.
That's what that equals to that's is the opposite of an X or if this were an X or if I had P X or Q
If I P X or Q The logic would be this.
So you can see that that is not X or so if I said not p x or Q That would be equivalent to this statement
of p and q or not P and not q.
So those two cases are equivalent and there's a lot of logics that can be broken down into smaller to
bigger things.