CS212 Counters Timers and DMM
CS212 Counters Timers and DMM
CS212 Counters Timers and DMM
Types of counters
J Q0 J Q1
CLK C C
Q0
K K
FF0 FF1
CLK 1 2 3 4
Q0 Timing diagram
00 01 10 11 00 ...
Q0 0 1 0 1 0
Q1 0 0 1 1 0
J Q0 J Q1 J Q2
CLK C Q0 C Q1 C
K K K
FF0 FF1 FF2
CLK 1 2 3 4 5 6 7 8
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
Recycles back to 0
CLK 1 2 3 4
Q0
Q1
Q2
tPHL (CLK to Q0) tPHL (CLK to Q0)
tPLH (Q0 to Q1) tPHL (Q0 to Q1)
tPLH
(CLK to Q0) tPLH (Q1 to Q2)
HIGH
Q0 Q1 Q2 Q3
J J J J
CLK C C C C
K K K K
FF0 FF1 FF2 FF3
CLK
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
Q0
Q1
Q2
Q3
C B A
Q J Q J Q J
All J, K CLK CLK CLK
inputs Q
CLR
K Q
CLR
K Q
CLR
K
are 1
(HIGH). B
C
Example (cont’d):
C B A
Q J Q J Q J
All J, K CLK CLK CLK
inputs Q K Q K Q K
CLR CLR CLR
are 1
(HIGH). B
C
MOD-6 counter
1 2 3 4 5 6 7 8 9 10 11 12
Clock
A produced by
clearing (a MOD-8
B
binary counter)
C when count of six
NAND 1 (110) occurs.
Output 0
111 000
Temporary 001
state
Counter is a MOD-6
110 010 counter.
101 011
100
F E D C B A
Q J Q J Q J Q J Q J Q J
Q K Q K Q K Q K Q K Q K
CLR CLR CLR CLR CLR CLR
C
D
E All J = K = 1.
F
HIGH
D C B A
J Q J Q J Q J Q
CLK C C C C
K K K K
CLR CLR CLR CLR
HIGH D C B A
J Q J Q J Q J Q (A.C)'
CLK C C C C
K K K K
CLR CLR CLR CLR
1 2 3 4 5 6 7 8 9 10 11
Clock
D
C
B
A
NAND
output
UDSM, 12.05.2021 CS212: Counters and Timers Page 18
Asynchronous Down Counters
College of Information and Communication Technologies
Department of Computer Science and Engineering
1
Q0 Q1 Q2
J Q J Q J Q 3-bit binary
CLK C C C down counter
Q' K Q' K Q'
K
CLK 1 2 3 4 5 6 7 8
Q0 0 1 0 1 0 1 0 1 0
Q1 0 1 1 0 0 1 1 0 0
Q2 0 1 1 1 1 0 0 0 0
Q0 Q1 Q2 Q3 Q4
J Q J Q J Q J Q J Q
CLK C C C C C
Q' K Q' Q' K Q' K Q'
K K
A5 A4 A3 A2 A1 A0
0 0 0 0 0 0
0 0 0 0 0 1
0 0 0 : : :
0 0 0 1 1 1
0 0 1 0 0 0
0 0 1 0 0 1
: : : : : :
This works because the next bit must change state when
the previous bit changes from high to low – the point at
which a carry must occur to the next bit. Synchronous
counters usually have a carry-out and a carry-in pin for
linking counters together without introducing any
propagation delays.
A0 J A1
J Q Q
C C
Q' K Q'
K
CLK
A1 A1 A1
1 1 1 1 1 1 1
A2 1 A2 1 1 A2 1 1 1 1
A0 A0 A0
TA2 = A1.A0 TA1 = A0 TA0 = 1
UDSM, 12.05.2021 CS212: Counters and Timers Page 29
Synchronous (Parallel) Counters…
College of Information and Communication Technologies
Department of Computer Science and Engineering
A2 A1 A0
Q Q Q
J K J K J K
CP
1
1 A1.A0 A2.A1.A0
A0 J A1 J A2 J A3
J Q Q Q Q
C C C C
Q' K Q' K Q' K Q'
K
CLK
It can be seen above, that the external clock pulses (pulses to be counted) are
fed directly to each of the J-K flip-flops in the counter chain and that both the J
and K inputs are all tied together in toggle mode, but only in the first flip-flop,
flip-flop FFA (LSB) are they connected HIGH, logic “1” allowing the flip-flop to
toggle on every clock pulse. Then the synchronous counter follows a
predetermined sequence of states in response to the common clock signal,
advancing one state for each pulse.
UDSM, 12.05.2021 CS212: Counters and Timers Page 33
Up/Down Synchronous Counters…
College of Information and Communication Technologies
Department of Computer Science and Engineering
The J and K inputs of flip-flop FFB are connected directly to the output QA of
flip-flop FFA, but the J and K inputs of flip-flops FFC and FFD are driven from
separate AND gates which are also supplied with signals from the input and
output of the previous stage.
These additional AND gates generate the required logic for the JK inputs of
the next stage.
Because this 4-bit synchronous counter counts sequentially on every clock pulse
the resulting outputs count upwards from 0 ( 0000 ) to 15 ( 1111 ). Therefore, this
type of counter is also known as a 4-bit Synchronous Up Counter.
Clock pulse Q3 Q2 Q1 Q0
Initially 0 0 0 0
1 0 0 0 1 T0 = 1
2 0 0 1 0 T1 = Q3'.Q0
3 0 0 1 1 T2 = Q1.Q0
4 0 1 0 0
5 0 1 0 1 T3 = Q2.Q1.Q0 + Q3.Q0
6 0 1 1 0
7 0 1 1 1
8 1 0 0 0
9 1 0 0 1
10 (recycle) 0 0 0 0
T0 = 1
T1 = Q3'.Q0
T2 = Q1.Q0
T3 = Q2.Q1.Q0 + Q3.Q0
Q0
1 T T Q1 T Q2 T Q3
Q Q Q Q
C C C C
Q' Q' Q' Q'
CLK
74HC192
Pin Package
Asynchronous
Synchronous Counter
Counter
Portable Analog
Multimeter
Hand-held
DMM
Bench top
UDSM, 12.05.2021
DMM CS212: Counters and Timers Page 42
Digital Voltmeter (DVM)
College of Information and Communication Technologies
Department of Computer Science and Engineering