EEB341.Chapter02 DigitalCircuits PART1
EEB341.Chapter02 DigitalCircuits PART1
N Ditshego
Lecturer
Department of Electrical Engineering
University of Botswana
EEB 341
DIGITAL ELECTRONICS
CHAPTER 2
DIGITAL CIRCUITS
1
Lecture Overview
Analog vs Digital
Logic Variables
Logic Functions
AND, OR, NOT
Combining Functions
Truth Tables
Logic Gates
Logic Networks
Analysis using Truth Tables
Analysis using Timing Diagrams
Equivalent Logic Networks
2
Analogue vs Digital
Analogue Circuits: Signals may take on a continuous range of
values between some minimum and maximum levels
Classic example: Record player, Analogue Telephone
Recent examples: Terrestrial Television, FM Radio, AM radio
3
Analogue vs Digital - resolution
Assume we have an analogue signal, and we want to represent it
digitally with only two possible values (1 bit)
1200
1000
800
600
Analogue
400
200
0
0 50 100 150 200 250 300 350 400
1200
1000
800
Analogue
600
2 Values
400
(1-bit digital)
200
0
0 50 100 150 200 250 300 350 400
-200
4
Analogue vs Digital - resolution
Assume we have an analogue signal, and we want to represent it
digitally with only four possible values (2 bits)
1200
1000
800
600
Analogue
400
200
0
0 50 100 150 200 250 300 350 400
1200
1000
800
Analogue
600
4 Values
400
(2 bit digital)
200
0
0 50 100 150 200 250 300 350 400
-200
5
Analogue vs Digital - resolution
Assume we have an analogue signal, and we want to represent it
digitally with 16 values (4 bits)
1200
1000
800
600
Analogue
400
200
0
0 50 100 150 200 250 300 350 400
12 00
10 00
80 0
A n a lo g u e
60 0
16 Values
40 0 (4 bit digital)
20 0
0
0 50 10 0 15 0 20 0 25 0 30 0 35 0 40 0
-200
6
Analogue vs Digital - sample rate
Assume we have an analogue signal, and we want to represent it
digitally with 16 values (4 bits), sampling at 10 Hz
1200
1000
800
600
Analogue
400
200
0
0 50 100 150 200 250 300 350 400
1200
1000
800 A n a lo g u e
600
16 Values
400
(4 bit digital)
200 10 Hz
0
0 50 100 150 200 250 300 350 400
7
Analogue vs Digital - sample rate
Assume we have an analogue signal, and we want to represent it
digitally with 16 values (4 bits), sampling at 100 Hz
1200
1000
800
600
Analogue
400
200
0
0 50 100 150 200 250 300 350 400
1200
1000
800 A n a lo g u e
600
16 Values
400
( 4 b it digital)
100 Hz
200
0
0 50 100 150 200 250 300 350 400
8
Logic Gates
9
10
Binary Logic: Signals and Functions
Binary signals can assume only two possible values
0 or 1
OFF or ON
LOW or HIGH
FALSE or TRUE
11
Example: Light Controlled by Switch
12
Binary Switch: OFF or ON
13
AND Function
14
OR Function
16
NOT Function
Inverting Circuit
Closed switch will short circuit light and prevent current from flowing through it
Extra series resistor to ensure closed switch does not short-circuit power supply!
The light will turn on when the switch is off.
If x = 0 (switch is off), then L = 1 (light is on)
If x = 1 (switch is on), then L = 0 (light is off)
OR: x y
AND: x y
19
Truth Tables
Logic function also be represented with a table, called a truth table
x1
(a) AND gate x1 x2
x2
x1
(b) OR gate x1 + x 2
x2
22
Logic Gates
Logic gates with multiple inputs
x1
x2
(a) AND gate with n inputs x1 x2 xn
xn
x1
x2
(b) OR gate with n inputs x1 + x2 + + xn
xn
23
Logic Network
The three basic logic functions (AND, OR and NOT) can be
combined to form logic functions of any complexity
Any logic function can be implemented with a logic circuit consisting
of a network of logic gates
x1
x2
= x 1 + x2 x3
x3
24
Analysis of a Logic Network
Analysis : The task of determining the logic function of an existing
logic network
Synthesis : The task of designing a new logic network that will
implement a desired logic function
x1
x1 x1 x2
x1
A
x1 x1 x2 B
x2
x2
f x1 x1 x2
25
Analysis via Truth Table
Apply all possible combinations of input signals and determine
output signal for each combination
x1 0011 1100
A
1101 f
0001 B
0101
x2
x x f (x , x ) A B
1 2 1 2
1 0
0 0 1
0 1 1 1 0
1 0 0 0 0
1 1 1 0 1
26
Analysis via Timing Diagram
Graphical representation of signals with respect to time
0011 1100
x
1 A
1101
f
0 0 0 1 B
0101
x
2
1
x
1 0
x 1
2 0
1
A
0
1
B
0
1
f
0 Time
27
Timing Diagrams
Timing diagrams useful for indicating functional behaviour of circuits
Idealized waveforms assume output signals respond to changes in
input signals in zero time
With practical logic gates, which are implemented in electronics,
there is a delay between a change in input values and the
corresponding change in the output value
Timing diagrams correspond to measurements taken with
oscilloscopes and logic analyzers
Timing diagrams also generated by CAD tools to show designer
expected behaviour of given circuit before actually implemented
28
Equivalent Circuits
The following circuits produce the same outputs for the same
combinations of inputs, but with different networks
x1 0011 1100
A
1101 f
0001 B
0101
x2
0 01 1 1 1 0 0
x
1
1 1 0 1
0 10 1 g
x
2
29
DEFINATION
• A timing diagram is a graphical method for showing the exact output behaviour of a logic circuit
for every possible set of input condition.
• It is often used to describe the operation of digital devices because its visual characteristics are
much easier to understand than a wordy explanation
30
DEFINATION
• In most situations, logic signals applied to the input of logic devices are not at stationery levels.
Instead, they are voltages that change continuously with states
• To illustrate how logic gates respond to input signals in relation to time, timing diagrams have
been developed
31
Examples-Series switch and bulb
32
Example –Bulb is off at Time Period 1
33
Example –Bulb is off at Time Period 2
34
Example –Bulb is off at Time Period 3
35
Example –Bulb is off at Time Period 4
36
AND-GATE TIMING DIAGRAM
37
AND-GATE TIMING DIAGRAM1
38
AND-GATE TIMING DIAGRAM2
39
AND-GATE TIMING DIAGRAM3
40
AND-GATE TIMING DIAGRAM4
41
AND-GATE TIMING DIAGRAM5
42
SUMMARY ON GATES
AND Definition: the output is true (1) if both inputs are
true (1).
logical operator
F = A.B = AB = “A and B” A B A. B
0 0 0
Boolean expression
0 1 0
1 0 0
1 1 1
F
Truth table
Symbol (aka. logic gate)
43
OR
Definition: the output is true (1) if either or both
inputs are true (1).
logical operator
F = A+B = “A or B” A B A+ B
0 0 0
Boolean expression
0 1 1
1 0 1
1 1 1
FF
Truth table
Symbol
44
NOT
Definition: the output is true (1) if the input is false
(0).
logical operator
45
Order of Precedence
– NOT
– AND
– OR
The order of precedence can be modified by using
parenthesis.
46
Functionally Complete
47
NAND
Definition: the output is false (0) if both inputs are
true (1).
48
NOR
Definition: the output is false (0) if either or both
inputs are true (1).
49
XOR
Definition: the output is true (1) if either but not both
inputs are true (1).
F = A xor B A B A xor B
0 0 0
Boolean expression
0 1 1
logical operator
1 0 1
1 1 0
Truth table
Symbol
50
XNOR
Definition: the output is false (0) if either but not
both inputs are true (1).
F = A xnor B
A B A xnor B
Boolean expression
logical operator
0 0 1
0 1 0
1 0 0
1 1 1
Symbol
Truth table
51
Logic Circuits
Logic circuits are realized through the interconnection
of logic gates.
Read-only Memories (ROM)
Programmable Logic Devices (PLD)
Field Programmable Gate Arrays (FPGA)
52
Standard Logic Gates
Device Logic Gate
74xx08 Quad 2-input AND gate
74xx32 Quad 2-input OR gate
74xx04 Hex Inverter (NOT gate)
74xx00 Quad 2-input NAND gate
74xx02 Quad 2-input NOR gate
74xx86 Quad 2-input XOR gate
53
Standard Logic Gates
Data sheets provide essential information:
Logic Function
Truth Table
Pin-out
Electrical Characteristics
Timing Characteristics
Package Description(s)
This information is necessary when building logic circuits
from discrete components.
54
Standard Logic Gates: 74xx08
pin-out
Truth table
55
Standard Logic Gates: 74xx32
pin-out
Truth table
56
Standard Logic Gates: 74xx04
pin-out
Truth table
57
Building a Logic Circuit
Circuit
Diagram
C
74xx08
B
74xx04
inputs 74xx32 F output
74xx08
A
Boolean
F = B'.C + A.B Expression
58
Building a Logic Circuit
VDD
Wiring
Diagram
components
7404
wires
7408 7432
A
inputs B
C output
F
59