Basic Digital Logic
Download
Report
Transcript Basic Digital Logic
PERTEMUAN 3
Basic Digital Logic
Combinational Logic
Created for the D3 and S1 Terapan PNJ
Zulhelman
[email protected]
September2013
1
Basic Digital Logic 2
Review
2
Review
◊ Digital Electronics makes use of 2
states:
◊ Logic High, or “1”
◊ Logic Low, or “0”
3
Review
◊ There are 3 basic digital gates:
◊ AND
◊ OR
◊ NOT
4
Review
AND, where ALL inputs must be “1”
for the output to be “1”
OR, where ANY of the inputs can be “1”
for the output to be “1”
NOT (or the Inverter) where the
output is the opposite
(compliment) of the input.
5
Review Questions
What is the outcome of the following:
1
1
1
1
0
1
0
6
Truth Tables and Boolean
Notation
◊ Circuits with one
input
◊ Buffer
◊ Not
P=A
P=A
A P
0 0
1 1
A P
0 1
1 0
A
P
A
P
Basic AND / OR
◊ Circuits with two
Inputs
◊ AND P = A.B
A
0
0
1
1
B
0
1
0
1
P
0
0
0
1
◊ OR
A
0
0
1
1
B
0
1
0
1
P
0
1
1
1
P=A+B
A
B
P
A
B
P
Basic NAND / NOR
◊ Problems with two Inputs
◊ NAND
◊ NOR
P=
A
0
A.B 0
1
1
B
0
1
0
1
P
1
1
1
0
A
B
A
0
0
1
1
B
0
1
0
1
P
1
0
0
0
A
B
P=A+B
P
P
Basic XOR / XNOR
◊ Circuits with two Inputs:
◊ XOR P = A B
◊ XNOR
P=AB
A
0
0
1
1
A
0
0
1
1
B
0
1
0
1
B
0
1
0
1
P
0
1
1
0
P
1
0
0
1
A
B
A
B
P
P
Primitive gates
◊ All circuits can actually be made
using AND, OR and NOT gates if
required.
Exercise
Complete the truth
table for this circuit
and name the
equivalent primitive
function/gate.
A
B
A+B
A.B
A.B
P
0
0
0
0
1
0
0
1
1
0
1
1
1
0
1
0
1
1
1
1
1
1
0
0
Basic Digital Logic 2
Basic Combinational Logic, NAND
and NOR gates
13
Combinational Logic
◊ A circuit that utilizes more that 1
logic function has Combinational
Logic.
◊ As an example, if a circuit has an
AND gate connected to an Inverter
gate, this circuit has combinational
logic.
14
Combinational logic
◊ How would your describe the output
of this combinational logic circuit?
15
NAND Gate
◊ The NAND gate is the combination
of an NOT gate with an AND gate.
The Bubble in front of the gate is an inverter.
16
Combinational logic
◊ How would your describe the output
of this combinational logic circuit?
17
NOR gate
◊ The NOR gate is the combination of
the NOT gate with the OR gate.
The Bubble in front of the gate is an inverter.
18
NAND and NOR gates
◊ The NAND and NOR gates are very
popular as they can be connected in
more ways that the simple AND and
OR gates.
19
Exercise 1
Complete the Truth Table for the NAND and NOR Gates
NOR
NAND
Input
Output
Input
0
0
0
0
0
1
0
1
1
0
1
0
1
1
1
1
Output
Hint: Think of the AND and OR truth tables. The outputs for the NAND and NOR are inverted.
20
Basic XOR / XNOR
◊ Circuits with two Inputs:
◊ XOR P = A B
◊ XNOR
P=AB
A
0
0
1
1
B
0
1
0
1
A
0
0
1
1
P
0
1
1
0
B
0
1
0
1
A
B
P
1
0
0
1
A
B
P
P
Basic Digital Logic 2
Chips and Gates
22
Basic Digital Chips
◊ Digital Electronics devices are
usually in a chip format.
◊ The chip is identified with a part
number or a model number.
◊ A standard series starts with
numbers 74, 4, or 14.
◊
◊
◊
◊
7404 is an inverter
7408 is an AND
7432 is an OR
4011B is a NAND
23
Chips
◊ Basic logic chips
often come in 14-pin
packages.
◊ Package sizes and
styles vary.
◊ Pin 1 is indicated
with a dot or halfcircle
◊ Numbers are read
counter-clockwise
from pin 1 (viewed
from the top)
Pin 14
Pin 8
Pin 1
Pin 7
24
Chips
◊ Chips require a
voltage to function
Pin 14
Pin 8
Pin 1
Pin 7
◊ Vcc is equal to 5
volts and is typically
pin 14
◊ Ground is typically
pin 7
25
Chips – Specification Sheet
Voltage
The voltage and
ground pins must be
connected for the
device to function.
Check the specification
sheet to make sure.
Ground
Diagram from http://www.onsemi.com
26
Chips – Specification Sheet
A
B
C
D
Diagrams from http://www.onsemi.com
27
Wiring a chip
IN
IN
Vcc
OUT
Vcc
Probe
28
Example
◊ Consider a buzzer which sounds
when :
◊ The lights are on and
A
Alarm
B
system
◊ The door is open and
C
◊ No key is in the ignition
Variable
Value
Situation
A
1
Lights are on
0
Lights are off
B
1
Door is open
0
Door is closed
C
1
Key is in ignition
0
Key is out of ignition
P
1
Buzzer is on
0
Buzzer is off
P
Active
Example
◊ Truth Table
◊ A Truth Table can
be used to show
the relationships
between :
◊ the 3 inputs and
◊ the single output
A
B
C
P
0
0
0
0
0
0
1
0
0
1
0
0
0
1
1
0
1
0
0
0
1
0
1
0
1
1
0
1
1
1
1
0
lights A
door B
◊ Implementation
as a circuit using
logic gates
keys C
P buzzer
Useful Resources
◊
◊
◊
◊
Textbooks on Digital Electronics (used is ok!)
Electronics Workbench or other electronic simulation
software
Craig Maynard’s Virtual Vulcan
The following web sites:
◊
◊
◊
http://learnat.sait.ab.ca/ict/digi240_godin/default.htm
http://learnat.sait.ab.ca/ict/cmph200/Default.htm
http://learnat.sait.ab.ca/ict/cmph200_godin/default.htm
◊
◊
◊
http://focus.ti.com/docs/logic/logichomepage.jhtml
http://www.onsemi.com
http://www.national.com/
◊
◊
◊
http://www.play-hookey.com/digital/
http://www.crhc.uiuc.edu/~drburke/databookshelf.html
http://www.digikey.ca/
31
Lab Exercise
◊ Using the experimenter’s boards,
connect the circuit provided to you
in the following pages.
32
Layout of the SK-10
Experimenter's Board
33
Layout of the SK-10
Experimenter's Board
Flat Side
7400
Wires
34
Logic Diagram of Lab
35
End of Basic Digital Logic 2
Copyright WCRS and Paul Godin
For non-profit use only
36