Basic Digital Logic 1

Download Report

Transcript Basic Digital Logic 1

Basic Digital Logic:
AND, OR and NOT gates
©Paul Godin
Created August 2007
Basic Gates 1.1
Last Update Sept 2013
Digital Logic: Introduction
◊
The foundation of digital systems is the ability to make
logic-based decisions on input states.
◊
Boolean Algebra is a relatively simple mathematic form
based on logic functions comprising of two states: true
(logic 1) or false (logic 0). It is used to describe output
states based on a set of input states.
◊
Boolean mathematics has been around for over a
hundred years but much of it is well suited to digital
systems.
Boolean logic is used in internet search engines.
Basic Gates 1.2
Truth Tables
Truth tables describe the function of a digital
device. They show the output states based on
input states.
Every possible
input combination
Input
Output
0
0
0
0
1
1
1
0
1
1
1
1
Basic Gates 1.3
Basic Digital Logic Functions
Digital logic is based on 3 primary functions (the
Basic Gates):
AND
OR
NOT
Basic Gates 1.4
The AND Operation
AND
All inputs must be True for the output to be True.
◊ Other ways to describe AND:
◊ If all inputs are 1 the output is 1
◊ If any input is 0, the output is 0
◊ “If this input AND this input are 1, the output is 1”
Basic Gates 1.5
AND Logic Symbol
Inputs
Output
If all inputs are 1, the output is 1
If any input is 0, the output is 0
Basic Gates 1.6
AND Logic Symbol
Inputs
0
Output
0
Determine the output
Basic Gates 1.7
AND Logic Symbol
Inputs
0
Output
1
Determine the output
Basic Gates 1.8
AND Logic Symbol
Inputs
1
Output
1
Determine the output
Basic Gates 1.9
AND Truth Table
Input
Output
0
0
0
0
1
0
1
0
0
1
1
1
AND
Basic Gates 1.10
AND Gates
It is possible to have AND gates with more
than 2 inputs. The same logic rule applies – all
inputs must be 1 for the output to be 1.
Basic Gates 1.11
AND Gates
◊ IEEE symbol for an AND gate
&
◊ Boolean equations for an AND gate:
A●B = x
AB = x
The AND operation operates similarly to multiplication.
Basic Gates 1.12
The OR Operation
OR
If any input is True, the output is True
Other ways to describe OR:
◊ if any input is 1, the output is 1
◊ if all inputs are 0, the output is 0
◊ “If this input OR this input is 1, the output is 1”
Basic Gates 1.13
OR Logic Symbol
Inputs
Output
If any input is 1, the output is 1
If all inputs are 0, the output is 0
Basic Gates 1.14
OR Logic Symbol
Inputs
0
Output
0
Determine the output
Basic Gates 1.15
OR Logic Symbol
Inputs
0
Output
1
Determine the output
Basic Gates 1.16
OR Logic Symbol
Inputs
1
Output
1
Determine the output
Basic Gates 1.17
OR Truth Table
Input
Output
0
0
0
0
1
1
1
0
1
1
1
1
OR
Basic Gates 1.18
OR Gates
It is possible to have OR gates with more than 2 inputs.
The same logic rule applies – If any input is 1, the
output is 1.
Basic Gates 1.19
OR Gates
◊ IEEE symbol for an OR gate
≥1
◊ Boolean equation for an OR gate:
A+B = x
The OR operation operates similarly to Addition.
Basic Gates 1.20
The NOT Operation
NOT
The output is the opposite state of the input.
◊Other ways to describe NOT:
◊ If any input is 1, the output is 0
◊ If any input is 0, the output is 1
The NOT function is often called INVERTER or
COMPLIMENTARY.
Basic Gates 1.21
NOT Logic Symbol
Input
Output
If the input is 1, the output is 0
If the input is 0, the output is 1
Note: The “bubble” on the output is considered the NOT function.
Basic Gates 1.22
NOT Logic Symbol
Input
0
Output
Determine the output
Basic Gates 1.23
NOT Logic Symbol
Input
1
Output
Determine the output
Basic Gates 1.24
NOT Truth Table
Input
Output
0
1
1
0
NOT
Basic Gates 1.25
NOT Gates
◊ IEEE symbol for a NOT gate:
1
◊ Boolean for a NOT function:
A = x (overbar symbol)
A’ = x (prime symbol)
Note: The triangle symbol on the output is considered the NOT function
Basic Gates 1.26
Alternate Symbols
◊ The NOT is the “bubble” on the gate.
◊ Alternate symbols for the NOT gate:
1
Basic Gates 1.27
Review 1
◊ There are 3 basic gates:
◊ AND, where all inputs must be high for a high output
◊ OR, where any input must be high for a high output
◊ NOT, where the output is the opposite (compliment)
of the input
Basic Gates 1.28
Review 2
AND Logic Symbol
OR Logic Symbol
NOT (or Inverter) Logic Symbol
Basic Gates 1.29
Review 3
A●B=Y
AB = Y
A AND B = Y
A+B=Y
A OR B = Y
A=Y
A’ = Y
NOT A = Y
Basic Gates 1.30
Exercise 1
What is the outcome of the following:
1
1
1
1
0
1
0
Basic Gates 1.31
Exercise 2
Complete the sentences:
◊ If all inputs of an OR gate are low, the output
is_________
◊ If any input of an AND gate is low, the output
is _________
◊ The output of a NOT gate is always the
___________ of the input.
Basic Gates 1.32
Exercise 3
Complete the tables
≥1
Input
0
0
0
1
1
0
1
1
Input
&
0
0
0
1
1
0
1
1
Output
Output
Basic Gates 1.33
Exercise 4
Draw the logic equivalent of the AND and the OR
gates using switches.
Basic Gates 1.34
Exercise 5
A vehicle has 2 proximity sensors and one motor. When
triggered, the sensors produce a logic 1.
The motor goes forward with a logic 0 and stops with a logic 1.
If both sensors sense an object, stop. If only one, or none of
the sensors sense an object, go forward.
Draw the sensors, motor and the logic needed. (Hint: do a truth
table)
Basic Gates 1.35
End
©Paul R. Godin
prgodin°@ gmail.com
Basic Gates 1.36