Binary Counters: Types & Operations
Binary Counters: Types & Operations
diagram of MOD-10 counter. Fig. 6.2.l shows 2-bit asynchronous counter using JK
state
Draw
the
AU : Dec.-08, Marks 2 flip-flops. As shown in Fig. 6.2.1, the clock signal is
connected to the clock input of only first stage
flip-flop. The clock input of the second stage flip-flop
stage.
is triggered by the O, output of the first
Because of the inherent propagation delay time
clock
through a flip-flop, a transition of the input
first stage
pulse and atransition of the O, output of Therefore,
the same time.
Sp can never occur at exactly
simultaneously triggered,
the two flip-flops are never operation.
which results in asynchronous counter
diagram for two-bit
Fig. 6.2.1 (a) shows the timing changes in the
asynchronous counter. It illustrates the
in response to the clock.
state of the flip-flop outputs HIGH
Fig. 6.1.2 flip-flops are tied to logic
Jand K input of JK each negative edge of
ReviewQuestions hence output will toggle for
cOUnter2 the clock input.
What iS
1 counters.
State ypes of
Comparesynchronous and
asynchronous COunter. 3
4
3. AU : Dec.-17, Marks 2 CP 1L 2
1
counter.
Define modulus of a
1
LSB QA
1 1
Ka Kg
HIGH
Jp
In Fig. 6.2.2 (b), timing diagram for 3-bit asynchronous counter we have not
propagation delays of flip-flops, for simplicity. If we consider the propagation delavs
get timing diagram as shown in Fig. 6.2.3. considered th
0
0 1
0 1 1
1
1 1 1
0
CP 2
:
10
0 0 00 0:0 1 0:0
0 0: 0
0
1 1:1
Down
known counters
mustCounteber
are not
when a desired as widelyof used aspulses
up counters. They are used in situations where it
has occurred. In these situations the
preset to the number input down
desired
counter reaches the zeronumber and then allowed to count down as the pulses are applie
number of pulses have state it is detected by alogic gate whose
output then indicates
that
count
Whener the
is
J Q
CLK C
KÍ
Fig. 6.2.7
Sol. :
3 5 7 8
CLK
LSB Qo 1 1 -
1 1
MSB Q4 1 0
Count 11 10 01 00 11 1 01 800
Fig. 6.2.8
6.2.2 Asynchronous Up / Down Counter
To form an asynchronous up/down counter one control input say M is necessary to control the
operation of the up/down counter. When M = 0, the counter will count up and when M = 1, the
counter will count down. To achieve this the M input should be used to control whether the normal
flip-flop output (Q) or the inverted flip-flop output (O) is fed to drive the clock signal of the sucessive
stage flip-flop, as shown in Fig. 6.2.9 (a). The truth table for such combinational circuit is shown in
Fig. 6.2.9 (b).
onics
Inputs Output
Mode control MQQ
(M) 000 0
001 1 Y=k
M=0< 0 10 0 for down
0 11 1 counting
Combinational To CLK
Qutputsof 100 0
previousflip-flop circuit of next flip-flop Y=Q
10 1 for up
M=1 1 10 1 counting
(a) The block diagram of 1 11 1
combinational circuit
(b) Truth table
Fig. 6.2.9
For Y MQ
00 01 11 10
M -MO
1 10
1 1 1 MQ
MQ
:.Y= MQ+MQ
b) Logic diagram
a) K-map simplification
M
M
High
CLK
Kg Qg
up/down counter
Fig. 6.2.11 3-bit asynchronous
allows the QA and
1on M enables AND gates 1 and 2 and disables AND gates 3 and 4. This
A logic
respective next stages. So that counter will count up.
QE outputs to drive the clock inputs of their and AND gate 3 and 4 are enabled.. This
allows
When M is logic 0, AND gates 1 and 2 are disabled
respective next stages so that counter will
the QA and Q outputs to drive the clock inputs of their
counter. (See Fig. 6.2.12
count down. The Fig. 6.2.12 shows the timing diagramn for 3-bit up/down ripple
on next page).
Countg
UP/DOWN
=1
4 5 6 8
2 3
0
1 1
L
0 1
1 1 0
Q
1 1
0 1
UPIDOWN
=0
4 5 6 7
2 3
CLK
1 1
Q
Count 000 111 110 101 100 011 010 001 000
Fig. 6.2.12 Timing diagram for 3-bit UP/ DOWN ripple counter
/pecoding
Gates
of the
gatesare used to indicate whether counter has reached to particular state. The outputs for
Decoding goes high
are onnected to the AND gate as inputs and the output of the AND gaBe
counter
state. Let us see the Fig. 6.2.13 (a). Here, the output of decoding gate goes
high when
particular
outputs are C = 1, B = 1and A = 1. In Fig. 6.2.13 (b) the output of decoding
gate goes high
counter
counter outputs are C=1, B=0 and A- 0.
when
HIGH
JA
CLOCK
K
HIGH
CLOCK
KA Kg Kc
D
indicate state 4 (100)
Fig. 6.2.13 (b) Decoding gate to
desired state. The
connect corresponding outputs to decoding gate inputs to indicate
Similarly, we can
possible state detection for 3-bit counter.
Fig. 6.2.14 gives these connections for all
DD-: D
Fig. 6.2.14 Decoding gate connections
6.2.4 Problem Faced by Ripple Counters (Glitch Problem)
t. This illustrated
We know that, due to the propagation delay the output flip-flop is delayed by time 6. Here,
decodes state
in the waveform shown in Fig. 6.2.15 shows the waveform of the circuit which
the output of flip-flop A triggers the flip-flop B, hence the B waveform is delayed by one flip-flop
delay time (tp) from the negative transition of A. Similarly, the C waveform is delayed by tp from
each negative transition of B.
CLOCK
Glitch
CB
CBÃ CLOCK
CLOCK D
glitch
Fig. 6.2.15 Elimination of
7 to state 0.
Let us output waveform when the counter progresses trom state
observe the At point X, A
goes low (A goes high); however, because of flip-flop delay time, B does not go low
Thus between points Xand Y we have the condition C=1, B=1 and A =1. As a res1ult until point Y
the
high between points Xand Y. This undesirable output is known as glitch. We can avoid
the gloutitcphutiOns
the output waveform by connecting clock as afourth input to the decoding gate along with inputs A, B
and C. This is illustrated in the Fig. 6.2.15.
Review Questions
1. Explain in detail the operation of a 4-bit binary ripple counter. AU: Dec.-09, Marks 16
2. Explain the working of asynchronous down counter.
3. Design and explain the working of an up-down riyple counter. AU : May-03, Marks 8
4. What do you mean by asynchronous counter?
5. State the problem faced by ripple counters.
6. What is the primary disadvantage of asynchronous counter ? AU : May-17; Marks 2
0-9, i.e.
1: Determine the number of flip-flops needed. The BCD counter goes through states
Step total 10 states. Thus, N= 10 and for 2">N, we need n =4, i.e. 4 flip-flops required.
Step2: Type of flip-flops to be used: JK
Write the
W truth table for the counter
Step3 :
7 1
1 0 1
1 0 1
1 1 0 0
1 0 1 1
1 1 0 0 Invalid
states
1 1
1 1 0
1 1
counter
Table 6.3.1 Truth table for BCD
CD CD CD CD
CD
AB 00 01 11 10
AB 00 1 1 1 1
AB 011 1 1
.Y=
AB 11 0 0 0 0
1 0 0
-BC
AB 10 1
Fig. 6.3.1
JA A (MSB)
B Jp D (LSB)
CLK A B D
KA B Kç Kp D
CLR CLR CLR CLR
D
Reset logic
CE 2
8
0 1 0
1 1 1
0 0 0 1 1 1 1
Count 000 001 010 011 100 10
stage 110 111
0 1 2 3 4 5 6 7
Desumod
6 riyplc counter using Tflip-flops.
1; Determine the number of flip-flop required. Here, counter goes through 0 - 5 states, i.e.,
Step
atal 6 states. ThusN=6 and for 2" > Nwe needn=3, ie. 3 flip-flops.
B Output of
CLK A
reset logicY
0 0 1 BC
B Bc BC BC
A 01 11 10
00
1 1 1
11
2 1
Valid
3 0 1 1 1 states A 1 11 0
1 0 1 B .Y=
5 1 1
1 1 0 Invalid
states
1
Fig. 6.3.6
Fig. 6.3.5
Step 5: Draw logic diagram
Logic 1
B C
TA A
CLK B
A B
CLR CLR
CLR
Reset logic
Fig. 6.3.7
Review Questions
AU : Dec.-04, Marks 16
1. Explain the working of BCD ripple counter with timing diagrams.
2. Design mod 5 ripple counter using TFlip-Flops.
AU :Dec.-06,14, 16, May-08
6.4 Synchronous Counters
When counter is clocked such that each flip-flop in the counter is triggered at the same time, the
counter is called as synchronous counter.
inputchangvae riatbhlier
11/0
01/1 value in response to a change in an
race condition occurs in
inan asynchronous
00,10/1( 00,01/0
)01,11/1
00,10/1
circuit. In case of unequal delays, a race Condition
may cause the state variables to sequential
11/1
unpredictable manner. For example, if thersindhan
change in two state variables due to
change
10,11/0 change
variable such that both change from 00 to in
Fig. 8.6.4 11. Ininput
8.6.3 Race Free State
situation, the difference in delays may
cause the this
variable to change faster than the first
The state assignment step Assignment
in
second
state variables to change in sequence rom 00 resulting the
essentially the same as it is forasynchronous circuits is and then to 11. On the other hand.
except for one difference. In synchronous circuits, variable changes faster than the first, the second
state assignments are madesynchronous circuits, the variables change from 00 to 01 and then to the11. state
circuit reduction. In with the objective of final stable state that the circuit reaches dooeIf the
asynchronous
objective of state assignment is to avoid
circuits, the depend on the order in which the state
critical races. variable
changes,the race condition is not harmful
called a noncritical race. But, if the final and it is
stable state
W
A
PoA
oncritical
kRaces
11 (11)
10 (10)
86.6
illustrates noncritical races.
It shows
ratsiton
tablesin which Xis a input variable and y, Possible transitions
the state variables Consider a circuit is in a 00 11
00 01
state y,y,X=000 and there is a change in input 00 10
With this charnge in the
0to
1. input there are Fig. 8.6.7 Example of critical race
possibilities
that the state variables may change.
thnee
hmret oither change simultaneously from 00 to 11. Cycles
may change in sequence from 00 to 01 and asynchronous circuit makes a
orthey A cycle occurs when an
thento
11, or they may change in sequence from 00 transition through aseries of unstable
states. When a
andthen to 11. In all cases, the final stable state it introduces cycles,
o10 State assignment is made so that
which results in a noncritical race condition. In care must be taken to ensure
that each cycle
is11, a Cycle does not
8.6.6 final stable state is y,y,x =101. terminates on a stable state. If
Fig. (b) circuit will go from one
Contain a stable state, the
inputs are
unstable state to another, until the
must always be
00E00: 11 00 00 11 changed. Obviously, such a situation
circuits.
11 01 11
avoided when designing asynchronous
0
for making a
11 11 10 Two techniques are commnonly used
critical race free state assignment.
10 11 10 10 1. Shared row state assignment.
Possible transitions: Possible transitions :
2. One hot state assignment.
00 > 11 00 11 10
00 01 11 00 > 10 8.6.3.2| Shared Row State Assignment
10 11 00 01>11’ 10
00
(b) Races can be avoided by making a proper binary
(a) the state
assignment to the state variables. Here,
Fig. 8.6.6 Examples of noncritical races variables are assigned with binary numbers in
such a
any
Critical Races
way that only one state variable can change at
a circuit is To
Fig. 8.6.7 illustrates critical race. Consider time when a state transition OcCurs.
one
a change in accomplish this, it is necessary that states between
in a stable state y,v,x = 000 and there is
variables change which transition occur be given adjacent assignments.
input from 0 to 1. If state
simultaneously, the final stable state is yy,x = 111. If Two binary values are said to be adjacent if they
unequal differ in only one variable. For example, 110 and 11
Y, changes to 1 before Y, because. of the stable
Propagation delay, then the crcuit goes to are adjacent because they differ only in the third bit.
other hand, if Y,
State 011 and remain there. On the Fig. 8.6.8 shows the transition diagram. The transition
circuit goes to the
Changes faster than Y. then the diagram shows that there is transition from state a to
Hence, the race is
Stable state 101 and remain there. state b and transition from state a to state c. The state
goes to different stable
Citical because the circuit a is assigned binary value 00 and state c is assigned
in which the state
States depending on the order binary value 11. This assignment will cause a critical
variables change. race during the transition from a to c because there
TECHNICAL PUBLICATIONS- An up thrust for knowledae
Digital Electronics 8-24 Asynchronouss
are two
changes in the binary state variables. A race variable for each row of the flow
Scquential Creit C
ee table.
assignment
addition
can be obtained by introducing
which is binary state say d with binary value 10,
the modified
adjacent to both a and c. Fig. 8.6.9 shows
rows are introduced to
changes between internal
provide single
state Ad ditonal
illustrated in the following example.transitions. Thvairsiableis
transition diagram. As shown in the
ig. 8.6.9, the transition from a to c will go Consider a flow table given in Fig..8.6.10 four
This causes the binary through a. variables are used to represent the four rows in state
10 ’ 11 which variables to change from 00
satisfy the condition that only one-’ table. Each row is represented by a case the
binary variable
thus avoiding thechanges during cach state transition,
one of the four state variables is a 1. A where ony
critical race.
This technique is called
from state Ato state B requires two
changes; E from 1 to 0 and , from 0
state
to
travarnsitiiaoblne
because in this techniqueshared row state assignment directing the transition Ato Bthrough a new 1. ByE
extra state, i.e. extra
introduced in a flow table. This extra state shared row is which contains 1s where both states A and B row
between two stable states. We require only one state variable have 1s.
transition A to E and then changeE from
from transition
8.6.3.3 One Hot State to
This permits the race free transition between A B.
The one hot state Assignment B.
for finding a race free assignment is an another method
method, only one variable state assignment. In this In general, we can say that, in row i of the
is active or 'hot for each
row in the original flow table,
state variable F; is 1 and all other state variables are table,
i.e. it requires one state 0. When a transition between row i and
row i ie
required, first state variable F; is set to 1(so that
a=00 both F; and F; are 1), and then F; is set to 0. Thus
b=01
State variables
State
Inputs XX,
F4 F3 F2 F 00 01 11 10
0 00 1 A (A) B C
0 01 0
A ) C D
01 0 0 A B) C
c=11
1 00 0 D D) B C D
Fig. 8.6.8 Transition diagram
Fig. 8.6.10 Flow table
State variables
Fa F3 F2 F State Inputs X4 X
00 01 11
0 0 10
A
Original 00 1
table ¤E B C
1 0 0
AF gG
1 0 0 0
D (D BH
0 0 1 1
E A
0 1 0 1 F C C
Added
1 1 0
rows G B
1 0 1 0
H D
1 1 0 0
11
10 F F B E 1
10
Fig. 8.6.13 Primitive flow table for example problem
for example problem
Fig. 8.6.12 State diagram
8-39
the steps involved in the design of OCCur in
the
Smchrononsseguential circuit. delays at different paths. Hazards cause a
AU : Dec.-16,17, Marks 13 combinational circuits, where they may
When
such
Whatisthe objective of state assignment in a temporary false output used in the asynchronous
value.
psynchronoUSciYCuit2
AU : May-17, Marks
combinational circuits are transition to a
13 sequential circuits, they may result in a
wrong stable state.
and
B/DataSynchronizers Static hazards
There are two types of hazards :
static hazard exists if a signal is
synchronizer is a circuit that synchronizes a dynamic hazards. A
value when an
Istemwhere several modules are using their own Supposed to remain at particular logicbut instead the
input variable changes its value,
in its required
cocksbut no Common system clock is available. It
momentary change
asynchronous inputs and synchronize them; Signal undergoes a static hazards are
kesallmake value. According to definition, the static-1
them consistent with the module clock. static-0 hazard and
is,
that further classified as
8.7,1 shows the circuit for simple data hazard.
The Fig. momentarily
synchronizer. It synchronizes single data input with
In a combinational circuit, if output goes
known as
module clock. In this circuit, eventhough the
when it should remain a1. the hazard is
the O goes
asynchronousinput Bappears any time, it is applied other hand, if output
static-1 hazard. On the
synchronous module in synchronization with remain a 0, the hazard
momentarily 1 when it shouldAnother type of hazard
module clock. The Fig. 8.7.2 shows the synchronizer hazard.
1s known as static-0 three or
which output changes
timings. X 1S dynamichazard in should change from to 0 or
1
Synchronized more times when it
data input 1. The Fig. 8.8.1 shows the three types of
from 0 to
D
(Asynchronous to module clock hazards.
datainput) Synchronous
module
Output of
gate 2 Propagation delay of gate 2 only
Circuit output
Static - 1 hazard
CD
AB \CD
00 01 11 10 AB
Group 2 00 01 11 10
00| 1 1
Group 3 00 1: 1
01| J1......1 -Group 1 0 1 |1)
11K1}
11 1
10|1
10|1 1
Fig. 8.8.5
TECHNICAL PUBLICATIONS- An up thrust for
krnowledge
8-41 Asynchronous Sequential Circuits
t-Y=XX,+,Y o0(0) 1 K0
AND 2
00 01 11 10 00 01 11 10
Y
1
00 0 1 0
1 1 0 1||1 1 1|| 0
X,
AND
AND 2
Y= XX, +X,Y +X,Y
AND 3
R= AC
Such circuit can be implemented using
two-level circuit of NAND
gates as shown in the Fig. 8.8.11. The first D
level
gates that implement each product term in theconsists NAND
of
CD
AB 00 01 11 10
00 1 1
01 1
11 1 1
10
Fig. 8.8.13
Marks 16
AU : Dec.-02, CSE,
following machine has essential hazard.
Ex. 8.8.3 Using Unger's theorem, show that the asynchronous
an
an essential hazard exists in PS NS
Sol. : We have seen that, next total states
total state, S has a different x =1
circuit when a present stable
X= 0
transitions of
variable X, and after three
after one transition of an input 00 00 01
hazard
3 10(1) - 00(0) ’ 01(1) ’ 11(0) essential
11(0) ’ 10(1) ’ 00(0) 01(1) essential hazard
4
F= CD + AB +BD
AB
CD
01
OR-AND
11
00 1
1
10
1
= F=CD+ AB+BD
01 1
0
- (C+ D)(A +B)(B+D)
11 1
0
1............ 1
10 1
Fig. 8.8.14
B D
Fig. 8.8.15
Ex. 8.8.5 Show that no static 0 (static 1) hazard can happen in a two
level AND-OR (OR-AND) realisation of a
switching function F. AU : May-03, CSE, Marks 16
Sol. : Dynamic hazards due to a change in an
input variable x, can only occur if there are three or more
paths between the x, (and/or x) input and the network
output. Such condition does not exists in two level
AND-OR gate networks hence dynamic hazards do not occur in two
level AND-OR gate networks.
Ex. 8.8.6 Find a static and dynamic hazard free realization for the
) NOR gates F (a, b, c, d) = ))m (1, 5, 7, 14, 15) following function using i) NAND gates
AU : May-04, CSE, Marks 16
ol. : i) Circuit realization using NAND gate
F = ac d+ab d +bcd + abc
11 10
00 01
00 Enclosing minterm C
01
(11
Fig. 8.8.18
functions.
Ex. 8.8.7 Give hazard-free realization for the following Boolean AU : Dec.-07,
CSE/IT, Marks 8