GCSE COMPUTER SCIENCE
Computers
Logic Gates
Logic Gates
NOT
Logic gates are the fundamental building blocks of digital circuits.
There are three main logic gates.
AND OR
NOT Gate
The NOT gate reverses the input, so if a 1 is inputted into a NOT gate it
will output a 0.
1
0
NOT
AND Gate
The AND gate will only output a 1 if both inputs are 1, otherwise the
output will be 0.
1
1
1
AND
OR Gate
OR
The OR gate will output 1 if either or both of the inputs are set to 1.
1
1
0
Truth Tables
Learn about truth tables by watching this video.
Example
Truth tables are used to show all the possible outcomes for a logic problem.
Here is the truth table for an AND gate:
Activity 1
Go to the Logic Lab and recreate this simple logic diagram.
A Q
Use your completed diagram to help you complete this truth table for a NOT
gate:
Activity 2
Now recreate this logic diagram:
A B Q=(A OR B)
Use your completed diagram to help you complete this truth table for an OR
gate:
Logic Statements (1)
Logic statements can be used to represent logic diagrams using text.
Brunel University use a system to monitor their athletes when they are
training. They monitor heat rate and oxygen levels. These are Boolean
variables that are set to 0 when the values are within safe limits and 1 when
they are outside safe limits.
The microcontroller monitors the readings and sounds an alarm if both of
the readings are outside safe limits.
Example
Logic Statement
Alarm = Heart Rate AND Oxygen
Logic Statements (2)
Logic Statement
Alarm = Heart Rate AND Oxygen
INPUTS OUTPUT
Heart Rate Oxygen Alarm
0 0 0
0 1 0
1 0 0
1 1 1
Activity 3a
A greenhouse climate control system monitors the temperature and
humidity. These are Boolean variables that are set to 0 when the values are
within the set limits and 1 when they are outside these limits.
The microcontroller monitors the readings and opens a vent if any of the
readings are outside the set limits.
Give the logic statement the microcontroller uses to determine if the vent
should be open.
Logic
Statement
Activity 3b
INPUTS OUTPUT
Temperature Humidity Vent
Complete the truth table for the logic statement you wrote in Task 3a.
Activity 4a
A baby alarm system monitors heart rate, temperature and movement.
These are Boolean variables that are set to 0 when the values are within
safe limits and 1 when they are outside safe limits.
The microcontroller monitors the readings and sounds an alarm if any two
of the readings are outside safe limits.
Give the logic statement the microcontroller uses to determine if the alarm
should be sounded.
Logic
Statement
Activity 4b
INPUTS OUTPUT
Heart Rate Temperature Movement Alarm
Complete the truth table for the logic statement you wrote in Task 4a.
Activity 5a
A car alarm is set off if a window is broken or if it senses something moving
inside car, and if the engine is not on.
Give the logic statement the microcontroller uses to determine if the car
alarm should be sounded.
Logic
Statement
Activity 5b
INPUTS OUTPUT
Engine Window Movement Alarm
Complete the truth table for the logic statement you wrote in Task 5a.

Introduction to computer science-logic gates and circuits.ppt

  • 1.
  • 2.
    Logic Gates NOT Logic gatesare the fundamental building blocks of digital circuits. There are three main logic gates. AND OR
  • 3.
    NOT Gate The NOTgate reverses the input, so if a 1 is inputted into a NOT gate it will output a 0. 1 0 NOT
  • 4.
    AND Gate The ANDgate will only output a 1 if both inputs are 1, otherwise the output will be 0. 1 1 1 AND
  • 5.
    OR Gate OR The ORgate will output 1 if either or both of the inputs are set to 1. 1 1 0
  • 6.
    Truth Tables Learn abouttruth tables by watching this video.
  • 7.
    Example Truth tables areused to show all the possible outcomes for a logic problem. Here is the truth table for an AND gate:
  • 8.
    Activity 1 Go tothe Logic Lab and recreate this simple logic diagram. A Q Use your completed diagram to help you complete this truth table for a NOT gate:
  • 9.
    Activity 2 Now recreatethis logic diagram: A B Q=(A OR B) Use your completed diagram to help you complete this truth table for an OR gate:
  • 10.
    Logic Statements (1) Logicstatements can be used to represent logic diagrams using text. Brunel University use a system to monitor their athletes when they are training. They monitor heat rate and oxygen levels. These are Boolean variables that are set to 0 when the values are within safe limits and 1 when they are outside safe limits. The microcontroller monitors the readings and sounds an alarm if both of the readings are outside safe limits. Example Logic Statement Alarm = Heart Rate AND Oxygen
  • 11.
    Logic Statements (2) LogicStatement Alarm = Heart Rate AND Oxygen INPUTS OUTPUT Heart Rate Oxygen Alarm 0 0 0 0 1 0 1 0 0 1 1 1
  • 12.
    Activity 3a A greenhouseclimate control system monitors the temperature and humidity. These are Boolean variables that are set to 0 when the values are within the set limits and 1 when they are outside these limits. The microcontroller monitors the readings and opens a vent if any of the readings are outside the set limits. Give the logic statement the microcontroller uses to determine if the vent should be open. Logic Statement
  • 13.
    Activity 3b INPUTS OUTPUT TemperatureHumidity Vent Complete the truth table for the logic statement you wrote in Task 3a.
  • 14.
    Activity 4a A babyalarm system monitors heart rate, temperature and movement. These are Boolean variables that are set to 0 when the values are within safe limits and 1 when they are outside safe limits. The microcontroller monitors the readings and sounds an alarm if any two of the readings are outside safe limits. Give the logic statement the microcontroller uses to determine if the alarm should be sounded. Logic Statement
  • 15.
    Activity 4b INPUTS OUTPUT HeartRate Temperature Movement Alarm Complete the truth table for the logic statement you wrote in Task 4a.
  • 16.
    Activity 5a A caralarm is set off if a window is broken or if it senses something moving inside car, and if the engine is not on. Give the logic statement the microcontroller uses to determine if the car alarm should be sounded. Logic Statement
  • 17.
    Activity 5b INPUTS OUTPUT EngineWindow Movement Alarm Complete the truth table for the logic statement you wrote in Task 5a.