# Lesson video

In progress...

Hi, I'm Kash your computer science teacher for the computer systems unit.

In this lesson, we're going to uncover the connection between logic and computer hardware.

For this lesson, you're going to use the pen, some paper and you're going to need to remove any destruction that are going to stop you from focusing.

Once you've done that let's begin.

In this lesson, you will describe logical operators, use logic gates to construct logic circuits and describe how hardware is built out of increasingly complex logic circuits.

So let's introduce Boolean logic.

In 1854 George Boole published "The Laws of Thought" the book didn't really capture how we think it was an effort to represent logic and reasoning as mathematical operations.

Arithmetic operations such as addition operate on numbers.

Here, we have 7 + X where seven is a constant and X is a variable.

The plus in the middle or the addition is the operator here.

Together it makes an arithmetic expression.

The result of an arithmetic expression is also a number.

Boolean logic, logical operations operate on statements that are true or false.

A and B, A and B are both statements the and is the operator here.

Together it makes a logical expression.

The result is either true or false.

Can you think of any of the logical operators? Write them down if you think of any.

Let's have a look.

So that three fundamental logical operations.

We've got the not, the and and the or.

So the not is inversion.

So it's the opposite.

So if it's true, it then becomes false.

And is conjunction and or is disjunction.

So let's have a look, not raining.

Raining is a statement on its own.

The not is an operator, together there make a logical expression.

So the result of that can be, go out.

Which is also a statement true or false.

Let's have a look at the truth table on the right hand side.

The statement not A is true when A is false and vice versa.

So in this example, when raining is false, not raining is true.

And when raining is true, not running is faults.

So let's have a look at the and operator.

Here we have a sliding door that's equipped with a motion sensor and an activation switch.

So in order for it to open motion needs to be detected.

And the activation switch needs to be pressed.

So motion activated are our statements.

The and is the operator and it will open, which is a statement which is going to be true or false.

So let's have a look at some examples on the right hand side in our truth table.

So if motion is not detected and the activation switch is not pressed, what's going to happen.

Yeah, you're right.

It's not going to open, is it? Good, so this time if motion is not detected but activation switch is pressed.

What do you think is going to happen then? Yes, it's not going to open because we need both.

The and makes it explicit that we need both in order for it to open.

Next, it's time we've detected motion.

But the activation switch has not been pressed.

You guessed it.

It's going to be false.

And lastly, the motion sensor has been activated and activation switch has been pressed.

Yeah, so true it's going to open that sliding door, brilliant.

The statement A and B is true when both A and B are true.

The example I usually usually give here is I've gone into a shop and I'm going to buy some fish and chips.

So behind the counter I order and I say right, I want fish and chips.

So if they just bring fish out and not the chips, I'm not happy.

If they'd bring the chips out and no fish, I'm not happy.

But if they bring both fish and chips out that's when I'm satisfied, okay.

So let's have a look at the or operator.

So here we have two sliding doors left or right and either one of them, if they're detect motion they'll open.

So the left and right here are statements and the or is the operator.

And the going to open and that's a statement which is going to be either true or false.

So on the right hand side, let's have a look at the truth table.

So this time, if they're both false.

So no motion is detected, are they going to open? They're not going to open, are there? If the left side door doesn't detect motion, but the right side doors, will they open? Yes, they will.

Because here we're using the or operator.

So one or the other can be true.

So as you can see, if they're both false.

The output is false.

If one of them is true whilst the other one is false the output is true.

Now what about if they're both true? So in everyday life, when for example, we want to drink, we say right, we love tea or coffee or we've got some homework that's due in.

We'll say Oh, we know we'll do it today or tomorrow.

You could do it on either days or you can have either option.

You're going to be happy, are you? And if he said, write out tea or coffee and soon gave you both options.

You'll still be happy in that situation.

So that's also true.

Oh, I'd be happy in that situation anyway.

So the statement A or B is true when at least one of A or B is true.

Here One thing to think about is the or operator is on its own.

Later on we're going to be looking into something called the XOR.

XOR or exclusive or would be true if both inputs are true.

So if left and right in this situation they're both true.

If we were using the XOR operator, the output would not be true it would be false.

Using the worksheet practise applying Boolean logic, complete part one part two and part three.

Resume once you finished.

Boolean logic part one solution.

So let's go through some of the solutions.

So here we've got light which is false and then not light which becomes true and light which is true, which then becomes false.

Next we've got the fruit and veggie example and it's only false when both our faults.

And it's true in the remaining scenarios.

And part three, write a logic expression that describes when the blue light is on, the expression should involve the red and green logic variables.

And it should be true when the blue light is on.

So the answer here was the logical expression is red and green because the light is only on when both red and green buttons are pressed.

Let's move on.

So Shannon makes a connection.

In 1940 Claude Shannon proved that logical expression and electrical circuits were switched with switches are equivalent.

So on the right hand side we've got a graphic there.

Can you describe the behaviour of a machine using logical expressions? Then you can build the machine with switching circuits.

So if the switches is off, or faults or zero, or it could be on or true, or one motion and activated.

So this is how we can represent it using the switches and here we've got left or right.

Logic gates and logic circuits.

Logical expressions, logic circuits can be represented using diagrams. Logic operations, logic gates can be represented using symbols.

And we use this abstract representation because we're not interested in the details of the circuit.

So if you have a look on the right hand side, you can see the not gate.

One easy way to remember that it's a not gate is as a triangle and after that triangle, you've got that little circle.

The and gate and the way I remember it is the word and ends with the letter D and in that circuit there, you've got a letter that looks like a big letter D.

And the last one is the or gate.

And it's a bit of a curve in terms of that drawing there.

The not gate only has one input.

Whereas the other gates both have two inputs.

They or have one output.

For example here, raining would therefore to be turned into not raining or therefore go out.

Motion and activated would mean open and left or right would mean open as well.

Use your worksheet to create and investigate a few logic circuits.

Resume once you're finished.

So how did you get on with task two? Let's have a look.

I actually enjoyed putting that circuit together and I thought it was going to be a really good task for you guys to be getting on with.

So hope you enjoyed it as much as I did.

Now with the and gate we realised previously that it's only true.

If both inputs are true.

The XOR gate, I did give you a heads up on this before, the result of the XOR operator is true, If exactly one of its inputs is true, but not both exclusive or.

And the circuit.

Now this circuit had two logic gates that made it complete and the motion was true and the light was false.

So if motion and not light therefore equals true.

The big picture hardware components are built of Boolean logic blocks and the latter are based on simple logical functions, such as And, Or and Invert, which is not.

These logical functions are implemented by switches.

And these switches control a physical substance such as water or electricity, which is used to send one or two or one of two possible signals from one switch to another one or zero outlet.

Now gates can be combined to form logic circuits that perform a specific function.

Logic circuits can be combined to form increasingly complex hardware components as you can see below.

Logic describes the function of hardware components.

Logic is binary.

Propositions are either true or false.

This is why in hardware instructions and data alike are represented in binary digits.

Here we have an example of a more complex circuit.

Now this circuit actually determines the winner in a rock paper scissors game.

Another complex circuit.

Circuits the add single binary digits.

And let's have a look at a real hardware component.

You can distinguish the individual areas that perform different functions.

As well as the intricate interconnections within them and between them.

So there's an example of the story of Intel.

The Google Doodle was created to celebrate the bicentennial of Boole's birth.

So that's the 200th birthday.

Now the letters light up based on different scenarios.

So the first example we've got here and it's complete is when x is true and y false.

So when x is true and y is false, the G a and y is not going to light up because in order for that to light up x has to be true and y has to be true.

The first o is lit up.

Why? Because we've got x and then we've got XOR and y.

So one of the inputs has to be true in all in order for that to be true.

So that's lit it's correct.

Next x OR y yes, one of the inputs is true the one's false.

We've got one or the other is lit up.

The l NOT y and as we can see y it's false.

So it's lit up and lastly the e is NOT x.

So it's not lit up because x is true.

Now you all going to have a couple of examples now.

So hope you will pay attention, right? First example, which letters will light up when x is false and y is true, have a go write your answers down.

Let's see how you got on.

So the vowels in that would light up.

So x XOR y would light up because one of the expressions is true.

X OR y would light up because one of the expressions is true and the e would light up because x is false.

I hope you gone well, we've got another couple of left here.

So the next expression is both x and y are faults.

Okay, so in this scenario, the l and the e would light up.

Why? Because x is false and y is false.

So NOT y or NOT x would light up.

Last one now, which letters will light up when both x and y are true.

Write answers down have a go.

Right, let's see how you got on.

So the letter g would light up because they're both true.

So x and y both the true so it would light up.

And then the x OR y would light up because both of them are true on x OR y.

If it's one or two it will light up.

The x or y is not lit.

Why? Because it's explicit.

So, because they're both true, it's not lit.

If one of them are true, it would be.

That's the end of the lesson.

I hope you enjoyed this lesson.

And I hope you got a better understanding of logic circuits, logic gates, and Boolean expressions.

If you'd like to share your work with us, which we always like to see.

Make sure you ask a parent or a carer.