video

Lesson video

In progress...

Loading...

Hello, my name is Mrs. Holborow, and welcome to Computing.

I'm so pleased you've decided to join me for the lesson today.

In today's lesson, we're going to be exploring how we can create logic circuits and represent circuits using circuit diagrams. Welcome to today's lesson from the unit, Boolean Logic.

This lesson is called Creating Logic Circuits, and by the end of today's lesson, you'll be able to create circuit diagrams to represent logic circuits that solve a problem.

Shall we make a start? We will be exploring these keywords during today's lesson.

Logic circuit, logic circuit, a combination of two or more logic gates used to represent a more complex logical statement.

Circuit diagram, circuit diagram, a picture used to represent a more complex logical statement.

This lesson is split into two parts.

We'll start by creating a circuit diagram from a logic statement, and then we'll move on to modify a circuit diagram.

Let's make a start by creating a circuit diagram for a logic statement.

A logic circuit uses two or more logic gate components to implement a more logical statement.

The circuit can be represented by drawing a circuit diagram.

So let's have a look at this example.

This example uses two logic gates, an OR gate and a NOT gate.

This circuit diagram represents the logic statement.

If I am not ill or I am not at work, then I will go to my dance class.

Recall the logic statement from the fire triangle.

Combustion is equal to oxygen and heat and fuel, so we've shortened that here to C is equal to O AND H AND F.

This statement contains more than one logical operator, so it requires a logic circuit.

To draw a circuit diagram, we need to follow these steps.

Start by identifying the gates that you will need.

So here in my statement, I can clearly see that I need two AND gates.

We then label the output.

So the output for this circuit is C, which stands for combustion, so I'm going to put that as the output of my second AND gate.

We then label the inputs and join the gates together.

So looking at my example, I've put O for oxygen and H for heat, as the inputs for my first AND gate.

The input for the second AND gate is the output from the first AND gate, and then the second input for the second AND gate is fuel, F.

Time to check your understanding.

A circuit diagram is used to: A, represent a logic circuit as a picture, B, debug why a circuit isn't working, or C, represent a logical expression as letters? Pause the video here whilst you have a think.

That's correct, a circuit diagram is used to represent a logic circuit as a picture, well done.

Here's a different logic statement from what we've seen already.

Q is equal to A OR B AND C.

Aisha's got a really good question.

"Does it matter which gate you draw first? What do you think? Maybe pause your video here and have a quick think.

Sofia's correct, "There is a specific order." When a logic circuit uses different gates, you need to evaluate them in a specific order.

So we start with the brackets, and then we use the NOT, followed by the AND, and then the OR.

Sofia is correct.

"This is just like in maths, when you follow the order of precedence." So, we've now been given the values of A, B, and C.

So A is equal to true, B is equal to false, and C is equal to false.

Let's have a look at the difference if we evaluated the gates in a different order.

So if we evaluated the AND first, so we've got Q is equal to A OR B in C in brackets, it would look like this.

So Q would be equal to true OR false AND false, which then evaluates to true OR false, which means it would be true.

Let's have a look at the difference if we evaluate the OR first.

So this time, we've got Q is equal to A OR B in brackets, and then AND C.

So now this results as Q is equal to true OR false AND false and then we've got true AND false, which means it will return as false.

So you can see the output is different if we evaluate different gates first.

So with the statement Q is equal to A OR B AND C, which gate should you draw first? Think about that order of precedence, and maybe pause the video whilst you have a quick think.

That's right, you should draw the AND gate first, because it has a higher operator precedence than the OR, so remember, the order is brackets, NOT, AND, and then OR.

Okay, let's try and draw this diagram together.

So we know we need to start off by drawing the AND gate.

So there's the AND gate, with our two inputs, which are B AND C.

We then draw our OR gate, which is A OR B AND C, so we've connected the two gates up together, and we've labelled the output as Q.

Time to check your understanding.

Which gate should you draw first for the statement, Q is equal to NOT A OR B? Is it A, NOT, B, OR, or C, it makes no difference? Pause the video here whilst you have a think.

Did you select NOT? Well done.

Remember the order of precedence, brackets, NOT, AND, and then OR.

We're now coming to our first task of today's lesson and you're doing a fantastic job, so well done.

I'd like you to draw a circuit diagram for each statement.

So Number 1 is Q is equal to NOT A OR B.

2, is Q is equal to NOT A OR B in brackets.

3, is Q is equal to A OR B OR C, and 4, is Q is equal to A AND B OR C AND D.

I've left the order of precedence on the slide for you, so remember to use that.

Pause the video here whilst you complete the activity.

How did you get on? Did you manage to create the circuit diagrams? Great work.

Let's have a look at some answers together.

So the first statement was Q is equal to NOT A OR B.

So NOT is evaluated first here, remember the order of precedence, so we draw the NOT gate first, and then we have the OR gate, so we have NOT A as the input for the NOT gate, and then we have B as the input for the OR gate and NOT A, and then we have the output as Q.

The next one, Number 2, was Q is equal to NOT A or B in brackets.

Now remember, the brackets are evaluated first, so this time, A OR B is evaluated first, we're going to draw the OR gate first with the inputs A OR B, and then we've got the NOT gate with the output Q again.

Okay, 3, Q is equal to A OR B OR C.

Here, both the gates are the same, they're both OR gates, so actually the order doesn't matter.

So in my diagram, I've got A OR B in my first gate, and then I've got C and then the result of A OR B going into the second OR gate, but if you've got it the other way round, it doesn't matter.

And then the last one, Number 4, was A AND B OR C AND D.

So both the ANDs are evaluated first, so I've got two AND gates, kind of side by side, and then their outputs are used as the inputs for the OR gate, and we've got it all labelled up correctly with the inputs and then the output Q.

Remember, if you need to make any corrections, you can always pause your video here and do that now.

We're now moving on to the second part of today's lesson, where we're going to modify a circuit diagram.

Sofia says, "Yay, pudding today is cake or ice cream!" I like those both too, Sofia, Jun says, "I'll have both please!" Sofia says, quite rightly, "You can only have one of them, or neither." Andeep says, "Nothing for me thank you." Sofia says, "It's a choice of cake OR ice cream, and I've used a NOT so that you can't choose both." Have a look at Sofia's logic diagram.

Has Sofia drawn the correct logic diagram to represent a valid pudding choice? Maybe pause the video here and have a think.

That's right, Sofia hasn't drawn the correct logic diagram, but how can we work that out? Using Sofia's current diagram, which of the following statements is true? A, no pudding is NOT allowed, B, choosing only cake is NOT allowed, or C, choosing both cake and ice cream is allowed? Maybe pause the video here and have a think.

That's right, Sofia's current diagram means that choosing only cake is NOT allowed, which it should be.

So, Sofia's diagram currently represents the logic statement, NOT cake OR ice cream.

Let's see if we can fix this.

The logic statement should be true if the choice is A, NOT cake in brackets, and NOT ice cream in brackets.

B, NOT cake and ice cream in brackets or C, NOT cake in brackets AND ice cream? Pause the video here whilst you have a think.

That's right, the correct logic statement is B, NOT cake AND ice cream, I.

e.

, you can't have both.

Sofia's fixed the problem, she's changed an OR to AND, and so the new circuit diagram now shows NOT cake AND ice cream.

Well done, you're doing a great job in the lesson so far.

It's now your turn to modify a circuit diagram.

So here we have the statement, phones and bags are not allowed in the dinner hall.

Modify Sofia's circuit diagram to correctly represent this logical statement.

So at the moment, we have an AND gate with phones and bags as an input, that goes into a NOT gate, with the output of, allowed.

There may be more than one way to represent the logic statement.

Pause the video here whilst you complete the activity.

How did you get on? Did you manage to create a circuit diagram for the solution? Let's have a look at some sample answers together.

So here's, solution A, remember the statement is phones and bags are not allowed in the dinner hall.

So here we have two NOT gates.

One has the input phones, and one has the input bags, and they're feeding into an AND gate, with the output, allowed.

So both no phones and no bags are allowed in the dinner hall.

An alternative solution is to use an OR gate, so phones OR bags, feeding into a NOT gate.

So, if you have a phone OR a bag OR both, they are not allowed into the dinner hall.

For the second part of Task B, I'd like you to explain the order of precedence, to state the order in which logic gates should be evaluated.

Pause the video here whilst you complete the activity.

How did you get on? Great work, let's have a look at a sample answer together.

So you were asked to explain the order of precedence to state the order in which logic gates should be evaluated.

Logic gates should be evaluated in a specific order of precedence, and it is as follows, brackets, NOT, AND, and then OR.

Okay, we've come to the end of today's lesson, and you have done a fantastic job, so well done.

Let's summarise what we have learned.

A logic circuit implements more complex logic by combining two or more logic gates.

You can draw a circuit diagram to represent a logic circuit.

The order in which you draw the logic gates in a diagram matters.

You must follow the order of precedence.

I hope you've enjoyed today's lesson, and I hope to see you again soon, bye!.