Professional Documents
Culture Documents
Q Q
S R
NOR Active-HIGH Latch NAND Active-LOW Latch
1. Latches
EN
Q
1. Latches
D D Q
Q
EN EN
Q
Q
Inputs Outputs
D EN Q Q Comments
0 1 0 1 RESET
1 1 1 0 SET
X 0 Q0 Q0 No change
1. Latches
EN
D Q D Q
C C
Dynamic Q Q
input
indicator (a) Positive edge-triggered (b) Negative edge-triggered
2. Flip-flops
▪ The truth table for a positive-edge triggered D flip-flop shows an
up arrow to remind you that it is sensitive to its D input only on
the rising edge of the clock; otherwise it is latched.
▪ The truth table for a negative-edge triggered D flip-flop is
identical except for the direction of the arrow.
Inputs Outputs
J K CLK Q Q Comments
0 0 Q0 Q0 No change
0 1 0 1 RESET
1 0 1 0 SET
1 1 Q0 Q0 Toggle
2. Flip-flops
K Q
Notice that the outputs change on the leading edge of the clock.
CLK
Q
Counting in Binary
▪ A counter can form the same pattern of 0’s and 1’s with logic
levels.
▪ The first stage in the counter represents the least significant
bit – notice that these waveforms follow the same pattern as
counting in binary.
LSB 0 1 0 1 0 1 0 1 0
0 0 1 1 0 0 1 1 0
MSB 0 0 0 0 1 1 1 1 0
Three bit Asynchronous Counter
HIGH
J0 Q0 J1 Q1 J2 Q2
CLK C C C
Q0 Q1
K0 K1 K2
Q0 0 1 0 1 0 1 0 1 0
Q1 0 0 1 1 0 0 1 1 0
Q2 0 0 0 0 1 1 1 1 0
Propagation Delay
▪ Asynchronous counters are sometimes called ripple counters,
because the stages do not all change together.
▪ For certain applications requiring high clock rates, this is a
major disadvantage.
CLK 1 2 3 4
Notice how delays
are cumulative as Q0
each stage in a Q1
counter is clocked
later than the Q2
previous stage.
CLK C C C C
K0 K1 K2 K3
CLK 1 2 3 4 5 6 7 8 9 10
Q0
Q1 Glitch
Glitch
Q2
Q3
CLR
Glitch
Glitch
The 74LS93A Asynchronous Counter
▪ The 74LS93A has one independent toggle J-K flip-flop driven by
CLK A and three toggle J-K flip-flops that form an asynchronous
counter driven by CLK B.
▪ The counter can be extended to form a 4-bit counter by
connecting Q0 to the CLK B input.
▪ Two inputs are provided that clear the count.
(1)
CLK B
J J1 J2 J3
0
(14)
CLK A C C C C
K0 K1 K2 K3
(2)
All J and K inputs RO (1)
(3)
are connected RO (2)
(12) (9) (8) (11)
internally HIGH
Q0 Q1 Q2 Q3
Synchronous Counters
▪ In a synchronous counter all flip-flops are clocked together with
a common clock pulse.
▪ Synchronous counters overcome the disadvantage of accumulated
propagation delays, but generally they require more circuitry to
control states changes.
HIGH Q0
This 3-bit binary
Q0Q1
synchronous counter Q0 Q1 Q2
J J1 J
has the same count 0 2
C C C
sequence as the 3-bit
asynchronous counter K0 K1 K2
The next slide shows how to analyze this counter by writing the logic
equations for each input. Notice the inputs to each flip-flop…
Analysis of Synchronous Counters
▪ A tabular technique for analysis is illustrated for the counter
on the previous slide.
▪ Start by setting up the outputs as shown, then write the logic
equation for each input. This has been done for the counter.
1. Put the counter in an 2. Use the new inputs to 3. Set up the next
arbitrary state; then determine determine the next state: Q2 and group of inputs from
the inputs for this state. Q1 will latch and Q0 will toggle. the current output.
1 1 0 0 0 0 0 1 1
1 1 1 1 1 1 1 1 1
0 0 0
At this points all states have been accounted
for and the counter is ready to recycle…
A 4-bit Synchronous Binary Counter
Q1Q0
G1 Q2Q1Q0
G2
FF0 FF1 FF2 FF3
HIGH J0 Q0 J1 Q1 J2 Q2 J3 Q3
CLK C C C C
K0 Q0 K1 Q1 K2 Q2 K3 Q3
This gate detects 1001, and causes FF3 to toggle on the next
clock pulse. FF0 toggles on every clock pulse. Thus, the count
starts over at 0000.
Q3
HIGH Q0
FF0 FF1 FF2 FF3
J0 Q0 J1 Q1 J2 Q2 J3 Q3
C C C C
Q3
K0 Q0 K1 Q1 K2 Q2 K3 Q3
CLK
BCD Decade Counter
Q0 0 1 0 1 0 1 0 1 0 1 0
Q1 0 0 1 1 0 0 1 1 0 0 0
Q2 0 0 0 0 1 1 1 1 0 0 0
Q3 0 0 0 0 0 0 0 0 1 1 0
Data inputs
D0 D1 D2 D3
Q0 Q1 Q2 Q3
Example waveforms
Data outputs
are on the next slide…
A 4-bit Synchronous Binary Counter
CLR
LOAD
D0
D1
Data
inputs D2
D3
CLK
ENP
ENT
Q0
Q1
Data
outputs Q2
Q3
RCO
12 13 14 15 0 1 2
Count Inhibit
Clear Preset
Up/Down Synchronous Counters
UP Q0.UP
HIGH
FF0 FF1 FF2
Q2
J J1 J2
0 Q0 Q1
UP/DOWN C C C
Q0 Q1 Q2
K0 K1 K2
DOWN
Q0.DOWN
CLK
D0 D1 D2 D3 Data inputs
Q0 Q1 Q2 Q3 Data outputs
Synchronous Counter Design
C C C
Q0 Q1 Q2
K0 K1 K2
CLK
HIGH
ƒin
Counter 1 Counter 2
16 fout ƒin
CTEN TC CTEN TC 256
CTR DIV 16 CTR DIV 16
CLK C Q0 Q1 Q2 Q3 C Q0 Q1 Q2 Q3
fin
HIGH
Q2
J0 Q0 J1 Q1 J2 Q2
C C C
Q0 Q1
K0 Q0 K1 Q1 K2 Q2
CLK
1 1 1
LSB MSB
HIGH
FF0 FF1 FF2 FF3
J0 Q0 J1 Q1 J2 Q2 J3 Q3
C C C C
Q3
K0 Q0 K1 Q1 K2 Q2 K3 Q3
CLK
Resetting the Count with a Decoder
C C
CLK To next
Decode 6 counter
TC = 59
To ENABLE
Decode 59 of next CTR
Q3 Q2 Q1 Q0 Q3 Q2 Q1 Q0
units tens
Q0 Q2
J0 Q0 J1 Q1 J2 Q2
C C C
Q1
K0 Q0 K1 Q1 K2 Q2
CLK
1 1 1
LSB MSB
Common
CTR DIV 16 control
(1) block
CLR (9)
5CT = 0
D0 D1 D2 D3 LOAD M1
(15)
M2 RCO
(3) (4) (5) (6) (10)
ENT G3
(7)
(1) ENP G4
CLR (2)
(9) CLK C5/2,3,4+
LOAD
(10) CTR DIV 16 (15)
ENT RCO (3) (14)
(7) D0 Q0
ENP 1, 5 D [1]
(2) (4) (13)
CLK C D1 [2] Q1
(5) (12)
(14) (13) (12) (11) D2 [4] Q2
(6) (11)
D3 [8] Q3
Q0 Q1 Q2 Q3
Basic Shift Register Operations
Data in
Serial in/shift right/serial out Serial in/shift left/serial out Parallel in/serial out
Data in
Data in
C C C C C
CLK
CLK
A Basic Application
CLK
CLK
The 74HC164A Shift Register
▪ The 74HC164A is a CMOS 8-bit serial in/parallel out shift
register. VCC can be from +2.0 V to +6.0 V.
(9)
CLR
(8)
CLK
(1)
Serial A
R R R R R R R R
inputs B (2)
C C C C C C C C
S S S S S S S S
Q0 Q1 Q2 Q3 Q4 Q5 Q6 Q7
One of the two serial data inputs may be used as an active HIGH
enable to gate the other input. If no enable is needed, the other serial
input can be connected to VCC. The 74HC164A has an active LOW
asynchronous clear. Data is entered on the leading-edge of the clock.
Waveforms for the 74HC164A
SHIFT/LOAD
G1 G5 G2 G6 G3 G7 G4
Serial
D D D D
Q0 Q1 Q2 Q3 data out
C C C C
The clock (CLK) and clock inhibit (CLK INH) lines are connected to a
common OR gate, so either of these inputs can be used as an active-
LOW clock enable with the other as the clock input. Data is loaded
asynchronously when SH/LD is LOW and moved through the register
synchronously when SH/LD is HIGH and a rising clock pulse occurs.