Escolar Documentos
Profissional Documentos
Cultura Documentos
ME 515 Mechatronics
Digital Electronics
Asanga Ratnaweera
Department of Mechanical Engineering
Faculty of Engineering
University of Peradeniya
Tel: 081239 (3627)
Email: asangar@pdn.ac.lk
Introduction to Digital
Electronics
Digital circuits are evolved from
transistor circuits being able to output at
one of the two voltage levels depending on
the levels at its inputs.
The two levels, usually 0 or 5 V are the
low and high signals and represented by
0 and 1.
Therefore, binary number system is
widely used with digital circuitry.
1
ME 515 Mechatronics 10/5/2006
Z = A⊕B
A
Z
B XOR
A Z
Z=A NOT 0 1
1 0
F = AB NAND
F=A F
BUF
2
ME 515 Mechatronics 10/5/2006
+Vcc
+Vcc
14 13 12 11 10 9 8
14 13 12 11 10 9 8
7408 7432
1 2 3 4 5 6 7
1 2 3 4 5 6 7
Gnd
G nd
(0 V )
(0 V )
Logic Families
Description TTL CMOS
Code 74XX, 74LSXX 40XX or 74HCXX
Supply voltage 4.75-5.25 V 5-15 V
Max. supply current -100 mA -0.02 mA
Input Output Input Output
0 state Voltage / V 0.8 0.5 1.5 0.05
Current / mA -0.4 8 -0.0001 0.5
1 state Voltage / V 2.0 2.7 3.5 V 4.95
Current / mA 0.02 -0.4 0.0001 -0.2
Max. Op. frequency 33 MHz 10 MHz
Active power Cons. 8 mW 0.1 mW
5 October 2006 Asanga Ratnaweera, Department of 6
Mechanical Engineering
3
ME 515 Mechatronics 10/5/2006
Classification of Digital
circuits
Digital electronics is classified as:
{ Combinational logic circuits
Combination logic output depends only
on the inputs levels.
{ Sequential logic circuits.
The output of sequential logic depends
on both stored levels and the input levels.
Therefore, sequential logic is capable of
“remembering” a particular state.
A B C Z Z = A.B.C
0 0 0 0
0 0 1 0
Z = A.B.C
0 1 0 0
0 1 1 0
1 0 0 0 Therefore;
1 0 1 1
1 1 0 0
Z = A.B.C or A.B.C
1 1 1 1
Z = A.B.C + A.B.C
Truth Table
4
ME 515 Mechatronics 10/5/2006
1 1 0 0
B
Z
1 1 1 1 C
5
ME 515 Mechatronics 10/5/2006
+Vcc
+Vcc +Vcc
14 13 12 11 10 9 8 14 13 12 11 10 9 8
7408 7432
1 2 3 4 5 6 7 1 2 3 4 5 6 7
Gnd Gnd
(0V) (0V)
Input A OUTPUT
Input B
0v
6
ME 515 Mechatronics 10/5/2006
x• y = x+ y
x+ y = x• y
{ Karnaugh Map
A grid of 2N squares where N is the number of input
variables in the Boolean expressions.
K-maps are usually used for minimization expressions
with six or fewer variables
5 October 2006 Asanga Ratnaweera, Department of 13
Mechanical Engineering
7
ME 515 Mechatronics 10/5/2006
0 0 1 0
0 1 1 1
8
ME 515 Mechatronics 10/5/2006
X = BC +AC + AB
9
ME 515 Mechatronics 10/5/2006
Design of Combination
Logic circuits
Ex:
{ Three push buttons are provided to turn on
a machine in an automobile assembly plant.
For safety purposes, the machine is to be
turned on, only if at least two of the
buttons are pushed. Obtain a suitable Logic
Circuit.
Applications of
Combinational circuits
Adders / substructures
Half adder
Full adder
5 October 2006 Asanga Ratnaweera, Department of 20
Mechanical Engineering
10
ME 515 Mechatronics 10/5/2006
Applications of
Combinational circuits
Encoders
{ A binary encoder generates a binary code
corresponding to the input value presented
at its inputs
Applications of
Combinational circuits
Encoders
11
ME 515 Mechatronics 10/5/2006
Applications of
Combinational circuits
Decoders
{ A binary decoder converts binary information
to discrete outputs.
Applications of
Combinational circuits
Decoders
12
ME 515 Mechatronics 10/5/2006
Applications of
Combinational circuits
Multiplexers
{ A multiplexer selects binary information
from one of many input lines and directs it
to a single output line.
Applications of
Combinational circuits
Multiplexers
13
ME 515 Mechatronics 10/5/2006
Applications of
Combinational circuits
De-multiplexers
{ A de-multiplexer receives binary information on
a single input line and passes this information
to one of its many output lines.
14
ME 515 Mechatronics 10/5/2006
Flop-Flops
A flip-flop circuit can be constructed
from two NAND gates or two NOR gates.
Flop-Flops
Clocked SR Flip-Flop
{ Information from the S and R inputs passes through to
the basic flip-flop only when the clock pulse goes to 1.
With both S=1 and R=1, the occurrence of a clock pulse
causes both outputs to momentarily go to 0.
15
ME 515 Mechatronics 10/5/2006
Flop-Flops
D Flip-Flop
Flop-Flops
JK Flip-Flop
{ A JK flip-flop is a refinement of the SR flip-
flop in that the indeterminate state of the
SR type is defined in the JK type.
16
ME 515 Mechatronics 10/5/2006
Flop-Flops
T Flip-Flop
The T flip-flop is a single input version
of the JK flip-flop. The output of the T
flip-flop "toggles" with each clock pulse.
Flop-Flops
Triggering of Flip-flops
{ The clock pulse goes through two signal
transitions: from 0 to 1 and the return from
1 to 0. The positive transition is defined as
the positive edge and the negative
transition as the negative edge. These flip-
flops are termed edge-triggered flip-flops
17
ME 515 Mechatronics 10/5/2006
Triggering of Flip-flops
Edge-triggered flip-flops
Triggering of Flip-flops
Level-triggered flip-flops
{ Level-triggered flip-flops respond to their inputs
while the clock signal is at a high level and retain
their output values after the level change
Truth table
Timing diagram
18
ME 515 Mechatronics 10/5/2006
19
ME 515 Mechatronics 10/5/2006
20
ME 515 Mechatronics 10/5/2006
Flop-Flop ICs
Flip-flops are commercially available as
IC packages
State Machine
A state machine is a device that stores
the status of something at a given time
and can operate on input to change the
status and/or cause an action or
output to take place for any given
change.
{ Ex: computer.
21
ME 515 Mechatronics 10/5/2006
State Machine
Ex: Design of a modulo-4 up-down
counter
{ State transition diagram
1
00 01
0
0 0 1
1
11 0 10
Design of an up-down
counter
Ex: Design of a modulo-4 up-down counter
{ State Table
Input Current Current Next state Next state
x state / q1 state / q2 / Q1 / Q2
0 0 0 1 1
0 0 1 0 0
0 1 0 0 1
0 1 1 1 0
1 0 0 0 1
1 0 1 1 0
1 1 0 1 1
1 1 1 0 0
5 October 2006 Asanga Ratnaweera, Department of 44
Mechanical Engineering
22
ME 515 Mechatronics 10/5/2006
Design of an up-down
counter
Ex: Design of a modulo-4 up-down counter
{ State Transition Table with SR flip flops
x q1 q2 Q1 Q2 S1 R1 S2 R2
0 0 0 1 1 1 0 1 0
0 0 1 0 0 0 d 0 1
0 1 0 0 1 0 1 1 0
0 1 1 1 0 d 0 0 1
1 0 0 0 1 0 d 1 0
1 0 1 1 0 1 0 0 1
1 1 0 1 1 d 0 1 0
1 1 1 0 0 0 1 0 1
5 October 2006 Asanga Ratnaweera, Department of 45
Mechanical Engineering
Design of an up-down
counter
Use K-maps for simplification
23
ME 515 Mechatronics 10/5/2006
Design of an up-down
counter
Logic circuit
Applications of Digital
Electronics
Binary counters
24
ME 515 Mechatronics 10/5/2006
Applications of Digital
Electronics
Decade counters
{ Use to perform binary
counting
{ A negative edge-triggered
counter and the output is
binary coded decimal
(BCD) consists of four
bits.
{ Ex: LS 7490 IC
Output sequence
5 October 2006 Asanga Ratnaweera, Department of 49
Mechanical Engineering
Applications of Digital
Electronics
Decade counters
{ Timing diagram
25
ME 515 Mechatronics 10/5/2006
Applications of Digital
Electronics
Decade counters
{ BCD counters can be cascaded in order to count in powers
of 10.
{ Output D can be used as the clock input for the second
decade counter (7490)
{ Cascading two together in order to raise the range for
counting from 0 to 99.
Applications of Digital
Electronics
Decade counters
26
ME 515 Mechatronics 10/5/2006
Applications of Digital
Electronics
Data registers
Applications of Digital
Electronics
Serial & Parallel Interfaces
27
ME 515 Mechatronics 10/5/2006
Applications of Digital
Electronics
Serial & Parallel Interfaces
28