Download Binary Logic

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts
no text concepts found
Transcript
Lesson Objectives
• Understand and produce simple logic
diagrams using the operation NOT, AND
and OR
• Produce a truth table from a given logic
diagram
Logic Gates
• The digital computer uses an arrangement of
tiny electronic switches (transistors) called
logic gates connected together.
• These logic gates are used to manipulate the
signals within the processor.
• The arrangement of the switches in the logic
gate determines what it does to the input
signal.
• The logic gates are all connected to allow the
processor to receive and pass on electronic
signals
NOT
• There are three main logic gates.
• NOT:
– If 0 is input then it outputs 1;
– If 1 is input then it outputs 0.
INPUT
OUTPUT
0
1
1
0
OCR GCSE Computing
© Hodder Education 2013
Slide 3
INPUT
OUTPUT
Test it out
Go to http://logic.ly/ and click TRY ONLINE
1. Add a swtich
2. Add a NOT gate
3. Add a light bulb
When the switch is on = 0
When the switch is on = 1
NOT
A not gate only allows the
data through if the signal is
0
The switch is on (1) therefore the output
is off (0)
The switch is off (0) therefore the output
is on (1)
• AND:
– The AND gate outputs 1 only if both inputs are 1.
INPUT
A
INPUT
B
OUTPUT
0
0
0
0
1
0
1
0
0
1
1
1
OCR GCSE Computing
© Hodder Education 2013
Slide 6
INPUT A
OUTPUT
INPUT B
AND
• The output will only be on (1) if both input
are on (1)
• OR:
– The OR gate outputs 1 if either of the inputs is 1.
INPUT
A
INPUT
B
OUTPUT
0
0
0
0
1
1
1
0
1
1
1
1
OCR GCSE Computing
© Hodder Education 2013
Slide 8
INPUT A
OUTPUT
INPUT B
OR
• The output will only be on (1) if EITHER or
BOTH of the inputs are on (1)
Truth Tables
For every logic gate we can produce a truth table. This
shows all of the possible inputs and the resulting outputs
What kind of logic gate does this
diagram represent?
Inputs
Output
Good film?
Enough Money? Go to cinema?
No
No
N
Yes
No
No
No
Yes
No
Yes
Yes
Yes
Worksheet 1
• In the exam you may have to draw a logic
diagram, or a truth table.
• Complete the worksheet
• Make sure that you label each diagram
correctly with the different inputs and
outputs
Logic Circuits
• Computer systems are complicated things.
Often, a number of logic diagrams are used
together to create logic circuits.
AND
NOT
INPUT
INPUT A
A
INPUT
INPUT B
B
INPUT
INPUT C
C
OUTPUT
OUTPUT Q
Q
1
1
1
0
1
0
0
1
0
1
0
1
1
01
0
1
We can now
firstfill
fill
complete
in the
table
the of
output
with
all
by of
looking
the different
at input
combinations
C. then
As this is
the
the
output
the AND
gate.
This
output
of
an
inputs
NOT gate,
fromthe
A
output
B isisinput
the opposite
the gate
input
becomes
input
C and
which
into the of
NOT
AND
NOT
Worksheet 2
• Complete the work sheet on Logic Circuits
• Everyone should attempt the first 2
questions.
• Move on to questions 3 and 4 to stretch
yourself