Digital Electronics

Download Report

Transcript Digital Electronics

Digital Electronics
Principles & Applications
Seventh Edition
Roger L. Tokheim
Chapter 8
Counters
©2008 The McGraw-Hill Companies, Inc. All rights reserved.
INTRODUCTION
•
•
•
•
•
•
•
•
•
•
Overview of Counters
Characteristics of Counters
Ripple Up Counter
Ripple Counter with Waveforms
Ripple Down Counter
Self-stopping Counter
Frequency Division using Counters
Using Counter ICs
Magnitude Comparators
Troubleshooting Hints
©2008 The McGraw-Hill Companies, Inc. All rights reserved.
Overview of Counters
• Counter-by definition
– One input (clock)
– Outputs follow defined sequence
• Common tasks of counter
– Count up or down
– Increment or decrement count
– Sequence events
– Divide frequency
– Address memory
– As temporary memory
©2008 The McGraw-Hill Companies, Inc. All rights reserved.
QUIZ
1. A digital counter has a single clock
input with many outputs and the
counter follows defined sequence such
as 000, 001, 010, 011, 100, 101, 110,
111, 000, etc. (True or False)
True
2. Several common tasks of a counter are
to count up or down, divide frequency,
or as temporary memory. (True or
False)
True
©2008 The McGraw-Hill Companies, Inc. All rights reserved.
Characteristics of Counters
• Number of bits (4-bit, 8-bit, etc.)
• Maximum count
– 4 bit = 24 = 0000 to 1111 in binary
– 8 bit = 28 = 0000 0000 to 1111 1111 in binary
• Modulus of counter-number of states
– Decade counter
– 4-bit
– 8-bit
• Up or down counter
• Asynchronous or synchronous counter
• Presettable counter
• Self-stopping counter
©2008 The McGraw-Hill Companies, Inc. All rights reserved.
QUIZ
1. A 4-bit counter will count from binary 0000
to __________.
1111
2. The modulus of a counter is the number of
states it will cycle through such as a decade
counter has a modulus of __________.
10
3. Counters can be designed to count up or
downward or devised to be self-stopping.
(True or False)
True
4. A 4-bit counter would have modulus of 4
(mod-4 counter) because it is constructed
using four flip-flops. (True or False)
False
©2008 The McGraw-Hill Companies, Inc. All rights reserved.
Ripple Counter
Binary Output
Clock Input
00
1
10
10
1
Pulse 8
1
2
3
4
5
6
7
All J-K
PS
and
CLRhas
inputs
This
Onflip-flops
the
4-bit
next
counter
clock
pulse
16(8)
states
all FFs
and
in
the
are
willwill
count
toggle
from
because
binary each
0000 will
through
receive
1111
TOGGLE
MODE
INACTIVE
a H-to-L
and then
pulsereset
one
back
after
to another.
0000.
Watch
Thethe
counter
counthas
ripple
a modulus
thru theof
counter.
16.
©2008 The McGraw-Hill Companies, Inc. All rights reserved.
Ripple Counter With Waveforms
Binary Output
Clock Input
01
00
10
1
Pulse 5
1
2
3
4
Clock input
FFs triggered on 1s output
H-to-L pulse.
CLK toggles 1s FF.
1s FF toggles 2s FF.2s output
2s FF toggles 4s FF.
4s output
©2008 The McGraw-Hill Companies, Inc. All rights reserved.
QUIZ
Q#1After
pulse
12the
output
of
the
mod-16
Q#2After
pulse
the
output
of
the
mod-16
Q#3After
pulse
8
the
output
of
the
mod-16
Q#4After
pulse
15
the
output
of
the
mod-16
counter
will
be
binary
___.
counter
will
be
binary
___.
counter
counterwill
willbe
bebinary
binary___.
___.
1 001 101 001
1
0
0 0
0 0
0 0
1
0
Input
Pulse
Pulse
Pulses
15
1
2
8
©2008 The McGraw-Hill Companies, Inc. All rights reserved.
Decade Counter
Binary Output
Clock Input
11
0
00
11
0
Pulse 8
1
2
3
4
5
6
7
Short negative pulse
To clear input
of each FF
All J & K inputs = 1
All PR inputs = 1
To change mod-16 counter to decade counter:
Count is at 1001.
Reset count to 0000 after 1001 (9) count.
Next clock pulse will increment counter for a
When count hits 1010 reset to 0000.
short time to 1010 which will activate the NAND gate
See added 2-input NAND gate that clears all
and reset the counter to 0000.
JK FFs to 0 when count hits 1010.
©2008 The McGraw-Hill Companies, Inc. All rights reserved.
QUIZ
Q#2This
can
be described
asup
a ___
(decade,
4-bit)
Q#1Q#3This
The
iscircuit
___
a0110,
___
gate
(mod-10,
generates
mod-16)
a very
short
counter.
LOW
pulse
when
the
Q#4After
the
counting
sequence
would
be
0111,
1000,
up
counter.
count
10101100,
and 1101,
resets1110,
to counter
to 0000.
1001, reaches
1010, 1011,
1111, 0000,
etc. (T or F)
ANS:
mod-10
ANS:
decade
ANS:
ANS:NAND
False
0110
Input pulses
To clear input
of each FF
©2008 The McGraw-Hill Companies, Inc. All rights reserved.
Down Counter
11
0
00
1
2
1
Pulse 4
3
5
Changes from Ripple Up Counter are
wiring from Q’ outputs (instead of Q outputs)
to the CLK input of the next FF.
©2008 The McGraw-Hill Companies, Inc. All rights reserved.
QUIZ
Q#1This circuit
can
be
described as
a 3-bit
ripple
___
Q#2is asequence
self-stopping
ripple
down
counter.
Q#3- This
The circuit
counting
of this3-bit
circuit
is 111,
110,
101,
(down-counter,
up-counter).
(T
or 011,
F) 010, 001, 000, 111, 110, 101, 100, etc. (T or F)
100,
ANS:ANS:
down-counter
ANS: False
True
1 1 1
Input pulses
©2008 The McGraw-Hill Companies, Inc. All rights reserved.
Self-Stopping Down Counter
10
0
10
1
The count remained
at binary 000.
2
3
4
Pulse 8
1
5
6
7
This is a 3-bit down counter.
The 1s FF is in TOGGLE mode when counting (J & K = 1).
The 1s FF switches to HOLD mode when the J and K inputs are forced LOW by the OR gate
when the count decrements to 000. The count stops at 000.
©2008 The McGraw-Hill Companies, Inc. All rights reserved.
QUIZ
Q#1This circuit
could
be described
as
a 3-bit
___ LOW)
Q#23-input
OR at
gate
generates
a ___
(HIGH,
Q#3-The
With
the count
111,
the OR gate
outputs
a HIGH
(decade,
self-stopping)
ripple
counter.
when
count
decreases
000toggle
whichmode.
stops the
count
whichthe
places
the
left FF intothe
(T or
F) at 000.
ANS:
self-stopping
ANS:
ANS:LOW
True
1 1 1
Input pulses
©2008 The McGraw-Hill Companies, Inc. All rights reserved.
Counter Used for Frequency Division
8
100 Hz
50 Hz
200 Hz
4
400 Hz
2
 16
Clock Input
800 Hz
©2008 The McGraw-Hill Companies, Inc. All rights reserved.
QUIZ
Q#1What
isisthe
output
frequency
Q#2What
the
output
frequency
Q#3What
is
the
output
frequency
Q#4What
is
the
output
frequency
from
Q#5the
The
1s
J-K
8s
output
flip-flop
from
with
the
an
4-bit
from
the
2s
J-K
flip-flop
with
an
from
the
4s
J-K
flip-flop
with
an
from
the is
8sreferred
J-K
flip-flop
with
an
input
counter
frequency
of
3200
to Hz?
as
the ___
input
frequency
of
3200
Hz?
input
frequency
of
input
frequency
of3200
3200Hz?
Hz?output.
(divide-by-4,
divide-by-16)
Clock Input
ANS:
1600
ANS:
800
ANS:
400
ANS:
200
ANS: divide-by-16
Frequency?
3200 Hz
©2008 The McGraw-Hill Companies, Inc. All rights reserved.
Using the 7493 Counter IC
• Counters are available in IC form.
• Either ripple (7493 IC) or synchronous
(74192 IC) counters are available.
100
? Hz
Hz
400
? Hz
Hz
800
? Hz
Hz
1600 Hz
7493 Counter IC
wired as a 4-bit
binary counter
©2008 The McGraw-Hill Companies, Inc. All rights reserved.
Magnitude Comparator
A magnitude comparator is a combinational logic
device that compares the value of two binary
numbers and responds with one of three outputs
(A=B or A>B or A<B).
A(0)
A(1)
Input
Input
Input
binary
binary
binary0111
1111
0001
A(2)
74HC85
Magnitude
Comparator
A(3)
B(0)
B(1)
Input
Input
binary
binary
0110
0111
1100
A>B
HIGH
A=B
HIGH
A<B
HIGH
B(2)
B(3)
©2008 The McGraw-Hill Companies, Inc. All rights reserved.
QUIZ
Q#1- The 74HC85 Comparator IC compares two 4-bit ___
Q#2Which
output
of
the (A
comparator
IC
will
be activated
(binary,
Q#3decimal)
output
numbers
of
and B) and
IC
generates
will
one of three
Q#4- Which
Which
output
ofthe
thecomparator
comparator
IC
willbe
beactivated
activated
with
these
two
4-bit
binary
numbers
as
inputs?
outputs
with
including
two
(1) A
binary
= B, (2)
numbers
A > B, or
as
inputs?
A < B.
withthese
these
two4-bit
4-bit
binary
numbers
as(3)
inputs?
A(0)
A(1)
0101
0101
1101
A(2)
A(3)
B(0)
0101
1011
1010
B(1)
B(2)
ANS:
binary
ANS:
A=B
ANS:
ANS: AA<>BB
74HC85
Magnitude
Comparator
A>B
A=B
A<B
?
?
?
B(3)
©2008 The McGraw-Hill Companies, Inc. All rights reserved.
Simple Troubleshooting Hints
• Feel top of IC to determine if it is hot
• Look for broken connections, signs of
excessive heat
• Smell for overheating
• Check power source
• Trace path of logic through circuit
• Know the normal operation of the circuit
©2008 The McGraw-Hill Companies, Inc. All rights reserved.
QUIZ
1. The first three steps in troubleshooting are
the use of your senses to (1) feel the top of
the ICs for overheating, (2) to __________
for broken connections, and (3) to smell for
signs of overheating.
2. The forth step in troubleshooting is to use a
simple handheld instrument called a
__________ to check the power sources at
each IC.
3. Your knowledge of the normal operation of
the circuit and equipment is very important
in troubleshooting. (True or False)
look
logic probe
True
©2008 The McGraw-Hill Companies, Inc. All rights reserved.
REVIEW
•
•
•
•
•
•
•
•
•
•
Overview of Counters
Characteristics of Counters
Ripple Up Counter
Ripple Counter with Waveforms
Ripple Down Counter
Self-stopping Counter
Frequency Division using Counters
Using Counter ICs
Magnitude Comparators
Troubleshooting Hints
©2008 The McGraw-Hill Companies, Inc. All rights reserved.