Topic 5
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
5.0:COUNTER<br />
Created by:<br />
Noorziza Binti Abdul Aziz<br />
Electrical Engineering Department<br />
Politeknik Ibrahim Sultan
Introduction of counter<br />
• Counters can be built when the flip-flops<br />
are connected together.<br />
• Flip-flops are used in the counter circuit can be built using<br />
a JK flip-flop, and T.<br />
• The number of flip-flops and how the flip-flops<br />
are connected can determine the number of conditions<br />
(modulo /mod) and the sequence numbers for<br />
every triggering clock given to the counter.<br />
• counters can be categorized into two types according<br />
to how the triggered input clock :<br />
asynchronous and synchronous counter.
Introduction of counter (cont…)<br />
• asynchronous counter is where the first flipflop<br />
receive the clock triggered from external clock and<br />
the subsequent flip-flop will receive the clock triggered by the<br />
Q output from previous flip-flop. This counter is also known as<br />
ripple counter.<br />
• synchronous counter is where the each flipflop<br />
receives clock pulses simultaneously.<br />
• One flip-flop can generate counting of either 0 or 1.<br />
• Two flip-flops can generate counting of 4 states counter (00,<br />
01, 10, 11).<br />
• 3 flip-flops can generate counting of 8 states counter<br />
(000,001,010,011,100,101,110,111) and others.
Example:<br />
• This circuit can only count for two conditions either 0 or 1.<br />
• Assume that the initial stage for flip-flop is RESET (Q = 0).<br />
• Then the J and K inputs are shorted to logic 1 (J = 1, K = 1).<br />
The flip-flop will be TOGGLED.<br />
• In the first positive edge clock triggered, flip-flop will toggled<br />
where Q change to 1. That’s mean the counter was count in 1<br />
clock pulse.<br />
• This stage will repeated to next clock pulse given.
Asynchronous counter<br />
(i)<br />
(ii)<br />
(iii)<br />
(iv)<br />
(v)<br />
(vi)<br />
Asynchronous Up Counter<br />
Asynchronous Counter as frequency dividers<br />
Asynchronous Down Counters<br />
Asynchronous Up/Down Counters<br />
Asynchronous Counter mode number less then 2 n<br />
Decade (mode 10)counters
(i)<br />
Asynchronous Up Counters<br />
• Up counter will count in order from the smallest/minimum<br />
number to the greatest number (ex: 0,1,2,3,4,5,6,7,0,1,…)<br />
• For the positive edge triggered flip-flop, output will connect to<br />
the next clock flip-flop.<br />
• For the negative edge triggered flip-flop, output Q will connect<br />
to the next clock flip-flop.<br />
• Mode is a condition of counters (ex: mode 6 will count<br />
0,1,2,3,4,5,0,1,2,…).<br />
• In the asynchronous counter, the previous output flip-flop will<br />
trigger the next flip-flop.
The steps to built asynchronous<br />
counter is:<br />
1. Define the number of flip-flop.<br />
The expression of mode, m is:<br />
m=2 n , n = flip-flop numbers n = log m /<br />
log 2<br />
Example: mod 16 n = log 16 / log 2 = 4.<br />
2. The maximum number of decimal places:<br />
If mode m=2 n , the maximum number is m -1.<br />
Example: mode 16 have a maximum number<br />
is 15 and will repeated.<br />
3. Built a transition/sequence diagram that shown the sequence<br />
number<br />
(example: 0 1 2 … (m-1).<br />
4. Connect the external clock to the first flip-flop. Then, the output Q in<br />
each flip-flop will be connected to the clock input for the next flip-flop.<br />
5. Make sure that J and K for each flip-flop will be connected to the<br />
logic 1.
Example :<br />
Built a circuit for mod 4 asynchronous up<br />
counters by using a J-K flip-flop.<br />
Solution:<br />
1. Number of FF<br />
n = log 4/log 2<br />
= 2 FFs<br />
2. Transition/ sequence<br />
diagram<br />
repeat<br />
11<br />
00<br />
01<br />
10
3. Draw the counter circuit<br />
using positive edge clock<br />
triggered<br />
JA<br />
clk<br />
QA<br />
JB<br />
clk<br />
QB<br />
KA<br />
QA<br />
KB<br />
QB<br />
4. Timing diagram (using positive edge clock triggered)<br />
**Assume that the initial stage for counter is RESET<br />
(Q=0).<br />
clk<br />
1<br />
QA<br />
0 1 0<br />
1<br />
0<br />
1<br />
LSB<br />
QA<br />
QB<br />
0<br />
0<br />
1<br />
1<br />
0<br />
0 MSB<br />
Binary<br />
Output<br />
00 01 10 11 00 01
Solution (cont…)<br />
3.Draw the counter circuit if using<br />
the negative edge clock<br />
triggered<br />
JA<br />
KA<br />
clk<br />
QA<br />
QA<br />
JB<br />
KB<br />
clk<br />
QB<br />
QB<br />
1<br />
4. Timing diagram (using negative edge clock triggered)<br />
clk<br />
QA<br />
LSB<br />
QB<br />
Binary<br />
Output<br />
00 01 10 11 00 01<br />
MSB
Exercise:<br />
Build a circuit for mode 8 asynchronous counters by using a J-K flipflop.<br />
Answer:<br />
1. m = 2n 8 = 2n n= log8 / log 2 3<br />
2. Maximum decimal places m-1 7<br />
3. Transition diagram:
(iv)<br />
Counter circuit:<br />
1<br />
JA<br />
QA<br />
JB<br />
QB<br />
JC<br />
QC<br />
clk<br />
clk<br />
clk<br />
KA<br />
QA<br />
KB<br />
QB<br />
KC<br />
QC<br />
(v)<br />
Timing diagram:
(ii) Asynchronous counter as a<br />
frequency dividers<br />
• Each flip-flop will have an output frequency of half(½) from the<br />
input.<br />
• if several flip-flops are connected, there will divide the clock<br />
frequency into two and this occur at each flip-flop output.<br />
• The expression of output frequency is f ou t = f in /2 n , where n is<br />
the numbers of flip-flop.<br />
• The expression of distribution factors, Distribution Factor = 2 n ;<br />
n is flip-flop numbers.
Example:<br />
2-bit asynchronous counter as a frequency division.<br />
Timing diagram shown the frequency division.
• The output frequency for the last flip-flop of any<br />
counter will be the clock frequency divided by the<br />
MOD of the counter.<br />
• Ex: MOD-16 counter, last FF will have a freq =1/16<br />
of the input clock, also called a divide by 16<br />
counter
Example:<br />
• Calculate the maximum number, mode and distributions<br />
factors for the 5-bit asynchronous counter.<br />
Answer:<br />
• Maximum number:<br />
5 bits counter must have 5 flip-flop<br />
N = 2 n -1 31 ( 11111 2 )<br />
• Mod = 2n 2 5 32<br />
• Distributions factor<br />
2 n 2 5 = 32
(iii)Asynchronous Down Counters<br />
•This counter will count from<br />
the maximum number to minimum numbers<br />
•For the positive edge triggered flip-flop,<br />
output Q will connect to the next clock flipflop.<br />
•For the negative edge triggered flip-flop, Q’<br />
output will connect to the next clock flipflop
Example figure: Down Counters (Positive edge flip-flop)<br />
1<br />
JA<br />
QA<br />
JB<br />
QB<br />
JC<br />
QC<br />
clk<br />
clk<br />
clk<br />
KA<br />
QA<br />
KB<br />
QB<br />
KC<br />
QC<br />
• flip-flop A will toggle when received at the positive edge.<br />
• flip-flop B will only toggles when it gets a positive edge QA.<br />
• flip-flop C will only toggles when it gets a positive edge QB.<br />
clk<br />
QA<br />
QB<br />
QC<br />
111 110 101 100 011 010 001 000
Table for sequence state:<br />
Positive Edge Triggered QC QB QA<br />
0 0 0 0<br />
1 1 1 1<br />
2 1 1 0<br />
3 1 0 1<br />
4 1 0 0<br />
5 0 1 1<br />
6 0 1 0<br />
7 0 0 1
Example figure: Down Counters (Negative edge flip-flop)<br />
1<br />
JA<br />
QA<br />
JB<br />
QB<br />
JC<br />
QC<br />
clk<br />
clk<br />
clk<br />
KA<br />
QA<br />
KB<br />
QB<br />
KC<br />
QC<br />
QA<br />
QA<br />
QB<br />
QC<br />
111 110 101 100 011 010 001 000
Synchronous UP/DOWN counters<br />
• This circuit uses AND-OR gate network and controlled by the control input<br />
UP/DOWN.<br />
• When the control input UP/DOWN are HIGH, so that all the shaded AND<br />
gate will be active and will connect the Q output to the input CLK, the<br />
counters will count up.<br />
• Conversely, if control UP/ DOWN is LOW, all the shaded AND gate is<br />
disabled and all that is not shaded AND gate will<br />
be active and will connect the output to the input CLK, the counter will<br />
count down.<br />
• Actually,asynchronous UP/DOWN is slower than asynchronous Up<br />
Counters or Down Counters. This is caused by a<br />
delay (propagation delay) is increased from AND-OR gate network.
Mode 8 Asynchronous Up/Down Counters (Q 0 , Q 1 and Q 2 as an output)<br />
K<br />
K<br />
K<br />
QA will follow the<br />
negative edge clock<br />
triggered. While QB<br />
and QC will follow the<br />
UP/DOWN controller<br />
(rising clock down<br />
counter, Falling clock<br />
UP counter)
(v) Asynchronous counter mode<br />
number less than 2n (m
Mode 6 Asynchronous Counter Circuit<br />
• Flip-flop B and C connected to the input of a NAND<br />
gate.<br />
• Output of NAND gate connected to the CLEAR input<br />
each flip-flops.<br />
• This counter will RESET to 000 at 6 th clock pulse while<br />
the counter archive 110.
• Example 1:<br />
• Design an asynchronous counter with mod 12 by using JK flip-flop<br />
and define the frequency output if the given frequency input is 30KHz<br />
•<br />
• Answer:<br />
• This counter can only count from 012 (that’s mean from 0000 to<br />
1011) and this counter will return to 0 (0000).<br />
• In the previous lesson, if we use 4 flip-flops, it should be count from<br />
0000 to 1111.<br />
• By RESET the NAND gate, this counter will reset the state of 1100 to<br />
be 0000.<br />
• The output of flip-flop 3 and 4 will ‘HIGH’ (logic 1) and connected to<br />
the input of NAND gate.<br />
• When the output from NAND gate is ‘LOW’, the output for flip-flops 3<br />
and 4 will be ‘CLEAR’ to 0000.
1<br />
JA QA<br />
clk<br />
KA QA<br />
clr<br />
JB QB<br />
clk<br />
KB QB<br />
clr<br />
JC<br />
clk<br />
KC<br />
clr<br />
QC<br />
QC<br />
JD QD<br />
clk<br />
KD QD<br />
clr<br />
• Asynchronous counter in mode 12<br />
**Frequency:<br />
The sequence output is 1100 2 = 12 10 .<br />
That’s mean this counter is in mode<br />
12.<br />
f out = f in /m 30KHz/12 2.5KHz.<br />
Output for flip-flop 3<br />
and 4 will HIGH and<br />
connect to the input of<br />
NAND gate.<br />
[F4F3F2F1= 1100]
(v)<br />
Decade (mode 10) counters<br />
•mode 10 counter have 10 different output<br />
and can count from 0 (0000) to 9 (1001).<br />
•Mode 10 counter can use in many<br />
applications such as digital clock, digital<br />
voltmeter, and frequency counter.<br />
•Mode 10 counter are useful as an interface<br />
between the binary input to decimal display.
1<br />
J<br />
QA<br />
J<br />
QB<br />
J<br />
QC<br />
J<br />
QD<br />
clk<br />
clk<br />
clk<br />
K<br />
clr<br />
QA<br />
K<br />
QB<br />
clr<br />
K<br />
clr<br />
QC<br />
K<br />
QD<br />
clr<br />
• This circuit will RESET after tenth clock pulse.<br />
• After the end of tenth clock pulse, QD and QB is high (logic 1)<br />
, therefore the output of NAND gate is 0. This will RESET the<br />
counter (0000).
• The sequence table for the Decade counter is:
• A timing diagram for mod 12 up/down counter<br />
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15<br />
UP/DOWN<br />
QA<br />
QB<br />
QC<br />
QD<br />
0 1 2 3 4 5 6 7 8 9 10 11 10 9 8 7
Synchronous Counter<br />
• In a synchronous counter, the input pulses<br />
are applied to all clock pulse inputs of all flip<br />
flops simultaneously (directly). Synchronous<br />
counter is also known as parallel sequential<br />
circuit.<br />
• Synchronous counter can count sequentially<br />
or randomly.<br />
• Examples of Synchronous Counters are as<br />
1. Synchronous up counter<br />
2. Synchronous down counter<br />
3. Synchronous up/down counter<br />
4. Random counter
Step to built a synchronous counter circuits:<br />
1. Define the flip-flop number<br />
2. Construct the state table with present state and<br />
next state.<br />
3. Construct the excitation table with referring to the<br />
truth table of JK Flip-flop or T flip-flop.<br />
4. Built a K-map for each flip-flop input.<br />
5. Draw the complete circuit from the simplified K-map<br />
input.
Question 1 :<br />
Design a 3 bit synchronous up counter using JK flip-flops with<br />
negative edge clock triggered.<br />
Answer:<br />
Step 1: define the number of flip-flop:<br />
M=2 n n = log M/log 2 3 flip-flops<br />
Step 2: table state <br />
Present<br />
state<br />
Next state<br />
000 001<br />
001 010<br />
010 011<br />
011 100<br />
100 101<br />
101 110<br />
110 111<br />
111 000
• Step 3: excitation table (refer to JK flip-flop truth table)<br />
Truth table of JK flip-flop<br />
J K Qn Qn+1<br />
0 0 0 0<br />
1 1<br />
0 1 0 0<br />
1 0<br />
1 0 0 1<br />
1 1<br />
1 1 0 1<br />
1 0<br />
Excitation table:<br />
Present<br />
state<br />
Next<br />
state<br />
INPUT<br />
JC KC JB KB JA KA<br />
000 001 0 X 0 X 1 X<br />
001 010 0 X 1 X X 1<br />
010 011 0 X X 0 1 X<br />
011 100 1 X X 1 X 1<br />
100 101 X 0 0 X 1 X<br />
101 110 X 0 1 X X 1<br />
110 111 X 0 X 0 1 X<br />
111 000 X 1 X 1 X 1<br />
JK flip-flop truth<br />
table can be<br />
simplified as<br />
Qn Qn+1 J K<br />
0 0 0 X<br />
0 1 1 X<br />
1 0 X 1<br />
1 1 X 0
Step 4: Built a K-map.<br />
OUTPUT<br />
Present<br />
state<br />
Next<br />
state<br />
INPUT<br />
JC KC JB KB JA KA<br />
000 001 0 X 0 X 1 X<br />
001 010 0 X 1 X X 1<br />
010 011 0 X X 0 1 X<br />
011 100 1 X X 1 X 1<br />
100 101 X 0 0 X 1 X<br />
101 110 X 0 1 X X 1<br />
110 111 X 0 X 0 1 X<br />
111 000 X 1 X 1 X 1<br />
Qc\ Qb Qa<br />
00 01 11 10<br />
0<br />
1<br />
0 0 1 0<br />
x x x x<br />
Qc\ Qb Qa<br />
0<br />
1<br />
00 01 11 10<br />
x x x x<br />
0 0 1 0<br />
Qc\ Qb Qa<br />
0<br />
1<br />
Qc\ Qb Qa<br />
00 01 11 10<br />
0<br />
1<br />
00 01 11 10<br />
0 1 X X<br />
0 1 X X<br />
X 1 1 X<br />
X 1 1 X<br />
Qc\ Qb Qa<br />
0<br />
1<br />
Qc\ Qb Qa<br />
0<br />
1<br />
KA = 1<br />
00 01 11 10<br />
1 X X 1<br />
1 X X 1<br />
JA = 1<br />
00 01 11 10<br />
X X 1 0<br />
X X 1 0<br />
KB = Qa<br />
JC = Qb Qa<br />
KC = Qb Qa<br />
JB = Qa
Step 5: counter logic circuit<br />
KA = 1 JA = 1<br />
KB = Qa<br />
JB = Qa<br />
KC = Qb Qa<br />
JC = Qb Qa<br />
1<br />
JA QA<br />
clk<br />
KA QA<br />
JB QB<br />
clk<br />
KB QB<br />
JC QC<br />
clk<br />
KC QC<br />
clk
Question 2 :<br />
Design a 3 bit synchronous up counter using T flip-flops with<br />
negative edge clock triggered<br />
Answer:<br />
Step 1: define the number of flip-flop:<br />
M=2 n n = log M/log 2 3 flip-flops<br />
Step 2: table state <br />
Present<br />
state<br />
Next state<br />
000 001<br />
001 010<br />
010 011<br />
011 100<br />
100 101<br />
101 110<br />
110 111<br />
111 000
Step 3: excitation table (refer to T flip-flop truth table)<br />
Step 4:<br />
K-Map<br />
OUTPUT<br />
Present<br />
state<br />
Next<br />
state<br />
INPUT<br />
TC TB TA<br />
000 001 0 0 1<br />
001 010 0 1 1<br />
010 011 0 0 1<br />
011 100 1 1 1<br />
100 101 0 0 1<br />
101 110 0 1 1<br />
110 111 0 0 1<br />
111 000 1 1 1<br />
Qc\ Qb Qa<br />
00 01 11 10<br />
0<br />
1<br />
0 0 1 0<br />
0 0 1 0<br />
Qc\ Qb Qa<br />
00 01 11 10<br />
0<br />
1<br />
0 1 1 0<br />
0 1 1 0<br />
INPUT Qn Qn+1<br />
0<br />
1<br />
0 0<br />
1 1<br />
0 1<br />
1 0<br />
Qc\ Qb Qa<br />
00 01 11 10<br />
0<br />
1<br />
1 1 1 1<br />
1 1 1 1<br />
TA = 1<br />
TC = Qb Qa<br />
TB = Qa
Step 5: counter logic circuit<br />
TC = Qb Qa<br />
TB = Qa<br />
TA = 1<br />
1<br />
TA QA<br />
clk<br />
QA<br />
TB QB<br />
clk<br />
QB<br />
TC QC<br />
clk<br />
QC<br />
clk
Question 2 :<br />
Design a synchronous counter using JK flip-flops with negative edge clock<br />
triggered that can count a random number 0,3,5,1,4,6 and repeated.<br />
Answer:<br />
Step 1: Define the number of flip-flop (use the highest number counting<br />
sequences. In this example, the highest number is 6)<br />
Mod, M = 6 + 1 [6 is the highest number in counter]<br />
M=2 n n = log 7/log 2 2.81 ~ 3 flip-flops<br />
Step 2: table state <br />
Present<br />
state<br />
Next<br />
state<br />
000 011<br />
011 101<br />
101 001<br />
001 100<br />
100 110<br />
110 000
Step 3: excitation table (refer to JK flip-flop truth table)<br />
OUTPUT<br />
INPUT<br />
Qn Qn+1 J K<br />
Present<br />
state<br />
Next<br />
state<br />
JC KC JB KB JA KA<br />
000 011 0 X 1 X 1 X<br />
011 101 1 X X 1 X 0<br />
101 001 X 1 0 X X 0<br />
001 100 1 X 0 X X 1<br />
100 110 X 0 1 X 0 X<br />
110 000 X 1 X 1 0 X<br />
QbQa<br />
00 01 11 10<br />
Qc<br />
0<br />
1<br />
0 1 1 X<br />
X X X X<br />
QbQa<br />
00 01 11 10<br />
Qc<br />
0<br />
1<br />
1 0 X X<br />
1 0 X X<br />
0 0 0 X<br />
0 1 1 X<br />
1 0 X 1<br />
1 1 X 0<br />
QbQa<br />
00 01 11 10<br />
Qc<br />
0<br />
1<br />
Step 4: K-Map<br />
1 X X X<br />
0 X X 0<br />
JC = Qa<br />
QbQa<br />
00 01 11 10<br />
Qc<br />
0<br />
1<br />
X X X X<br />
0 1 X 1<br />
KC = Qa + QB<br />
JB = Qa<br />
QbQa<br />
00 01 11 10<br />
Qc<br />
0<br />
1<br />
X X 1 X<br />
X X X 1<br />
KB = 1<br />
JA = Qc<br />
QbQa<br />
00 01 11 10<br />
Qc<br />
0<br />
1<br />
X 1 0 X<br />
X 0 X X<br />
KA = Qc . Qb
Jc = Qa<br />
Kc = Qa + Qb<br />
Jb= Qa<br />
Kb = 1<br />
Ja= Qc<br />
Ka= Qc . Qb
Synchronous Counter Versus Asynchronous Counter<br />
Asynchronous Counter<br />
Only the first flip-flop driven by<br />
external clock while the others flipflops<br />
are driven by previous flipflop.<br />
Cannot design random counters<br />
Propagation delay is severe for<br />
larger MOD of counters, especially<br />
at the MSB.<br />
Circuit design is very simple<br />
Synchronous Counter<br />
Synchronous counters are driven<br />
by same clock (simultaneously)<br />
Can design for sequence or<br />
random number<br />
No problem in propagation delay<br />
because all flip-flops is triggered<br />
simultaneously.<br />
Design involve complex logic<br />
circuit
Disadvantages of Asynchronous Counter<br />
compare to Synchronous Counter<br />
i. Has a propagation delay. The more number<br />
of flip-flops in an asynchronous counter, the<br />
slower it will be.<br />
ii.<br />
To count a truncated not equal to 2n, extra<br />
feedback logic is required.<br />
iii. Counting errors occur at high clocking<br />
frequency.
Cascade connection<br />
• The counter can be connected to get the<br />
higher mode counter.<br />
• The cascade connection constructed by<br />
connecting the output of the last flip-flop into<br />
the first flip-flop input of the next counter
• Asynchronous counter
• Synchronous counter<br />
In the synchronous counter, there have addition<br />
input as ‘count enable (CE)’ and ‘terminal count<br />
(TC)’ in the output to avoid propagation delay.<br />
The function of CE is to enable the counting<br />
process and TC is to moves counter to the<br />
next when the counter reaches the maximum<br />
number or to produce a high output when the<br />
process said to produce the maximum number.
Counters in Digital Clocks
5.0 COUNTER<br />
5.1 DEFINITION:<br />
A counter is a digital sequential logic device that will go<br />
through a certain predefined states (for example counting<br />
up or down) based on the application of the input pulses.<br />
They are utilized in almost all computers and digital<br />
electronics systems. There are two main types of counters:<br />
Asynchronous and Synchronous counters.<br />
5.1 Function of Counter<br />
Timing<br />
Sequencing<br />
Counting<br />
5.2 The Difference Between Asynchronous And Synchronous Counter<br />
Asynchronous Counter<br />
The circuit diagram for this counter is<br />
simple to design.<br />
Only the first flip-flop driven by<br />
external clock while the others flipflops<br />
are driven by previous flip-flop.<br />
Propagation delay is severe for larger<br />
MOD of counters, especially at the<br />
MSB.<br />
Frequency operating is low.<br />
Cannot design random counters<br />
Synchronous Counter<br />
The circuit diagram for this counter<br />
becomes difficult as number of states<br />
increase in the counter.<br />
The clock is driven by same clock<br />
(simultaneously)<br />
No problem in propagation delay<br />
because all flip-flops is triggered<br />
simultaneously.<br />
Frequency operating is higher.<br />
Can design for sequence or random<br />
number<br />
5.3 Mod of Counter<br />
The mod number is always equal to the number of states which the counter goes through in each<br />
complete cycle before it recycles back to its starting state.<br />
An n-bit ripple counter is called as modulo-N counter. Where, MOD number = 2 n .<br />
5.3.1 Examples Type of Modulus<br />
2 bit (MOD-4)<br />
3 bits (MOD-8)<br />
4 bits (MOD-16)<br />
5.3.2 Maximum number of Counter<br />
The largest number that counter will counting.<br />
Maximum number = M -1 ; M is modulus<br />
5.4 Number of Flip-flop<br />
Number of flip-flop, n = log M/log 2;<br />
M = modulus<br />
5.5 State Diagram<br />
State diagram shows the sequence of states through which the counter advances when it is clocked.<br />
Examples of state diagram:
Figure 5.1 State diagram of the MOD 8 UP Counter<br />
5.2 Asynchronous Counter<br />
5.2.1 Asynchronous Up Counter<br />
This counter will count in sequence from minimum usually startig at 0 to the<br />
maximum number that depending on the Mod of the counter.<br />
Example: counter in mod 8 will have a sequence number:<br />
000 001 010 011 100 101 110 111<br />
Figure 5.2 Asynchronous up counter circuit when using positive clock triggered<br />
Figure 5.3 Asynchronous up counter circuit when using negative clock triggered
5.2.2 Asynchronous Counter as a frequency dividers<br />
In the basic counter, each flip-flop provides an output waveform that is exactly half the<br />
frequency of the waveform at its clock input.it can be illustrate as figure below:<br />
Figure 5.4 Counter waveform showing frequency division by 2 for each flip-flop<br />
In general, for any counter the output from the last flip-flop divides the input clock<br />
frequency by the mod number of the counter. For example, a MOD-8 counter is also<br />
called as divide-by-8 counter.<br />
5.2.3 Asynchronous Down Counters<br />
Figure 5.5<br />
Asynchronous down counter circuit when using positive clock triggered<br />
Figure 5.6<br />
Asynchronous down counter circuit when using negative clock triggered
5.2.4 Asynchronous Up/Down Counters<br />
Figure 5.7 Asynchronous up/down counter circuit (Mod 8)<br />
Figure 5.8 Timing diagram Asynchronous up/down counter (Mod 8)<br />
5.2.5 Glitch in Asynchronous Counter<br />
Glitch is an undesired transition that occurs before the signal settles to its intended value. In other<br />
words, glitch is an electrical pulse of short duration that is usually the result of a fault or design<br />
error, particularly in a digital circuit.<br />
For example in a digital electronics, flip-flops are triggered by a pulse that must not be shorter<br />
than a specified minimum duration; otherwise, the component may malfunction. A pulse shorter<br />
than the specified minimum is called a glitch. A related concept is the runt pulse, a pulse whose<br />
amplitude is smaller than the minimum level specified for correct operation, and a spike, a short<br />
pulse similar to a glitch but often caused by ringing or crosstalk. A glitch can occur in the presence<br />
of race condition in a poorly designed digital logic circuit.<br />
5.2.6 Asynchronous Counter mode number less then 2 n<br />
Counter in this type are modified from basic counter in mod 2 n which allowing the counter<br />
to skip states that are normally part of the counting sequence. To illustrate for this counter,<br />
take an examples of 3 bit counter. Normally this counter will count from 000 to 111 but we<br />
can design to build a mod 5 counter which only count 000 to 100.
Figure 5.9 Mod 5 asynchronous up counter<br />
(i) The NAND output is connected to the asynchronous CLR (clear) inputs of each flip-flop.<br />
As long as the NAND output is HIGH, it will have no effect on the counter. When it goes<br />
LOW, it will clear all the flip-flop. So that, the counter immediately goes to the 000<br />
state.<br />
(ii) The input of the NAND gate are the outputs of Qc and Qb. So the NAND output will go<br />
LOW whenever Qa = Qc = 1. This condition will occur when the counter goes from 100<br />
to the 101 state. The LOW at the NAND output will immediately (nanosecond) clear the<br />
counter to 000 state<br />
5.2.7 Asynchronous Decade (Mod 10) Counter<br />
Figure 5.10 Decade Counter circuit
5.3 Synchronous Counter<br />
5.3.1 Synchronous Up Counter<br />
Figure 5.11 Mod-16 Synchronous Up Counter<br />
5.3.2 Synchronous Down Counter<br />
Figure 5.12 Mod-16 Synchronous Down Counter<br />
5.3.4 Synchronous Up/Down Counter
Figure 5.13 Mod-16 Synchronous Up/Down Counter<br />
5.3.5 Synchronous Decade Counter<br />
Figure 5.14 : Synchronous Decade Counter<br />
5.3.6 Synchronous counter in random number<br />
Example 1: Design a synchronous counter using JK flip-flops with positive edge clock triggered that can<br />
count a random number 0, 3, 5, 1, 4, 6 and repeated.<br />
Solution:<br />
Step 1: Define the number of flip-flop (use the highest number counting sequences. In this example, the<br />
highest number is 6)<br />
Mod, M = 6 + 1 [6 is the highest number in counter]<br />
M=2 n n = log 7/log 2 2.81 ~ 3 flip-flops<br />
Step 2: Table state<br />
Present state<br />
Next state<br />
000 011<br />
011 101<br />
101 001<br />
001 100<br />
100 110<br />
110 000
Step 3: Excitation table (refer to JK flip-flop truth table)<br />
JK Flip-flop Truth table<br />
Qn Qn+1 J K<br />
0 0 0 X<br />
0 1 1 X<br />
1 0 X 1<br />
Excitation table<br />
1 1 X 0<br />
Step 4: Built the K-Map
Step 5: Draw a logic circuit<br />
Example 2: Design a synchronous counter using T flip-flops with negative edge clock triggered that can count a<br />
random number 0, 1, 4, 7, 5, 2 and repeated.<br />
Solution:<br />
Step 1: Number of flip-flop<br />
Maximum number = 7<br />
Mod = Maximum number + 1<br />
= 8<br />
n = log 8/log 2<br />
= 3 flip-flops<br />
Step 3: Table state<br />
Present state Next State<br />
000 001<br />
001 100<br />
100 111<br />
111 101<br />
101 010<br />
010 000
Step 4 : Excitation table<br />
T Q n Q n+1<br />
0 0<br />
0<br />
1 1<br />
0 1<br />
1<br />
1 0<br />
T flip-flop truth table<br />
Output<br />
Input<br />
Present state Next state Tc Tb Ta<br />
000 001 0 0 1<br />
001 100 1 0 1<br />
100 111 0 1 1<br />
111 101 0 1 0<br />
101 010 1 1 1<br />
010 000 0 1 0<br />
Step 5 : K-map<br />
Step 6: Circuit diagram<br />
L2<br />
L3<br />
L4<br />
5V<br />
+V<br />
CLK<br />
CP1<br />
CP2 Q1<br />
Q2<br />
FFA<br />
S<br />
J Q<br />
CP _<br />
K Q<br />
R<br />
FFB<br />
S<br />
J Q<br />
CP _<br />
K Q<br />
R<br />
FFC<br />
S<br />
J Q<br />
CP _<br />
K Q<br />
R<br />
Figure 5.15 Synchronous counter with counting of 0, 1, 4, 7, 5, 2 and repeated
5.3 Disadvantages of asynchronous counter compare to synchronous counter<br />
a) Has a propagation delay. The more number of flip-flops in an asynchronous counter, the slower it will<br />
be.<br />
b) To count a truncated not equal to 2n, extra feedback logic is required.<br />
c) Counting errors occur at high clocking frequency.<br />
5.4 Different between Asynchronous Counter and Synchronous Counter<br />
Asynchronous Counter<br />
Only the first flip-flop driven by external clock<br />
while the others flip-flops are driven by<br />
previous flip-flop.<br />
Cannot design random counters<br />
Propagation delay is severe for larger MOD of<br />
counters, especially at the MSB.<br />
Circuit design is very simple<br />
Synchronous Counter<br />
Synchronous counters are driven by same<br />
clock (simultaneously)<br />
Can design for sequence or<br />
random number<br />
No problem in propagation delay because<br />
all flip-flops is triggered simultaneously.<br />
Design involve complex logic circuit<br />
5.5 Cascade connection in counter<br />
The counter can be connected to get the higher mode counter.<br />
The cascade connection constructed by connecting the output of the last flip-flop into the first flip-flop<br />
input of the next counter<br />
Figure 5.16 Mod 32 asynchronous counter using cascade connection<br />
I the syhroous outer, there have additio iput as out eale CE ad terial out TC<br />
in the output to avoid propagation delay.<br />
The function of CE is to enable the counting process and TC is to moves counter to the next when the<br />
counter reaches the maximum number or to produce a high output when the process said to<br />
produce the maximum number.
Figure 5.17 Mod 100 synchronous counter in cascade connection