# The output is - Ray Chambers

```LO: We’re learning to understand
how logic applies to us when building
applications.
A logic gate is a digital circuit which either
allows a signal to pass through it or to stop
it.
There are seven basic logic gates:
AND, OR, XOR, NOT,
NAND, NOR, and XNOR.
A NOT gate (inverter) has only
one input.
It reverses the logic state.
NOT
GATE
Input
HEAT DETECTOR
(ABOVE 20 C)
Output
NOT
GATE
CENTRAL
HEATING
Input
AND
GATE
Input
An AND gate can have two or more
inputs.
The output will be positive (true)
Output when both inputs (the input one
AND the input two) are positive
(true).
PERSON SENSOR
AND
GATE
ON SWITCH
c
FOR ALARM
BURGLAR
ALARM
Input
An OR gate can have two or more
inputs.
The output will be positive (True) if
at least one input is true.
OR
GATE
Input
Output
FRONT DOORBELL
SWITCH
OR
GATE
BACK DOORBELL
SWITCH
DOORBELL
• It is important to remember the rules of each
gate. For example
• The NOT gate has only one input and therefore only
has one output.
• The truth table below has been started for you,
see if you can finish it…
INPUT A
OUTPUT X
1
1
• Using these rules, see if you can finish the other
two truth tables.
• The output is &quot;true&quot; if either or both of the inputs
are &quot;true.&quot; If both inputs are &quot;false,&quot; then the
output is &quot;false.” – OR
• The output is &quot;true&quot; when both inputs are &quot;true.”
Otherwise, the output is &quot;false.“ - AND
Name the logic gates. Test it by answering True or false (Yes or No) for
each Input.
Good dancer
?
?
Good at sport
?
Blue eyes
Has a big nose
YES,
She/He is
OK
?
Task – Create a pattern of logic gates to find out if something is
suitable. It could be the perfect video game or CD to listen to.
• Now that you understand the rules, it time to
apply it to TouchDevelop.
• You’ve learnt about 3 different gates, you may
need to compare items before making algorithms
in the future.
• Can you think of things you might need to
compare in a game?
1. Using the lesson 10 video, create the 3 logic
gates as 3 separate programmes.
2. Publish the program with your name so that
your teacher can search or it.