0% found this document useful (0 votes)
67 views21 pages

24 - Logic Gates and Truth Tables

This document discusses logic gates and binary representation in computing. It defines binary as using 1 and 0 to represent electricity being present or absent. Logic gates take binary inputs and output another binary value. The three basic logic gates are AND, OR, and NOT. AND outputs 1 only if both inputs are 1. OR outputs 1 if either input is 1. NOT inverts the single input value. Truth tables show the output for each logic gate given different input combinations. Logic circuits can be constructed using these basic gates.

Uploaded by

nandha87
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
67 views21 pages

24 - Logic Gates and Truth Tables

This document discusses logic gates and binary representation in computing. It defines binary as using 1 and 0 to represent electricity being present or absent. Logic gates take binary inputs and output another binary value. The three basic logic gates are AND, OR, and NOT. AND outputs 1 only if both inputs are 1. OR outputs 1 if either input is 1. NOT inverts the single input value. Truth tables show the output for each logic gate given different input combinations. Logic circuits can be constructed using these basic gates.

Uploaded by

nandha87
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 21

Computational Thinking, Algorithms & Programming Sunday, 29 December 2019

Logic Gates
Learning Objective: To be able to demonstrate an understanding of
logic gates and the notation/diagrams used.
Computer Science

Success Criteria:
1. I can complete a logic gate diagram.
2. I can write a logic statement.
3. I can create truth tables for AND, OR and NOT gates.
4. I can use correct logic notation.

(J276/02)
What is binary?
Computational Thinking, Algorithms & Programming

• Binary is the representation of the ‘presence’ of electricity


• If present or ‘on’ we use a: 1
Computer Science

• If absent or ‘off’ we use a: 0


• We can use this idea to change 1 and 0 states through the use of
logic gates
• Logic Gates take inputs and covert them to an output

You can see why we need binary, logic and transistors in this video
here: https://www.youtube.com/watch?v=GdqbLmdKgw4

(J276/02)
Key Words
Computational Thinking, Algorithms & Programming

• Logic Gate • AND


• Transistor • OR
Computer Science

• Bit (Binary Digit) • NOT (Inverter)


• Logic Circuit •A⋀B
•A⋁B
•¬A

(J276/02)
Logic Gates
Computational Thinking, Algorithms & Programming

• Used to change bits and perform calculations within a computer


• Created by using transistors
• There are 3 basic logic gates:
Computer Science

AND OR NOT

• Every logic circuit can be made up from these 3 logic gates

(J276/02)
Truth Tables
Computational Thinking, Algorithms & Programming

• The output of Logic Gates can be shown through a Truth Table


• The Truth Table shows what an output will be, based on the inputs

Computer Science

You will need to know the basic truth tables


• You will need to be able to construct a truth table from a logic statement

(J276/02)
Input An AND gate can have two or more
inputs.
AND The output will be positive (true)
Computational Thinking, Algorithms & Programming

GATE
Output when both inputs (the input one
Input AND the input two) are positive
(true).
Computer Science

PERSON SENSOR

AND BURGLAR ALARM


GATE
ON SWITCH
c
FOR ALARM

(J276/02)
The AND Gate
Computational Thinking, Algorithms & Programming

• Only has an output of 1 if both A AND B are 1


• We write this as: A ⋀ B
Computer Science

(J276/02)
Input An OR gate can have two or more
OR inputs.
GATE The output will be positive (True) if
Computational Thinking, Algorithms & Programming

Output at least one input is true.


Input

FRONT DOORBELL
Computer Science

SWITCH
OR
GATE DOORBELL
BACK DOORBELL
SWITCH

(J276/02)
The OR Gate
Computational Thinking, Algorithms & Programming

• Has an output of 1 if either of A OR B are 1


• We write this as: A ⋁ B
Computer Science

(J276/02)
A NOT gate (inverter) has only
one input.
NOT It reverses the logic state.
Computational Thinking, Algorithms & Programming

GATE
Input Output

HEAT DETECTOR NOT CENTRAL


Computer Science

(ABOVE 20 C) GATE HEATING

(J276/02)
ON or OFF ?
BEDROOM
Computational Thinking, Algorithms & Programming

SENSOR
OR
GATE AND
FRONT ROOM GATE BURGLAR
SENSOR ALARM
Computer Science

ON SWITCH
FOR ALARM

(J276/02)
The NOT Gate
Computational Thinking, Algorithms & Programming

• Has an 1 input only


• It INVERTS or swaps the input
Computer Science

• We write this as: ¬ A

(J276/02)
Is the Final Output ON (True)
or OFF (false) ?
Computational Thinking, Algorithms & Programming

OR
GATE AND
GATE
Computer Science

FINAL
AND OUTPUT
NOT GATE ON ? OFF ?
GATE

(J276/02)
Computational Thinking, Algorithms & Programming
1.
Activity 1: 4.
ON OFF
OFF
? ON
?
ON
5.
2.
ON
Computer Science

OFF
ON ?
ON ?
OFF 6.

ON
3.
OFF ?
ON
OFF ? The output is
ON or OFF ?
OFF

(J276/02)
7. Activity 1: 10.
OFF ON
?
Computational Thinking, Algorithms & Programming

ON
OFF OFF

8. ON
ON
ON
ON ? OFF ?
Computer Science

OFF ON

9. OFF

ON
ON OFF
ON
ON ?
ON
ON ON
The output is
ON or OFF ?

(J276/02)
Computer Science

(J276/02)
Computational Thinking, Algorithms & Programming

• Complete the Table


Activity 3: Truth Tables
Activity 3 – Answers
Computational Thinking, Algorithms & Programming

• Complete the Table


Computer Science

• Well done spotting it was an OR gate!

(J276/02)
Activity 4: Truth Tables
Computational Thinking, Algorithms & Programming

• Create the Truth Table for the following:


Computer Science

A⋀(BVC)

• Have a go yourself and then check your steps with the PowerPoint

(J276/02)
Computer Science

(J276/02)
Computational Thinking, Algorithms & Programming
Activity 4
• Here is the diagram
A⋀(BVC)
Activity 4 – Answer
Computational Thinking, Algorithms & Programming

A⋀(BVC)
• Here is the empty truth table
Computer Science

A B C BVC A⋀(BVC)

(J276/02)
Activity 4 – Answer
Computational Thinking, Algorithms & Programming

A⋀(BVC)
• Here is the empty truth table
Computer Science

(J276/02)

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy