Professional Documents
Culture Documents
Basic Digital Logic 1 Basic Gates: Created For The Western Canadian Robotics Society
Basic Digital Logic 1 Basic Gates: Created For The Western Canadian Robotics Society
Basic Gates
Paul Godin
godinp@telusplanet.net
January 2004
1
Basic Digital Logic 1
◊ This presentation is about the basic
concepts of Digital Electronics:
◊ Basic Logic Concepts
◊ Basic Logic Functions
◊ Logic Symbols
◊ Truth Tables
2
Basic Digital Logic 1
3
Digital Signals
◊ Digital Signals have two basic states:
1 (logic “high”, or H, or “on”)
0 (logic “low”, or L, or “off”)
4
Binary
In Binary, there are only 0’s and 1’s. These
numbers are called “Base-2” ( Example: 010 ) 2
Base 2 = Base 10
000 = 0
Binary to Decimal
001 = 1
010 = 2
We count in “Base-10”
011 = 3
100 = 4
(0 to 9)
101 = 5
110 = 6
111 = 7
5
Binary as a Voltage
Voltages are used to represent logic values:
6
A Simple Switch
◊ Here is a simple switch used to
provide a logic value:
Vcc Vcc
Vcc, or 1 Gnd, or 0
◊ AND
◊ OR
◊ NOT
8
The AND function
◊ The AND function:
◊ If all the inputs are high is the output is
high
◊ If any input is low, the output is low
9
AND Logic Symbol
Inputs Output
10
AND Logic Symbol
0
Inputs 0 Output
0
Determine the output
Animated Slide
11
AND Logic Symbol
0
Inputs 0 Output
1
Determine the output
Animated Slide
12
AND Logic Symbol
1
Inputs 1 Output
1
Determine the output
Animated Slide
13
AND Truth Table
◊ To help understand the function of a
digital device, a Truth Table is used:
Input Output
Every possible
input combination 0 0 0
0 1 0
1 0 0
1 1 1
AND Function
14
AND Gates
◊ It is possible to have AND gates
with more than 2 inputs. The same
logic rules apply – “if any input…”
15
The OR function
◊ The OR function:
◊ if any input is high, the output is high
◊ if all inputs are low, the output is low
16
OR Logic Symbol
Inputs Output
17
OR Logic Symbol
0
Inputs 0 Output
0
Determine the output
Animated Slide
18
OR Logic Symbol
0
Inputs 1 Output
1
Determine the output
Animated Slide
19
OR Logic Symbol
1
Inputs 1 Output
1
Determine the output
Animated Slide
20
OR Truth Table
◊ Truth Table
Input Output
0 0 0
0 1 1
1 0 1
1 1 1
OR Function
21
The NOT function
◊ The NOT function:
◊ If any input is high, the output is low
◊ If any input is low, the output is high
Input Output
23
NOT Logic Symbol
Output
Input 0 1
Animated Slide
24
NOT Logic Symbol
Output
Input 1 0
Animated Slide
25
NOT Truth Table
◊ Truth Table
Input Output
0 1
1 0
NOT Function
26
REVIEW
◊ Digital Electronics works in Binary:
27
REVIEW
◊ There are 3 basic gates:
28
Exercise 1
1. Least Challenging
◊ 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.
29
Exercise 2
2. A bit challenging:
◊ Convert the binary numbers to their
base-10 value:
◊ 0102= ___10
◊ 01102=____10
◊ 10012 = ____10
30
Exercise 3
3. Challenging
◊ A robot has a motor that:
◊ goes forward when it gets a logic 1
◊ stops when it gets a logic 0
◊ There is a touch sensor switch at the
front of the robot.
31
Exercise 4
4. More Challenging
◊ A robot has two touch sensors and one
motor. When pushed, the sensors
produce a logic 1. The motor goes
forward with a logic 0 and backward
with a logic 1.
◊ If both sensors sense a touch, go
backward. If only one, or none of the
sensors sense a touch, go forward.
◊ Draw the sensors, motor and the logic
needed. (Hint: do a truth table)
32
Exercise 5
5. Expert Level
◊ A robot has three touch sensors (left, right,
middle). When pushed, they produce a logic 0.
The robot has two motors (left and right). A
logic 1 will make them go forward and a logic 0
will make them go backward.
33
Exercise 5
Inputs Outputs
5. Continued
L C R L R
0 0 0 0 0
0 0 1 0 1
0 1 0 1 1
0 1 1 1 1
1 0 0 1 0
1 0 1 1 1
1 1 0 1 1
1 1 1 1 1
34
End of Basic Digital Logic 1