Professional Documents
Culture Documents
3
2
1
0
d) Logic diagram
http://modul2poli.blogspot.com/
2-to-4 Decoder with active LOW enable input
8
AB en D B A en D
B A en D B A en D
3 1
2 0
,
,
a) Logic symbol b) Truth table
c) Boolean expression
d) Logic diagram
Enable input used to control the
operation of the decoderActive
mode is 0- active low
http://modul2poli.blogspot.com/
The 74x139 Dual 2-to-4 Decoder
9
a) Logic symbol
b) Logic diagram
1 1 1 1
1 1 1 0
1 1 0 1
1 0 1 1
0 1 1 1
1 X X
0 0 0
0 0 1
0 1 0
0 1 1
Y3 Y2 Y1 Y0 G B A
Outputs Inputs
Truth table for one-half of a
74x139 dual 2-to-4 decoder
http://modul2poli.blogspot.com/
10
3 to 8 Binary Decoder (active HIGH)
3-to-8
Decoder
X
Y
F0
F1
F2
F3
F4
F5
F6
F7
Z
a) Logic symbol
x y z F
0
F
1
F
2
F
3
F
4
F
5
F
6
F
7
0 0 0 1 0 0 0 0 0 0 0
0 0 1 0 1 0 0 0 0 0 0
0 1 0 0 0 1 0 0 0 0 0
0 1 1 0 0 0 1 0 0 0 0
1 0 0 0 0 0 0 1 0 0 0
1 0 1 0 0 0 0 0 1 0 0
1 1 0 0 0 0 0 0 0 1 0
1 1 1 0 0 0 0 0 0 0 1
F
1
= x'y'z
x z y
F
0
= x'y'z'
F
2
= x'yz'
F
3
= x'yz
F
5
= xy'z
F
4
= xy'z'
F
6
= xyz'
F
7
= xyz
b) Truth table
c) Logic diagram & Boolean Expression
http://modul2poli.blogspot.com/
11
The 74x138 3-to-8 Decoder
a) Logic symbol
(b) Logic diagram.
http://modul2poli.blogspot.com/
12
The 74x138 3-to-8 Decoder
(b) Block Diagram
(c) Function table
http://modul2poli.blogspot.com/
13
The equation for the output signal Y5:
Active-low
It has three enable inputs, G1, G2A, G2B , all of which
must be asserted for the selected output to be asserted.
The 74x138 3-to-8 Decoder
A B C B G A G G Y 2 2 1 5
http://modul2poli.blogspot.com/
Exercise
Design a decoder listing below
a) BCD to decimal decoder
b) 4 to 16 decoder
14
http://modul2poli.blogspot.com/
Seven Segment Display
Used for displaying information in a form that can be
understood by user or operator.
Information can be in alphanumeric (numbers and
letters).
Seven segment configuration which its arrangement
uses LED for each segment.
two ways of arrangement common anode and
common cathode.
Each arrangement needs different driver/ decoder to
drive each segment of seven segment display.
15
http://modul2poli.blogspot.com/
16
BCD-to-7 Segment Decoder / Driver
http://modul2poli.blogspot.com/
A B C D a b c d e f g
0 0 0 0
0 0 0 1
0 0 1 0
0 0 1 1
0 1 0 0
0 1 0 1
0 1 1 0
0 1 1 1
1 0 0 0
1 0 0 1
1 0 1 0
1 0 1 1
1 1 0 0
1 1 0 1
1 1 1 0
1 1 1 1
17
FILL IN THE TRUTH FOR ACTIVE LOW BCD TO 7 SEGMENT DECODER
http://modul2poli.blogspot.com/
Any combinational circuit with n inputs and m outputs
can be implemented with an n-to-2
n
decoder (active
HIGH) with m OR gates to generate a minterms
OR gate forms the sum
The output lines of the decoder corresponding to
the minterms of the function are used as inputs to
the or gate
Suitable when a circuit has many outputs, and each
output function is expressed with few minterms.
It can also use AND gates and n-to-2
n
decoder to
generate a Maxterm function.
18
Decoder applications
http://modul2poli.blogspot.com/
Example: Full adder
S(x, y, z) = S (1,2,4,7)
C(x, y, z) = S (3,5,6,7)
19
Decoder applications (full adder)
x y z C S
0 0 0 0 0
0 0 1 0 1
0 1 0 0 1
0 1 1 1 0
1 0 0 0 1
1 0 1 1 0
1 1 0 1 0
1 1 1 1 1
3-to-8
Decoder
S
2
S
1
S
0
x
y
z
0
1
2
3
4
5
6
7
S
C
a) Truth table
b) Minterm Expression
http://modul2poli.blogspot.com/
20
Decoder applications example
f
1
(x
2
,x
1
,x
0
) = M(0,1,3,5) and f
2
(x
2
,x
1
,x
0
) = M(1,3,6,7)
(a) Using output or-gates. (b) Using output nor-gates.
http://modul2poli.blogspot.com/
21
f
1
(x
2
,x
1
,x
0
) = Sm(0,2,6,7) and f
2
(x
2
,x
1
,x
0
) = Sm(3,5,6,7)
(a) Using output and-gates. (b) Using output nand-gates.
Application Example
Decoder applications example
http://modul2poli.blogspot.com/
An encoder is a combinational logic circuit that
essentially performs a reverse of decoder function
Number of input lines is larger than output lines
Decoder VS Encoder
22
Encoder
Decoder Encoder
http://modul2poli.blogspot.com/
Only one of input lines is activated at a given time and
produces an N-bit output code depending on which input
is active.
For example octal to binary encoder: if input 4 is active,
the output code should be 100 with 1 is MSB bit.
23
Encoder
http://modul2poli.blogspot.com/
I
0
I
3
I
2
I
1
I
5
I
4
I
7
I
6
2
2
2
1
2
0
24
Octal to Binary Encoder
Inputs Outputs
I
0
I
1
I
2
I
3
I
4
I
5
I
6
I
7
y
2
y
1
y
0
1 0 0 0 0 0 0 0 0 0 0
0 1 0 0 0 0 0 0 0 0 1
0 0 1 0 0 0 0 0 0 1 0
0 0 0 1 0 0 0 0 0 1 1
0 0 0 0 1 0 0 0 1 0 0
0 0 0 0 0 1 0 0 1 0 1
0 0 0 0 0 0 1 0 1 1 0
0 0 0 0 0 0 0 1 1 1 1
b) Truth table a) Logic Symbol
http://modul2poli.blogspot.com/
25
Octal to Binary Encoder
I
0
I
1
I
2
I
3
I
4
I
5
I
6
I
7
y
0
= I
1
+ I
3
+ I
5
+ I
7
y
1
= I
2
+ I
3
+ I
6
+ I
7
y
2
= I
4
+ I
5
+ I
6
+ I
7
c) Boolean Expression d) Logic diagram
http://modul2poli.blogspot.com/
Decimal to BCD Priority Encoder
26
The priority function means that the encoder will produce
a BCD output corresponding to the highest-order decimal
digit input that is active and will ignore any other actives
input
http://modul2poli.blogspot.com/
Multiplexer
A multiplexer is a device that allows digitals information
from several sources to be routed onto a single line for
transmission over that line to a common destination
The basic multiplexer has several data-input line and a
single output line
has data select inputs, which permit digital data on any
one of the inputs to be switched to the output line
also known as data selector
27
http://modul2poli.blogspot.com/
Multiplexer
28
http://modul2poli.blogspot.com/
2 - to - 1 Multiplexer
2 input
Mux
I
0
I
1
z
s
29
b) Truth Table
c) Boolean Expression
d) Logic Circuit a) Logic Symbol
http://modul2poli.blogspot.com/
4 - to - 1 Multiplexer
4 input
Mux
z
S1
I
0
I
3
I
2
I
1
S0
30
c) Boolean Expression
b) Truth Table
a) Logic Symbol
d) Logic diagram
3 0 1 2 0 1 1 0 1 0 0 1
I S S I S S I S S I S S z
http://modul2poli.blogspot.com/
The 74ALS151 8 inputs Multiplexer
31
http://modul2poli.blogspot.com/
32
Multiplexer Application
http://modul2poli.blogspot.com/
Logic design using Mux
Case1- number of input is
equal to number of select lines
Design procedure
Connect inputs to selected
lines
Identify the decimal number
corresponding to each
minterm in the expression
Connect logic 1 level to
input lines corresponding to
these numbers
Connect logic 0 level to the
others
33
f(x,y,z) = Sm(0,2,3,5)
Example - 3 variable function using 8-to1 line Multiplexer
http://modul2poli.blogspot.com/
34
Logic design using Mux
Case 2: Number of inputs is
higher than number of select
lines
Design procedure
Reduce the number of inputs to
the number of select lines by
inspection
k-map
http://modul2poli.blogspot.com/
xy
z
00
1 0
10
11
01
1
0
1 0
0
0 0
1
I
0
I
2
I
3
I
1
S
1
S
0
35
Logic design using Mux
Example implement f(x,y,z) = Sm(0,2,3,5) using 4
input mux
0
2
3 1
0
I
z I I
z I
a) k-map b) Boolean Exp c) implementation
http://modul2poli.blogspot.com/
36
Logic design using Mux
(Exercise)
Realize the f(a,b,c,d) =
Sm(0,2,3,5,8,9,11,12,14,15)
Using
a)8 input Mux
b)4 input Mux
http://modul2poli.blogspot.com/
37
Demultiplexer (Demux)
Basically reverses the multiplexing function
Takes data from one line and distributes them to a
given numbers of output lines.
Demultiplexer also known as a data distributor.
Decoders can also be used as a demultiplexers.
http://modul2poli.blogspot.com/
38
Figure (a) shows a 1-line-to-4-line demultiplexer circuit.
The data input lines goes to all of the AND gates. The
two data lines only one gate at a time, and the data
appearing on the data-input line will pass through the
selected gated to the associated data output line.
Figure (a): 1-line-to-4-line demultiplexer
http://modul2poli.blogspot.com/
39
Example:
The serial data input waveform (data in) and data selectors input (s0 and s1) are
shown in figure (b). Determine the data output waveforms on D0 through D3 for the
demultiplexer in figure (a).
Solution:
Notice that the select lines go through a binary sequence so that each successive
input bit is routed to D0, D1, D2 and D3 in sequence as shown by the output
waveforms in figure (b).
Figure (b)
http://modul2poli.blogspot.com/
1
Chapter 4:
FLIP FLOPS
(Sequential Circuits)
http://modul2poli.blogspot.com/
Course Learning Outcomes, CLO
CLO 2:
simplify logical expressions by using Boolean
algebra and related techniques orderly.
CLO 5:
explain the operation of basic sequential circuits
correctly.
http://modul2poli.blogspot.com/
Summary
- Types Of Flip Flops:
SR Flip-Flop,
Clocked SR Flip-Flop,
T Flip-Flop and
JK Flip-Flop.
- Symbols, Truth Tables and Timing.
T Flip-Flops and D Flip-Flops
built using JK Flip-Flops.
http://modul2poli.blogspot.com/
4
4.0 Introduction
Sequential Circuits
The output of circuit depends on the previous output and the
present inputs.
The inputs must follow a specific sequence to produce a required
output.
In order to follow a sequence of inputs the circuits must contain
some form of memory to retain knowledge of those inputs, which
have already occurred.
This memory are obtained by feedback connections, which are
made so that history of the previous inputs is maintained.
Most sequential systems are based on a small number of simple
sequential circuit elements known as Bistables or Flip Flops.
http://modul2poli.blogspot.com/
5
4.0 Flip Flop (Sequential Circuits)
What is Flip flop?
Answer:
In digital circuits, the flip-flop, is a kind
of bistable multivibrator.
It is a Sequential Circuits / an
electronic circuit which has two stable
states and thereby is capable of
serving as one bit of memory , bit 1 or
bit 0.
http://modul2poli.blogspot.com/
6
4.0 Introduction Flip Flop
They are 1 (HIGH) or 0
(LOW).
Whenever we refer to the
state of flip flop, we refer to
the state of its normal output
(Q).
More complicated Flip flop
use a clock as the control
input. These clocked flip-flops
are used whenever the input
and output signals must
occur within a particular
sequence.
Figure 4.0.1 : General Flip flop
symbol
Inputs Q Normal output
Inverted Output
They have two stable conditions and
can be switched from one to the
other by appropriate inputs. These
stable conditions are usually called
the states of the circuit.
Q
http://modul2poli.blogspot.com/
Types Of Flip Flop
1. SR Flip Flop
a. SR Flip Flop Active Low = NAND gates
b. SR Flip Flop Active High = NOR gates
2. Clocked SR Flip Flop
3. JK Flip Flop
4. JK Flip Flop With Preset And Clear
5. T Flip Flop
6. D Flip Flop
http://modul2poli.blogspot.com/
The Used of Flip Flop
For Memory circuits
For Logic Control Devices
For Counter Devices
For Register Devices
http://modul2poli.blogspot.com/
9
4.1 SR Flip Flop
The most basic Flip Flop is called SR Flip Flop.
The basic SR flip flop is an asynchronous device.
In asynchronous device, the outputs is immediately
changed anytime one or more of the inputs change
just as in combinational logic circuits.
It does not operate in step with a clock or timing.
These basic Flip Flop circuit can be constructed using
two NAND gates latch or two NOR gates latch.
SR Flip Flop Active Low = NAND gates
SR Flip Flop Active High = NOR gates
http://modul2poli.blogspot.com/
10
4.1 SR Flip Flop
Figure 4.1.1:
SR Flip Flop logic
Symbol
The SR Flip Flop has two
inputs, SET (S) and RESET
(R).
The SR Flip Flop has two
outputs, Q and
The Q output is considered
the normal output and is the
one most used.
The other output is simply
the compliment of output Q.
Q
Q
http://modul2poli.blogspot.com/
11
4.1 SR Flip Flop - NAND GATE LATCH
NAND GATE LATCH
Figure 4.1.2: SR NAND (Active
LOW) Logic circuit.
The NAND gate version has two
inputs, SET (S) and RESET (R).
Two outputs, Q as normal
output and as inverted output
and feedback mechanism.
The feedback mechanism is
required to form a sequential
circuit by connecting the output
of NAND-1 to the input of
NAND-2 and vice versa.
The circuit outputs depends on
the inputs and also on the
outputs.
Q
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
http://modul2poli.blogspot.com/
12
4.1 SR Flip Flop - NAND GATE LATCH
Figure 4.1.3 Feedback Mechanism
http://modul2poli.blogspot.com/
13
4.1 SR Flip Flop - NAND GATE LATCH
Normal Resting
State Figure 4.1.4.a
Input S=1 , R=1 ,
This is the normal
resting state of the
circuit and it has no
effect of the output
states.
Output Q and will
remain in whatever state
they were in prior to the
occurrence of this input
condition.
It works in HOLD mode
of operation.
1
2
0
1
1
1
0
1
1
1
1
1
1 1
1
2
1
0 0
0
1
Q
1
2
http://modul2poli.blogspot.com/
14
4.1 SR Flip Flop - NAND GATE LATCH
Input, S = 0, R = 1
This will set Q = 1.
It works in SET mode
operation.
Figure 4.1.4.b
1
2
0
1
0
1
0
1
http://modul2poli.blogspot.com/
15
4.1 SR Flip Flop - NAND GATE LATCH
Figure 4.1.4.c
Input S = 1, R = 0
This will reset Q = 0.
It works in RESET mode
operation.
1
2
1
0
1
0
0
1
http://modul2poli.blogspot.com/
16
4.1 SR Flip Flop - NAND GATE LATCH
Figure 4.1.4.d
This condition tries to set and
reset the NAND gate latch at the
same time.
It produces Q = = 1
This is unexpected condition,
since the two outputs should be
inverses of each other.
If the inputs are returned to 1
simultaneously, the output states
are unpredictable.
This input condition should not
be used and when circuits are
constructed, the design should
make this condition
S = R = 0 never arises.
It is called INVALID/PROHIBITED
1
2
0
0
1
1
1
0
Q
http://modul2poli.blogspot.com/
17
4.1 SR Flip Flop - NAND GATE LATCH
From the description of the NAND gate
latch operation, it shows that the SET and
RESET inputs are active LOW.
The SET input will set Q = 1 when SET is
0 (LOW).RESET input will reset Q = 0
when RESET is 0 (LOW)
In the prohibited/INVALID state both
outputs are 1. This condition is not used
on the RS flip-flop. The set condition
means setting the output Q to 1.
Likewise, the reset condition means
resetting (clearing) the output Q to 0. The
last row shows the disabled, or hold,
condition of the RS flip-flop. The outputs
remain as they were before the hold
condition existed. There is no change in
the outputs from the previous states.
The flip-flop memorizes the previous
condition.
Figure 4.1.5 : SR NAND gate
latch Truth Table
S R Q
STATUS
0 0 1 1
INVALID
0 1 1 0
SET
1 0 0 1
RESET
1 1 Q
HOLD
(NoChange)
Q
Q
S R Q
STATUS
0 0 1 1
INVALID
0 1 1 0
SET
1 0 0 1
RESET
1 1 Q
HOLD
(NoChange)
http://modul2poli.blogspot.com/
18
4.1 SR NAND Flip Flop-Waveforms
Exercise 4.1.1:
Determine the output of NAND
gate latch which Q initially 1 for
the given input waveforms.
S
R
Q
Example 4.1.1: Determine the
output of NAND gate latch which Q
initialy 0 for the given input waveform.
S
R
Q
Q
Q
http://modul2poli.blogspot.com/
19
4.1 SR Flip Flop - NOR GATE LATCH
NOR GATE LATCH
Figure 4.1.6: SR NOR
(Active HIGH) Logic circuit
The latch circuit can also be
constructed using two NOR
gates latch.
The construction is similar to
the NAND latch except that
the normal output Q and
inverted output have
reversed positions.
Q
http://modul2poli.blogspot.com/
20
4.1 SR Flip Flop - NOR GATE LATCH
The analysis of a SR FLIP FLOP
NOR :
* S = 0, R = 0; This is the normal
resting state of the circuit and it
has no effect of the output states.
Q and will remain in whatever
state they were in prior to the
occurrence of this input condition.
It works in HOLD (no change)
mode operation.
S = 0, R = 1; This will reset Q to
0, it works in RESET mode
operation.
SR FLIP FLOP NOR
(Active HIGH) Logic circuit
Q
http://modul2poli.blogspot.com/
21
4.1 SR Flip Flop - NOR GATE LATCH
S = 1, R = 0; This will set Q to 1, it works in SET mode operation.
S = 1, R = 1; This condition tries to set and reset the NOR gate
latch at the same time, and it produces Q = = 0. This is an
unexpected condition and are not used.
Since the two outputs should be inverse of each other. If the inputs
are returned to 1 simultaneously, the output states are unpredictable.
This input condition should not be used and when circuits are
constructed, the design should make this condition
SET=RESET = 1 never arises.
Q
http://modul2poli.blogspot.com/
22
4.1 SR Flip Flop - NOR GATE LATCH
From the description of the
NOR gate latch operation, it
shows that the SET and
RESET inputs are Active
HIGH.
The SET input will set Q = 1
when SET is 1 (HIGH).
RESET input will reset Q
when RESET is 1 (HIGH).
Figure 4.1.7 : SR NOR gate latch
Truth Table
S R Q
STATUS
0 0
HOLD
(NoChange)
0 1 0 1
RESET
1 0 1 0
SET
1 1 0 0
INVALID
Q Q
Q
_
http://modul2poli.blogspot.com/
23
4.1 SR NOR Flip Flop -Waveforms
Example 4.1.2: Determine the
output of NOR gate latch which
Q initially 0 for the given input
waveforms.
S
R
Q
Exercise 4.1.2 : Determine the
output of NOR gate latch which
Q initially 1 for the given input
waveforms.
S
R
Q
Q
Q
http://modul2poli.blogspot.com/
24
4.2 The CLOCK
In synchronous device, the exact times at
which any output can change states are
controlled by a signal commonly called the
clock.
The clock signal is generally a rectangular
pulse train or a square wave as shown in
figure 4.9.
The clock is distributed to all parts of the
system, and most of the system outputs can
change state only when the clock makes a
transition.
http://modul2poli.blogspot.com/
25
4.2 The CLOCK
When the clock changes from a LOW state to a HIGH
state, this is called the positive-going transition (PGT)
or positive edge triggered.
When the clock changes from a HIGH state to a LOW
state, it is called negative going transition (NGT) or
negative edge triggered.
Figure 4.2.1: Clock Pulse-Train
(a) Positive going transition
(b) Negative going transition
Enable
Disable
http://modul2poli.blogspot.com/
26
4.2 Clocked SR Flip Flop
Additional clock input is
added to change the SR flip-
flop from an element used in
asynchronous sequential
circuits to one, which can be
used in synchronous circuits.
The clocked SR flip flop logic
symbol that is triggered by
the PGT is shown in Figure
4.2.2
Its means that the flip flop
can change the output states
only when clock signal makes
a transition from LOW to
HIGH.
Figure 4.2.2 : PGT Clocked SR Flip
flop symbol
http://modul2poli.blogspot.com/
27
4.2 Clocked RS Flip Flop
clock
S R Q
STATUS
0 0 Q Q
HOLD
(NoChange)
0 1 0 1
RESET
1 0 1 0
SET
1 1 0 0
INVALID
Figure 4.2.3: Truth Table for
clocked SR Flip Flop
The Truth Table in figure
4.2.3 shows how the flip
flop output will respond to
the PGT at the clocked
input for the various
combinations of SR inputs
and output.
The up arrow symbol
indicates PGT.
Q
_
http://modul2poli.blogspot.com/
28
Example 4.2.1: Determine the
output of PGT clocked SR flip
flop which Q initially 0 for the
given input waveforms
Cp
S
R
Q
Exercise 4.2.1: Determine the
output of PGT clocked SR flip
flop which Q initially 1 for the
given input waveforms.
Cp
S
R
Q
4.2 Clocked SR Flip Flop
Q
Q
http://modul2poli.blogspot.com/
29
4.2 Clocked SR Flip Flop
Figure 4.2.4 : NGT Clocked
SR Flip flop symbol
The clocked SR Flip
Flop logic symbol
that is triggered by
the NGT is shown in
Figure 4.2.4
It means that the Flip
flop can change the
output states only
when clocked signal
makes a transition
from HIGH to LOW.
http://modul2poli.blogspot.com/
30
4.2 Clocked SR Flip Flop
Figure 4.2.5: CLOCKED SR
FLIP FLOP LOGIC CIRCUIT
http://modul2poli.blogspot.com/
31
4.2 Clocked SR Flip Flop
Figure 4.2.6: CLOCKED SR
FLIP FLOP LOGIC CIRCUIT
If used NOR Gate, must used
AND Gate in front.
http://modul2poli.blogspot.com/
32
4.2 Clocked SR Flip Flop
Example 4.2.2: Determine the
output of NGT clocked SR flip
flop which Q initially 0 for the
given input waveforms
Cp
S
R
Q
Exercise 4.2.2: Determine the
output of NGT clocked SR flip
flop which Q initially 1 for the
given input waveforms.
Cp
S
R
Q
Q Q
http://modul2poli.blogspot.com/
33
4.3 JK Flip Flop - Symbol
Another types of Flip flop is JK
flip flop.
It differs from the RS flip flops
when J=K=1 condition is not
indeterminate but it is defined to
give a very useful changeover
(toggle) action.
Toggle means that Q and will
switch to their opposite states.
The JK Flip flop has clock input
Cp and two control inputs J and
K.
Operation of Jk Flip Flop is
completely described by truth
table in Figure 4.3.3.
Figure 4.3.1 : PGT JK Flip
flop symbol
Figure 4.3.2 : NGT JK Flip
flop symbol
Q
http://modul2poli.blogspot.com/
34
4.3 JK Flip Flop Truth Table And Logic Circuit
Figure 4.3.3: Truth Table for JK
Flip Flop
Figure 4.3.4: JK FLIP FLOP
LOGIC CIRCUIT
clock
J K Q
STATUS
0 0
HOLD
(No Change)
0 1 0 1
RESET
1 0 1 0
SET
1 1
Toggle
Q
Q
_
Q
Q Q
_
http://modul2poli.blogspot.com/
35
4.3 JK Flip Flop - waveforms
Example 4.3.1 : Determine the output of PGT clocked JK flip flop for
the given input waveforms which the Q initially 0.
J
Clk
K
Q
http://modul2poli.blogspot.com/
36
4.3 JK Flip Flop - waveforms
Exercise 4.3.1:Determine the output
of NGT clocked JK flip flop for the
given input waveforms which the
Q initially 0.
Exercise 4.3.2:Determine the output
of PGT clocked JK flip flop for the
given input waveforms which the
Q initially 0.
J
K
Q
Cp
Q
Cp
Cp
K
J
Q
Q
http://modul2poli.blogspot.com/
37
4.4 JK Flip Flop with Asynchronous Input
The J and K inputs are called synchronous inputs
since they only influence the state of the flip flop when
the clocked pulse is present.
This flip flop can also have other inputs called Preset
(or SET) and clear that can be used for setting the flip
flop to 1 or resetting it to 0 by applying the appropriate
signal to the Preset and Clear inputs.
These inputs can change the state of the flip flop
regardless of synchronous inputs or the clock.
http://modul2poli.blogspot.com/
38
4.4 JK Flip Flop with Preset and Clear
Figure 4.4.1 : Symbol and Truth Table
http://modul2poli.blogspot.com/
39
4.4 JK Flip Flop with Asynchronous Input
Example 4.4.2 : The output of clocked JK flip flop which output initially 0
for the given input waveforms.
Cp
Preset
Clear
J
K
Q
Q
http://modul2poli.blogspot.com/
40
4.4 JK Flip Flop with Asynchronous Input
Exercise 4.4.3 : The output of clocked JK flip flop which output
initially 0 for the given input waveforms.
Cp
Preset
K
Clear
Q
http://modul2poli.blogspot.com/
41
4.5 T Flip Flop - Symbol
The T flip flop has only
the Toggle and Hold
Operation.
If Toggle mode
operation. The output
will toggle from 1 to 0 or
vice versa.
Figure 4.5.1: Symbol for T
Flip Flop
T
clock
Q
status
0 Q Q
HOLD
1 Q Q
TOGOL
Q
Figure 4.5.2 :Truth Table for T Flip Flop
CP
T
http://modul2poli.blogspot.com/
42
4.5 T Flip Flop Logic Circuit
Cp
T
T
Logic circuit T Flip flop
using NOR gate
Logic circuit T Flip flop
using NAND gate
Figure 4.5.3: Logic circuit for T Flip Flop
http://modul2poli.blogspot.com/
43
4.5 T Flip Flop Waveforms
Example 4.5.1 : Determine the output of PGT T flip flop for
the given input waveforms which the Q initially 0.
T
Clk
Q
Q
http://modul2poli.blogspot.com/
44
4.5 T Flip Flop Wave forms
Exercise 4.5.1 : Determine the output of
PGT T flip flop for the given input
waveforms which the Q initially 0.
Exercise 4.5.2 : Determine the output of
NGT T flip flop for the given input
waveforms which the Q initially 0.
Cp
Cp
Q
T
Q
Q
T
Q
http://modul2poli.blogspot.com/
45
4.6 D Flip Flop
Also Known as Data Flip flop
Can be constructed from RS
Flip Flop or JK Flip flop by
addition of an inverter.
Inverter is connected so that
the R input is always the
inverse of S (or J input is
always complementary of K).
The D flip flop will act as a
storage element for a single
binary digit (Bit).
Figure 4.6.1 :
D Flip flop symbol
http://modul2poli.blogspot.com/
46
4.6 D Flip Flop - Symbol
PGT NGT
D
Clk
Q
Q
D
Flip Flop
Positive Edge
D
Clk
Q
Q
D
Flip Flop
Negative Edge
Figure 4.6.2 : D Flip flop symbol using JK Flip Flop / SR Flip Flop
http://modul2poli.blogspot.com/
47
4.6 D Flip Flop- Logic circuit-Truth Table
Figure 4.6.3: Logic
circuit for D Flip Flop
Figure 4.6.4: Truth
Table for D Flip Flop
D
clock
Q
status
0 0 1
RESET
1 1 0
SET
Q
Cp
http://modul2poli.blogspot.com/
48
4.6 D Flip Flop Waveforms
Example 4.6.1 : Determine the output of
PGT D flip flop for the given input
waveforms which the Q initially 0.
Cp
D
Exercise 4.6.1 Determine the output
of NGT D flip flop for the given input
waveforms, which output Q initially 0.
Cp
D
Q
Q
Q
Q
http://modul2poli.blogspot.com/
49
4.7 T Flip Flops and D Flip Flops can be
Built using JK Flip Flop
The JK flip flop is considered
as a universal flip flop.
A combination of Jk flip flop
and an inverter can construct
a D Flip Flop as shown in
Figure 4.18
It also can construct T Flip
Flop by combine both J and K
inputs with HIGH level input
as shown in Figure 4.19
Figure 4.7.1 : D Flip flop
symbol using JK Flip Flop / SR
Flip Flop
Figure 4.7.2 : T Flip flop
symbol using JK Flip Flop / SR
Flip Flop
T
http://modul2poli.blogspot.com/
LOGO
Chapter 5 : Counters
1
http://modul2poli.blogspot.com/
2
Course Learning Outcomes, CLO
CLO 5 : Explain The Operation Of Basic
Sequential Circuits Correctly
http://modul2poli.blogspot.com/
SUMMARY
COUNTERS
Basic concepts of asynchronous and
synchronous counters;
logic circuits and timing diagram of
counter.
Various types of asynchronous and
synchronous counters.
http://modul2poli.blogspot.com/
4
Introduction COUNTERS
A counter is a register that goes through a predetermined
sequence of states upon the application of clock pulses.
Asynchronous counters
Synchronous counters
Asynchronous Counters (or Ripple counters)
the clock signal (CLK) is only used to clock the first FF.
Each FF (except the first FF) is clocked by the preceding FF.
Synchronous Counters,
the clock signal (CLK) is applied to all FF, which means that
all FF shares the same clock signal,
thus the output will change at the same time.
EE 202 DIGITAL ELECTRONICS
http://modul2poli.blogspot.com/
5
Modulus (MOD) the number of states it counts in a complete cycle
before it goes back to the initial state.
Thus, the number of flip-flops used depends on the MOD of the counter
(ie; MOD-4 use 2 FF (2-bit), MOD-8 use 3 FF (3-bit), etc..)
Example: MOD-4 Ripple/Asynchronous Up-Counter.
Introduction COUNTERS
EE 202 DIGITAL ELECTRONICS
http://modul2poli.blogspot.com/
Asynchronous Counters
6
EE 202 DIGITAL ELECTRONICS
http://modul2poli.blogspot.com/
Asynchronous (Ripple) UP Counters
The Asynchronous Counter that counts 4 number starts from
00011011 and back to 00 is called MOD-4 Ripple (Asynchronous)
Up-Counter.
Next state table and state diagram
7
Present State Next State
Q
1
Q
0
Q
1
Q
0
00 01
01 10
10 11
11 00
00
01
10
11
EE 202 DIGITAL ELECTRONICS
http://modul2poli.blogspot.com/
Asynchronous (Ripple) UP Counters
A two-bit asynchronous counter is
shown on the left. The external clock is
connected to the clock input of the first
flip-flop (FF0) only. So, FF0 changes
state at the falling edge of each clock
pulse, but FF1 changes only when
triggered by the falling edge of the Q
output of FF0.
Note that for simplicity, the transitions
of Q0, Q1 and CLK in the timing
diagram above are shown as
simultaneous even though this is an
asynchronous counter. Actually, there
is some small delay between the CLK,
Q0 and Q1 transitions.
8
Figure 2.1 : MOD 4 Asynchronous Up Counter
Waveform
EE 202 DIGITAL ELECTRONICS
http://modul2poli.blogspot.com/
Because of the inherent propagation
delay through a flip-flop, the transition
of the input clock pulse and a transition
of the Q output of FF0 can never occur
at exactly the same time. Therefore,
the flip-flops cannot be triggered
simultaneously, producing an
asynchronous operation.
The 2-bit ripple counter circuit shown
has four different states, each one
corresponding to a count value.
Similarly, a counter with n flip-flops can
have 2 to the power n states. (2
n
) The
number of states in a counter is
known as its mod (modulo) number.
Thus a 2-bit counter is a mod-4
counter.
Asynchronous (Ripple) UP Counters
9
Figure 2.1 : MOD 4 Asynchronous Up Counter
Waveform
EE 202 DIGITAL ELECTRONICS
http://modul2poli.blogspot.com/
Asynchronous (Ripple) UP Counters
Usually, all the CLEAR inputs are
connected together, so that a single
pulse can clear all the flip-flops before
counting starts. The clock pulse fed
into FF0 is rippled through the other
counters after propagation delays, like
a ripple on water, hence the name
Ripple Counter
A mod-n counter may also described as
a divide-by-n counter. This is because
the most significant flip-flop (the
furthest flip-flop from the original clock
pulse) produces one pulse for every n
pulses at the clock input of the least
significant flip-flop (the one triggers by
the clock pulse).
10
Figure 2.1 : MOD 4 Asynchronous Up Counter
Waveform
EE 202 DIGITAL ELECTRONICS
http://modul2poli.blogspot.com/
MOD 8 Asynchronous Up Counter
The following is a three-bit
asynchronous binary counter and its
timing diagram for one cycle.
It works exactly the same way as a two-
bit asynchronous binary counter
mentioned above, except it has eight
states due to the third flip-flop.
11
Figure 2.2 : MOD 8 Asynchronous Up Counter
Waveform
EE 202 DIGITAL ELECTRONICS
http://modul2poli.blogspot.com/
MOD 8 Asynchronous Up Counter
12
Figure 2.3a Next State Table Figure 2.3b State Diagram
Present State Next State
CBA CBA
000 001
001 010
010 011
011 100
100 101
101 110
110 111
111 000
0
1
2
3
7
6
5
4
EE 202 DIGITAL ELECTRONICS
http://modul2poli.blogspot.com/
Exercise :
13
J Q
K
Q
CLK
1
J Q
K
Q
CLK
1
J Q
K
Q
CLK
1
A B C
CLK
A 0
B 0
C 0
Figure 2.4 : MOD 8 Asynchronous Up Counter
EE 202 DIGITAL ELECTRONICS
http://modul2poli.blogspot.com/
MOD 16 Asynchronous Up counter (Negative Triggered)
14
Figure 2.5 : MOD 16 Asynchronous Up Counter
EE 202 DIGITAL ELECTRONICS
http://modul2poli.blogspot.com/
Exercise : Draw a MOD 16 Asynchronous DOWN Counter
(Negative Triggered) :
MOD 16 Asynchronous Up counter (Positive Triggered)
15
Figure 2.6 : MOD 16 Asynchronous Up Counter
EE 202 DIGITAL ELECTRONICS
http://modul2poli.blogspot.com/
Asynchronous DOWN Counter
Figure 2.7 : MOD 4 or 2-bit Asynchronous down counter
16
J Q
K Q
CLK
1
J Q
K
Q
CLK
1
A (LSB) B (MSB)
A 0 1 0 1 0 1 0 1 0
B 0 1 1 0 0 1 1 0 0
CLK
Binary 0 3 2 1 0 3 2 1 0
EE 202 DIGITAL ELECTRONICS
http://modul2poli.blogspot.com/
17
Exercise:
Design a MOD-4 ripple down-counter
Design a MOD-8 ripple down counter
using negative triggered.
Design a MOD-16 ripple down counter
using positive triggered.
Asynchronous Counters
EE 202 DIGITAL ELECTRONICS
http://modul2poli.blogspot.com/
18
So far, we have design the counters with MOD number equal to
2
N
, where N is the number of bit (N = 1,2,3,4.) (also correspond
to number of FF)
Thus, the counters are limited on for counting MOD-2, MOD4,
MOD-8, MOD-16 etc..
The question is how to design a MOD-5, MOD-6, MOD-7, MOD-9
which is not a MOD-2
N
(MOD 2
N
)
?
MOD-6 counters will count from 0
10
(000
2
) to 5
10
(101
2
) and after
that will recount back to 0
10
(000
2
) continuously.
Asynchronous Counters (MOD 2
N
)
EE 202 DIGITAL ELECTRONICS
http://modul2poli.blogspot.com/
19
MOD-6 ripple up-counter (MOD 2
N
)
Present St. Next St.
CBA CBA
000 001
001 010
010 011
011 100
100 101
101 000(110)
0
1
2
3
5
4
Reset the state to 000
2
when 110
2
is detected
Asynchronous Counters (MOD 2
N
)
Figure 2.8b :State Diagram
Figure 2.8a :Next State Table
EE 202 DIGITAL ELECTRONICS
http://modul2poli.blogspot.com/
20
Asynchronous Counters (MOD 2
N
)
Circuit diagram for MOD-6 ripple up-counter (MOD 2
N
)
J Q
K
CLR
Q
CLK
1 1 1
A (LSB) B
C(MSB)
J Q
K
CLR
Q
CLK
J Q
K
CLR
Q
CLK
Detect the output at
CBA=110 to activate
CLR. NAND gate is used
to detect outputs that generates 1!
CLK
Present St. Next St.
CBA CBA
000 001
001 010
010 011
011 100
100 101
101 000(110)
EE 202 DIGITAL ELECTRONICS
http://modul2poli.blogspot.com/
21
Exercise : Draw MOD-5 Ripple Down-counter and Up-
counter (MOD 2
N
)
Asynchronous Counters (MOD 2
N
)
EE 202 DIGITAL ELECTRONICS
http://modul2poli.blogspot.com/
22
IC for Asynchronous counters (IC 74293)
74293 IC for Asynchronous counter with Reset (MR1 and MR2)
MR1
MR2
Q0 Q1 Q2 Q3
CP0
CP1
74293
CLR
Q
CLK
1 1 1
Q0 Q1 Q2
CLR
Q
CLK
CLR
Q
CLK
1
CLR
Q
CLK
Q3
MR1
MR2
CP0
CP1
K K K K
J J J J Q Q Q Q
EE 202 DIGITAL ELECTRONICS
http://modul2poli.blogspot.com/
23
Using 74293 IC to design MOD 16 Asynchronous UP-Counter!
Exercise:
Use 74293 IC to design MOD-10 ripple up-counter
IC for Asynchronous counters (IC 74293)
MR1
MR2
Q0 Q1 Q2 Q3
CP0
CP1
74293
1 0 1 0
EE 202 DIGITAL ELECTRONICS
http://modul2poli.blogspot.com/
24
Exercise:
Determine the MOD for each configuration shown below?
IC for Asynchronous counters (IC 74293)
MR1
MR2
Q0 Q1 Q2 Q3
CP0
CP1
74293
MR1
MR2
Q0 Q1 Q2 Q3
CP0
CP1
74293
1 0 1
Answer : MOD 8
Answer : MOD 5
http://modul2poli.blogspot.com/
25
Determine the MOD for configuration shown below?
IC for Asynchronous counters (IC 74293)
MR1
MR2
Q0 Q1 Q2 Q3
CP0
CP1
74293
Answer : MOD 14
1 1 1
1
EE 202 DIGITAL ELECTRONICS
http://modul2poli.blogspot.com/
26
IC for Asynchronous counters (IC 74293)
Exercise : Design Asynchronous counters MOD-60
using IC 74293.
Solution : Discuss with your Lecturer in class.
EE 202 DIGITAL ELECTRONICS
Exercise : i. Design Asynchronous counters MOD-55
using IC 74293.
ii. Design Asynchronous counters MOD-
1000 using IC 74293.
http://modul2poli.blogspot.com/
Asynchronous Decade Counters
The binary counters previously introduced have two to the power n states. But
counters with states less than this number are also possible. They are designed to
have the number of states in their sequences, which are called truncated
sequences. These sequences are achieved by forcing the counter to recycle before
going through all of its normal states.
A common modulus for counters with truncated sequences is ten. A counter with
ten states in its sequence is called a decade counter. The circuit below is an
implementation of a decade counter.
27
Figure 2.3 : Asynchronous Decade Counter
http://modul2poli.blogspot.com/
The sequence of the decade counter is
shown in the table below:
Once the counter counts to ten (1010),
all the flip-flops are being
cleared. Notice that only Q1 and Q3 are
used to decode the count of ten. This
is called partial decoding, as none of
the other states (zero to nine) have
both Q1 and Q3 HIGH at the same time.
Asynchronous Decade Counters
28
Figure 2.4 : True Table Asynchronous Decade Counter
http://modul2poli.blogspot.com/
Asynchronous Up-Down Counters
In certain applications a counter must be able to count both up and
down. The circuit below is a 3-bit up-down counter. It counts up or down
depending on the status of the control signals UP and DOWN. When the
UP input is at 1 and the DOWN input is at 0, the NAND network between
FF0 and FF1 will gate the non-inverted output (Q) of FF0 into the clock
input of FF1. Similarly, Q of FF1 will be gated through the other NAND
network into the clock input of FF2. Thus the counter will count up.
29
Figure 2.5 : Asynchronous Up-Down Counter
http://modul2poli.blogspot.com/
When the control input UP is at 0 and DOWN is at 1, the inverted outputs of
FF0 and FF1 are gated into the clock inputs of FF1 and FF2 respectively. If
the flip-flops are initially reset to 0's, then the counter will go through the
following sequence as input pulses are applied.
Asynchronous Up-Down Counters
E2002 : Electronic System 2 30
Figure 2.5 : Asynchronous Up-Down Counters
http://modul2poli.blogspot.com/
Notice that an asynchronous up-down counter is slower than an
up counter or a down counter because of the additional
propagation delay introduced by the NAND networks.
Asynchronous Up-Down Counters
E2002 : Electronic System 2 31
http://modul2poli.blogspot.com/
E2002 : Electronic System 2 32
Asynchronous Up-Down Counters
Figure 2.3 : Asynchronous Up-Down Counters Waveform For 4 Bit Up-Down Counter
http://modul2poli.blogspot.com/
33
Disadvantages of Asynchronous Counters:-
Propagation delay is severe for larger MOD of counters, especially
at the MSB.
Existence of glitch is inevitable for MOD 2
N
counters.
Cannot design random counters (i.e:- to design circuit that counts
numbers in these sequence
56723156723156.)
Solution, use SYNCHRONOUS COUNTERS.
Asynchronous Counters
EE 202 DIGITAL ELECTRONICS
http://modul2poli.blogspot.com/
Synchronous Counters
34
EE 202 DIGITAL ELECTRONICS
http://modul2poli.blogspot.com/
Synchronous Counters
A synchronous counter, in contrast to an asynchronous counter, is one whose
output bits change state simultaneously, with no ripple. The only way we can build
such a counter circuit from J-K flip-flops is to connect all the clock inputs together,
so that each and every flip-flop receives the exact same clock pulse at the exact
same time:
35 EE 202 DIGITAL ELECTRONICS
http://modul2poli.blogspot.com/
Now, the question is, what do we do with the J and K inputs? We know that we still have to
maintain the same divide-by-two frequency pattern in order to count in a binary sequence, and
that this pattern is best achieved utilizing the "toggle" mode of the flip-flop, so the fact that the
J and K inputs must both be (at times) "high" is clear. However, if we simply connect all the J
and K inputs to the positive rail of the power supply as we did in the asynchronous circuit, this
would clearly not work because all the flip-flops would toggle at the same time: with each and
every clock pulse!
Synchronous Counters
36 EE 202 DIGITAL ELECTRONICS
http://modul2poli.blogspot.com/
Synchronous Counters
37 EE 202 DIGITAL ELECTRONICS
http://modul2poli.blogspot.com/
Synchronous Counters
38 EE 202 DIGITAL ELECTRONICS
http://modul2poli.blogspot.com/
39
For synchronous counters, all the flip-flops are using the
same CLOCK signal. Thus, the output would change
synchronously.
Procedure to design synchronous counter are as follows:-
STEP 1: Obtain the State Diagram.
STEP 2: Obtain the Excitation Table using state transition
table for any particular FF (JK or D). Determine number
of FF used.
STEP 3: Obtain and simplify the function of each FF input
using K-Map.
STEP 4: Draw the circuit.
How To Design Synchronous Counter
EE 202 DIGITAL ELECTRONICS
http://modul2poli.blogspot.com/
40
Design a MOD-4 synchronous up-counter,
using JK FF.
STEP 1: Obtain the State transition Diagram
How To Design Synchronous Counter
0
1
2
3
00
01
10
11
Binary
EE 202 DIGITAL ELECTRONICS
http://modul2poli.blogspot.com/
41
STEP 2: Obtain the Excitation table. Two JK FF are used.
How To Design Synchronous Counter
Present State Next State Input, J K
B A B A J
B
K
B
J
A
K
A
0 0 0 1 0 X 1 X
0 1 1 0 1 X X 1
1 0 1 1 X 0 1 X
1 1 0 0 X 1 X 1
OUTPUT TRANSITION
Q
N
Q
N+1
FF INPUT
J K
0 0 0 X
0 1 1 X
1 0 X 1
1 1 X 0
Excitation table
EE 202 DIGITAL ELECTRONICS
http://modul2poli.blogspot.com/
42
STEP 3: Obtain the simplified function using K-Map
How To Design Synchronous Counter
B
A
0
1
0 0 1
1 X X
J
B
= A
B
A
0
1
0 X X
1 0 1
K
B
= A
B
A
0
1
0 1 X
1 1 X
J
A
= 1
B
A
0
1
0 X 1
1 X 1
K
A
= 1
EE 202 DIGITAL ELECTRONICS
http://modul2poli.blogspot.com/
43
STEP 4: Draw the circuit diagram.
(MOD-4 synchronous up-counter )
How To Design Synchronous Counter
J
A
Q
A
K
A
A
Q
CLK
1
J
B
Q
B
K
B
B
Q
CLK
A (LSB) B (MSB)
EE 202 DIGITAL ELECTRONICS
http://modul2poli.blogspot.com/
How To design Synchronous Counter
Let us employ these techniques to design a MOD-8 counter to count in the
following sequence: 0, 1, 2, 3, 4, 5, 6, 7.
Step1: Determined Flip Flop Used and Creating state transition
diagram. (Rajah Keadaan)
N = 2
n
8 = 2
n
n = log 8 / log 2
= 3 Flip Flop ( 3 Bit )
M = 2
n
-1
= 2
3
- 1 = 8
- 1 = 7
44
N = Modulo/MOD
n = Flip Flop Used
M = Maximum Number To Be Count
EE 202 DIGITAL ELECTRONICS
http://modul2poli.blogspot.com/
Step 2: Creating present state-next state table
How To design Synchronous Counter
45
Present State Next State
Q
2
Q
1
Q
0
Q
2
Q
1
Q
0
0 0 0 0 0 1
0 0 1 0 1 0
0 1 0 0 1 1
0 1 1 1 0 0
1 0 0 1 0 1
1 0 1 1 1 0
1 1 0 1 1 1
1 1 1 0 0 0
Q0 = QA
Q1 = QB
Q2 = Qc
EE 202 DIGITAL ELECTRONICS
http://modul2poli.blogspot.com/
Step 3: Expand the present state-next state table to form the transition
table.
How To Design Synchronous Counter
46
Present
State
Next State Present inputs
Q
C
Q
B
Q
A
Q
C
Q
B
Q
A
J
C
K
C
J
B
K
B
J
A
K
A
0 0 0 0 0 1 0X 0X 1X
0 0 1 0 1 0 0X 1X X1
0 1 0 0 1 1 0X X0 1X
0 1 1 1 0 0 1X X1 X1
1 0 0 1 0 1 X0 0X 1X
1 0 1 1 1 0 X0 1X X1
1 1 0 1 1 1 X0 X0 1X
1 1 1 0 0 0 X1 X1 X1
Excitation Table
(J adual Ujaan Flip Flop
J K)
Q Q J K
0 0 0 X
0 1 1 X
1 0 X 1
1 1 X 0
_
X indicates a "dont care" condition.
EE 202 DIGITAL ELECTRONICS
http://modul2poli.blogspot.com/
Step 4: Use Karnaugh maps to identify the present state logic functions
for each of the inputs.
E.g. for J
2
we get:
How To Design Synchronous Counter
47
J
C
= Q
B
Q
A
Using similar techniques for the other inputs we get:
K
C
= Q
B
Q
A
J
B
= Q
A
K
B
= Q
A
J
A
= 1
K
A
= 1
0
2
6
4
1
3
7
5
QA
QA
1 1 1 0 01 00
QcQB
QcQB
0
1 0
0 0
1
X
X
X
X
EE 202 DIGITAL ELECTRONICS
http://modul2poli.blogspot.com/
Step 5: Constructing Circuit
How To Design Synchronous Counter
48
A
A
A
A B
B
C
C
C
C
B
B
EE 202 DIGITAL ELECTRONICS
http://modul2poli.blogspot.com/
How To Design Synchronous
Counter
that count Random number
Example :
Design a Synchronous Counter to Count 4,7,3,0 and 2
respectively
using JKFlip Flop negative trigered by showing:
i. Flip Flop Used
ii. State Transition Diagram
iii. Exitation Table / Present state, next State
iv. Karnough Map & perform Simplified Function
v. The Synchronous Counter
EE 202 DIGITAL ELECTRONICS
http://modul2poli.blogspot.com/
Solution:
Step 1 : Flip Flop Used
Find Modulo, N= 2
n
M = 7, M = 2
n
-1 = 7
2
n
= N , so, N = 7+1 = 8, MOD 8
2
n
= 8, n = log 8 / log 2
n = 3 bit = 3 Flip Flop.
Synchronous Counter to Count 4,7,3,0 and 2 respectively
EE 202 DIGITAL ELECTRONICS
http://modul2poli.blogspot.com/
Solution:
Step 2 : State Transation
Diagram, to count 4, 7, 3, 0
and 2.
Present
Qn
Next
State
Qn+1
J K
0 0 0 x
0 1 1 x
1 0 x 1
1 1 x 0
100
000
111
011
010
Synchronous Counter to Count 4,7,3,0 and 2 respectively
Exitation Truth Table For Counter
using JK FlipFlop
EE 202 DIGITAL ELECTRONICS
http://modul2poli.blogspot.com/
Step 3 : Exitation Table /present State, Next State
Deci
mal
Present
State
Next State JC KC JB KB JA KA
QC QB QA QC QB QA
4 1 0 0 1 1 1 x 0 1 x 1 x
7 1 1 1 0 1 1 x 1 x 0 x 0
3 0 1 1 0 0 0 0 x x 1 x 1
0 0 0 0 0 1 0 0 x 1 x 0 x
2 0 1 0 1 0 0 1 x x 1 0 x
Synchronous Counter to Count 4,7,3,0 and 2 respectively
EE 202 DIGITAL ELECTRONICS
http://modul2poli.blogspot.com/
Step 4: Karnough Map and
Simplified Function
00 01 11 10
0
0 0 x 1
1
x x x x
Synchronous Counter to Count 4,7,3,0 and 2 respectively
K-Map For
JA = QC
CB
A
0
3
4 2
1 5
6
7
EE 202 DIGITAL ELECTRONICS
http://modul2poli.blogspot.com/
00 01 11 10
0
0 0 X 1
1
X X X X
00 01 11 10
0
X X X X
1
X 1 0 X
K-Map For
JA = QC
K-Map For
KA = QC
Synchronous Counter to Count 4,7,3,0 and 2 respectively
CB
A
0
3
4 2
1 5
6
7
CB
A
0
3
4 2
1 5
6
7
EE 202 DIGITAL ELECTRONICS
http://modul2poli.blogspot.com/
00 01 11 10
0
1 X X 1
1
X X X X
00 01 11 10
0
X 1 X X
1
X 1 0 X
K-Map For
JB = 1
K-Map For
KB = QC
Synchronous Counter to Count 4,7,3,0 and 2 respectively
CB
A
0
3
4 2
1 5
6
7
CB
A
0
3
4 2
1 5
6
7
EE 202 DIGITAL ELECTRONICS
http://modul2poli.blogspot.com/
00 01 11 10
0
0 1 X X
1
X 0 X X
00 01 11 10
0
X X X 0
1
X X 1 X
K-Map For
JC = QA+QB
K-Map For
KC = QB
Synchronous Counter to Count 4,7,3,0 and 2 respectively
CB
A
0
3
4 2
1 5
6
7
CB
A
0
3
4 2
1 5
6
7
EE 202 DIGITAL ELECTRONICS
http://modul2poli.blogspot.com/
Step 5 : Perform Counter Circuit
By using simplified function from K-Map, JA = QC, KA = QC,
JB = 1, KB = QC, JC = QA + QB, KC = QB
'1' / Vdd
Synchronous Counter to Count 4,7,3,0 and 2 respectively
J
A
Q
A
K
A
Q
A
JB QB
KB QB
JC QC
KC QC
CP,CLOCK PULSE
EE 202 DIGITAL ELECTRONICS
http://modul2poli.blogspot.com/
Synchronous Counter
Exercises:
Design a counter to count in the following
sequence: 6, 4. 2, 3, 1.
Design a counter to count in the following
sequence: 15,9,11,5,2,13,1.
Do more exercises in Past Years Exam Paper.
End Of This Topic..
58 EE 202 DIGITAL ELECTRONICS
http://modul2poli.blogspot.com/
59 EE 202 DIGITAL ELECTRONICS
REFERENCES:
1. "Digital Systems Principles And Application"
Sixth Editon, Ronald J. Tocci.
2. "Digital Systems Fundamentals"
P.W Chandana Prasad, Lau Siong Hoe,
Dr. Ashutosh Kumar Singh, Muhammad Suryanata.
http://modul2poli.blogspot.com/
CHAPTER 6: SHIFT REGISTER
http://modul2poli.blogspot.com/
Course Learning Outcomes, CLO
CLO 5 : Explain The Operation Of
Basic Sequential Circuits Correctly
http://modul2poli.blogspot.com/
SUMMARY
REGISTERS
Basic concepts of registers and shift
registers;
classification of shift registers;
arithmetic circuit;
integrated circuit of shift registers;
Ring counters and Johnson counter.
http://modul2poli.blogspot.com/
Introduction Shift Register
4
Shift registers are constructed using several flip-
flop, connected in such a way to STORE and
TRANSFER/ Shift digital data.
Basically, D flip-flop is used. The input data
(either 0 or 1) is applied to the D terminal and
the data will be stored at Q during
positive/negative-edge transition of the clock
pulse.
D Q
Q
EE 202 : DIGITAL ELECTRONICS
http://modul2poli.blogspot.com/
5
One D FF is used to store 1-bit of data. Thus, the
number of flip-flops used is the same with the
number of bit stored.
Shift register mean that the data in each FF can be
transferred/move to other FF upon edge triggering
of the clock signal.
Four types of data movement in shift register are:-
Parallel in / parallel out (PIPO)
Serial in / serial out (SISO)
Parallel in / serial out (PISO)
Serial in / parallel out (SIPO)
Shift Register
EE 202 : DIGITAL ELECTRONICS
http://modul2poli.blogspot.com/
6
Serial Parallel
Movement of N-bit data
require N number of CLK
pulses. Thus, the operation is
slow.
Only one FF is required to be
connected at the output
terminal, thus only one wire is
required.
Require only one CLK pulse
to transfer all N-bit of data.
Thus, operation is faster than
serial.
Required N number of
connection to the output
terminal, which is proportional
to the number of bit. Thus, too
many connection is required.
Serial Data VS Parallel Data movement
EE 202 : DIGITAL ELECTRONICS
http://modul2poli.blogspot.com/
7
D Q
2
CP
D Q
1
CP
D Q
3
CP
D Q
0
CP
D
3
D
2
D
1
D
0
Q
3
Q
2
Q
1
Q
0
Flip-flop configuration for PIPO register.
CLK
EE 202 : DIGITAL ELECTRONICS
http://modul2poli.blogspot.com/
Parallel in / parallel out (PIPO)
8
PIPO data movement.
Q
3
Q
2
CLK
Q
1
Q
0
1 0 1 1 1
0
0
0
0
1 0 1 0
0
0
0
1 1 1 1
0 0 1 0
D
3
D
2
D
1
D
0
1
0
1
0
0
1
1
0
http://modul2poli.blogspot.com/
9
Flip-flop connection for SISO.
D Q
1
FF1
CP
D Q
2
FF2
CP
D Q
0
FF0
CP
D Q
3
FF3
CP CLK
D
IN
1
st
CLK
2
nd
CLK 3
rd
CLK 4
th
CLK
EE 202 : DIGITAL ELECTRONICS
http://modul2poli.blogspot.com/
Serial in / serial out (SISO)
10
SISO data movement. Binary data 10111 is transferred!
DATA-IN
Q
3
Q
0
Q
1
1st
CLK
2nd 3rd 4th 5th
Q
2
1 0 1 1 1
http://modul2poli.blogspot.com/
11
Flip-flop connection for PISO.
D Q
1
FF1
CP
D Q
2
FF2
CP
D Q
0
FF0
CP
D Q
3
FF3
CP CLK
D
0
D
1
D
2
D
3
SHIFT/LOAD
Serial
data
out
http://modul2poli.blogspot.com/
12
Parallel in / serial out (PISO)
PISO data movement.
SHIFT/
LOAD
CLK
Q
3
0
0 1 1 1
1 0 1
0
0
0
1
1 1 1 1
0 0 1 1
D
0
D
1
D
2
D
3
1 0 0 1 0 1
http://modul2poli.blogspot.com/
13
A shift register counter is a shift register whose
output being fed back (connected back) to the
serial input. This shift register would count the
state in a unique sequence!
Two types of shift register counter:-
The ring counter
The J ohnson counter
Shift Register Counters
EE 202 : DIGITAL ELECTRONICS
http://modul2poli.blogspot.com/
14
Ring Counter
Ring counters are used to
construct One-Hot
counters
It can be constructed for any
desired MOD number
A MOD-N ring counter uses
N flip-flops connected in the
arrangement as shown in fig.
a)
In general ring-counter will
require more flip-flops than a
binary counter for the same
MOD number
EE 202 : DIGITAL ELECTRONICS
http://modul2poli.blogspot.com/
15
Ring Counter
Q
3
Q
2
Q
1
Q
0
EE 202 : DIGITAL ELECTRONICS
http://modul2poli.blogspot.com/
16
Ring Counter
EE 202 : DIGITAL ELECTRONICS
http://modul2poli.blogspot.com/
17
Ring Counter
0 0 0 1
1 0 0 0
0 1 0 0
0 0 1 0
EE 202 : DIGITAL ELECTRONICS
http://modul2poli.blogspot.com/
Exercise: Draw a 3 Bit Ring Counter Circuit
with initial input 010 . show a True Table until 8
clock pulse/number sequence and draw the output
waveform.
Answer:
Discuss with Your lecturer
18
Ring Counter
EE 202 : DIGITAL ELECTRONICS
http://modul2poli.blogspot.com/
19
Johnson Counter
Or Twisted-ring counter
Johnson counter constructed exactly like a normal ring counter
except that the inverted output of the last flip-flop is fed back to
first flip-flop
EE 202 : DIGITAL ELECTRONICS
http://modul2poli.blogspot.com/
20
Johnson Counter
EE 202 : DIGITAL ELECTRONICS
http://modul2poli.blogspot.com/
21
Johnson Counter
A
B
C
0 1 1 1
0 0 1 1
0 0 0 1
EE 202 : DIGITAL ELECTRONICS
http://modul2poli.blogspot.com/
22
Chips for shift registers
74164 is a 8-bit SIPO shift register
74164
CLK
CLR
A
B
Q
0
Q
1
Q
2
Q
3
Q
4
Q
5
Q
6
Q
7
EE 202 : DIGITAL ELECTRONICS
http://modul2poli.blogspot.com/
23
Chips for shift registers
74165 is a 8-bit PISO register
74165
CLK
CLK INH
SH/LD
SER
D
0
D
1
D
2
D
3
D
4
D
5
D
6
D
7
Q
7
Q
7
EE 202 : DIGITAL ELECTRONICS
http://modul2poli.blogspot.com/
24
Chips for shift registers
74195 can be used as a 4-bit PIPO register
74195
CLK
SH/LD
J
K
Q
0
Q
1
Q
2
Q
3
CLR
D
0
D
1
D
2
D
3
EE 202 : DIGITAL ELECTRONICS
http://modul2poli.blogspot.com/
25
EE 202 : DIGITAL ELECTRONICS
http://modul2poli.blogspot.com/