Presentation is loading. Please wait.

Presentation is loading. Please wait.

Mastering Logic Gates and Truth Tables

Similar presentations


Presentation on theme: "Mastering Logic Gates and Truth Tables"— Presentation transcript:

1 Mastering Logic Gates and Truth Tables
What is Boolean? Logic Gates – Types Corresponding Truth tables Drawing circuit diagrams VIDEOS included (demos of logic gate) using logic.ly/demo *Also see presentations on boolean logic Purchase the full teaching package (KS3, GCSE and A Level topics from

2 Did you know? Have you ever looked inside your computer? The internal circuitry of computers is a bit of a mystery. Have a look at the mother board on the right. Logic Gates play a big role in understanding the circuitry of computers. Digital systems are basically constructed using logic gates that operate using Boolean logic Source: Wires N Code An Electronics Project Website

3 What is Boolean?! In computer science, the Boolean data type is a data type, having two values (usually denoted true (1) and false (0), intended to represent the truth values of logic and Boolean algebra. It is named after George Boole, who first defined an algebraic system of logic in the mid 19th century. Example: Data type: Seat booked? Options are True (1) or False (1)

4 … and what is a logic gate?
In electronics, a logic gate is an idealized or physical device implementing a Boolean function; that is, it performs a logical operation on one or more logical inputs, and produces a single logical output. Logic gates are primarily implemented using diodes or transistors acting as electronic switches, but – and this is interesting - can also be constructed using vacuum tubes, electromagnetic relays (relay logic), fluidic logic, pneumatic logic, optics, molecules, or even mechanical elements. *Arithmetic Logic Units **Central Processing Unit (the brain of the computer) Logic circuits include such devices as ALUs*, computer memory, and complete CPU** chips, which may contain more than 100 million gates

5 Logic Gates and Circuitry
Learning about logic gates will give you an insight into the circuitry of computers and how they work. You’ll remember that computers don’t understand English – all they can make sense of is: Binary (0) and (1) as computers are basically comprised of millions of on and off switches. In modern practice, most gates are made from field-effect transistors (FETs), particularly MOSFETs (metal–oxide–semiconductor field-effect transistors).

6 Hardware Design – how would you illustrate a circuit with its components?
If you tried to draw the circuit on the right on paper (as it is) it probably wouldn’t make much sense. You may understand what it means because it’s your circuit, but other people would struggle! Common convention uses a series of symbols to stand for the various types of logic gates. The diagram on the right is a circuit diagram showing 3 inputs and 2 outputs. You can combine logic gates to do clever things with inputs and outputs. But …what do the funny shapes mean?

7 Types of Gates And Or Not
If you are a beginner to all this, you probably would start with knowing the three main gates: the AND gate, the OR gate and the very clever NOT gate. The symbolic representations for each of these gates is shown below. And Or Not Yes, it would be helpful if the AND and OR gates didn’t look quite so similar, but that’s just the way it is now. You would do well to find an interesting way of remembering what the AND and OR gates look like, and test yourself to make sure you don’t get confused.

8 The And Gate – remembering the shape!
Memory by association really works. The wackier and more creative the association the more likely you are to remember what the gates stand for! Here’s one (completely ridiculous way but it worked for me) Try and think of your own! And This gate is ROUNDED and looks a little like the door of a cave (if rotated). A year ago I was in a desert – there was loads of SAND, and there were caves nearby in which the (biblical) dead sea scrolls were found. AND!

9 The Or Gate– remembering the shape!
Memory by association really works. The wackier and more creative the association the more likely you are to remember what the gates stand for! Here’s one (completely ridiculous way but it worked for me) Try and think of your own! Or Thor was a chap that was from space. The gate above looks a little like a space ship. THOR ….from outer space, and so when I see a spaceship shaped gate, I think: THOR……….and remember it’s the OR gate.

10 Other types of gates NAND NOR XOR XNOR
There are other types of gates which make use of the AND or OR symbolic representations within them NAND NOR XOR XNOR

11 What do these gates do? AND GATE
Watch the video below, or create the diagram for yourself in logic.ly/demo and see what happens. Note that the gate below is the AND gate. Input A If InputA AND InputB are on, then the bulb will be on (Boolean value = 1) Connect the toggle switches (on the left) to the AND gate (centre) and then the AND gate to the bulb (output) You’ll notice something quite interesting: The bulb only lights when both Input 1 AND Input 2 are on. Input B The AND logic gate performs this function and produces an output depending on the inputs. If Input B is ON (this represents a 1) If INPUT A = 1 (on) and INPUT B = 1 (on), Only then with the output also be on (1)

12 What do these gates do? OR GATE
Watch the video below, or create the diagram for yourself in logic.ly/demo and see what happens. Note that the gate below is the OR gate. Input A If InputA OR InputB are on, then the bulb will be on (Boolean value = 1) Connect the toggle switches (on the left) to the OR gate (centre) and then the OR gate to the bulb (output) You’ll notice something quite interesting: The bulb lights up when either Input 1 OR Input 2 are on. Input B The OR logic gate performs this function and produces an output depending on the inputs. If Input B is ON (this represents a 1) If INPUT A = 1 (on) OR INPUT B = 1 (on), the output also be on (1)

13 The NOT gate acts as an inverter
Watch the video below, or create the diagram for yourself in logic.ly/demo and see what happens. Note that the gate below is the NOT gate. Input A If InputA OR InputB are on, then the bulb will be on (Boolean value = 1) Connect the single input (toggle switch on the left) to the NOT gate, and then connect the NOT gate to the bulb. Input A NOT GATE You’ll notice a pattern. If the switch is on (1) then the bulb is off (0). And if the switch is off (0), then the bulb goes on (1) Input B The NOT gate tends to invert the signal that is coming through to produce the opposite signal. If Input A = 0 (off) then the bulb is on! If Input B is ON (this represents a 1) If INPUT A = 1 then NOT A = 0 If INPUT A = 0 then NOT A = 1

14 Use of a truth table – weird examples
Each of the gates have a corresponding TRUTH TABLE. The truth table is an effective way of displaying the inputs and outputs of a gate using binary (Boolean values) Suppose the desired outcome was to PUT YOUR FAITH in Person x. You may come up with two factors that are crucial in determining whether or not you should put your faith in this person. Variable A = X must be Good AND Variable B = X must be Divine Variable A Variable B Final Output X is good X is divine Believe! X is not good Don’t believe! X is not divine You’ll note that you have made use of an AND gate - both conditions must be true for the output to be favourable.

15 Another example – this time for the OR
Your computing teacher is planning a trip to Bletchley Park. It is only, unfortunately, for the students that managed to achieve an A OR a B in their A Level Exams. What would the truth table look like? Achieved an A Achieved a B Going on Trip? No Nope Yes Yes! You’ll note that you have made use of an OR gate - EITHER CONDITION can be true for a favourable response.

16 Using truth tables And A A*B B
Each of the gates have a corresponding TRUTH TABLE. The truth table is an effective way of displaying the inputs and outputs of a gate using binary (Boolean values) And A ? A*B ? B ? Note: The And gate is associated with multiplication ?

17 Using truth tables Or A A+B B
Each of the gates have a corresponding TRUTH TABLE. The truth table is an effective way of displaying the inputs and outputs of a gate using binary (Boolean values) Or A ? A+B ? B ? Note: The OR gate is associated with addition ?

18 Using truth tables Not A Not A
Each of the gates have a corresponding TRUTH TABLE. The truth table is an effective way of displaying the inputs and outputs of a gate using binary (Boolean values) Not A Not A ? ?

19 Using truth tables NAND A __ AB B
This is a NOT-AND gate which is equal to an AND gate followed by a NOT gate.  The outputs of all NAND gates are high if any of the inputs are low. The symbol is an AND gate with a small circle on the output. The small circle represents inversion. NAND A ? __ AB ? B ? ?

20 Using truth tables NOR A ____ A+B B
This is a NOT-OR gate which is equal to an OR gate followed by a NOT gate. The outputs of all NOR gates are low if any of the inputs are high. The symbol is an OR gate with a small circle on the output. The small circle represents inversion NOR A ____ A+B ? B ? ? ?

21 Using truth tables XOR A B
The 'Exclusive-OR' gate is a circuit which will give a high output if either, but not both, of its two inputs are high. An encircled plus sign () is used to show the EOR operation. XOR A ? ? B ? ?

22 Using truth tables XNOR A B
The 'Exclusive-NOR' gate circuit does the opposite to the EOR gate. It will give a low output if either, but not both, of its two inputs are high. The symbol is an EXOR gate with a small circle on the output. The small circle represents inversion. XNOR A ? ? B ? ?

23 Sample Questions *taken with permission from OCR (Specimen paper)

24 Sample Questions *taken with permission from OCR (Specimen paper)

25 Sample Questions *taken with permission from OCR (Specimen paper)

26 Answers *taken with permission from OCR (Specimen paper)


Download ppt "Mastering Logic Gates and Truth Tables"

Similar presentations


Ads by Google