COA Module 2
COA Module 2
Combinational circuits produce an output based on the values of current input variables
only. In sequential circuits, the present output depends on the present input as well as the
previous output (previous input variables). That is sequential circuits consist of memory
elements capable of storing binary information. The state of a sequential circuit at a time
is defined by this binary information stored.
Sequential Circuits
The output of these circuits are uncertain and they are difficult to design.
Synchronous Sequential Circuits
Circuits that use a clock pulse with their inputs is called a synchronous sequential circuit.
These circuits are slower, because they have to wait for the next clock pulse to perform
next operation.
A clock signal
The transition of a signal from LOW to HIGH or from HIGH to LOW is called an edge. A LOW
to HIGH transition is a rising edge and a HIGH to LOW transition is a falling edge.
Types of Triggering
There are two types of triggering
Edge triggering
Level triggering
Level triggering
A level-triggered circuit will become active when the clock pulse is at a certain level.
Based on which level (HIGH / LOW ) the circuit is activated level triggering is again
classified as negative level triggering circuits and positive level triggering. In negative edge
triggering the circuit become active when the clock pulse is low. Similarly in positive edge
triggering the circuit become active when the clock pulse is high.
Edge triggering
An edge-triggered circuit will become active at a positive or negative edge of the clock
signal. When a clock signal goes from low to high, it is called a rising edge (positive edge).
A positive edge-triggered circuit will take input on the rising edge of the clock signal.
Similarly, when a clock signal goes from high to low, it is called a falling edge (negative
edge). A negative edge-triggered circuit will take input on the falling edge of the clock
signal.
SR latch
A latch is a temporary storage element that has two stable states (bistable). They operate
in signal levels rather than signal transitions. An active-HIGH input SR latch is formed with
two cross-coupled NOR gates and an active-LOW input latch is formed with two
cross-coupled NAND gate.
An SR Latch with two cross-coupled NOR gate is shown in the figure. It has two input S for
SET and R for RESET and two outputs and .
SR latch using NOR gate.
Working of an SR Latch
When S=1 the output of G2 will be 0 (the output of a NOR gate is 0 when any of its input
are 1). Since this output is connected back to an input of G1, and the R input is also 0,
the output of G1 must be 1. This output 1 is coupled back to an input of G2, making its
output remain 1 even when the 1 on the S input is removed(Memory State). When the Q
output is HIGH, the latch is said to be in the SET state.
then &
0 0 NC NC Memory State
0 1 0 1 RESET
1 0 1 0 SET
1 1 – – Not Used.
1 1 NC NC Memory State
0 1 1 0 SET
INPUTS OUTPUTS
COMMENTS
1 0 0 1 RESET
0 0 – – Not Used
SR flip flop
Flip flops are synchronous bistable devices, also known as bistable multivibrators. The
term synchronous means that changes in the output occur in synchronization with control
input called a clock.
The basic form of an edge triggered flip-flop is the SR flipflop. The logic diagram of an SR
flip-flop is shown in the figure.
0 0 0 0
0 0 1 0
0 1 0 1
0 1 1 X
1 0 0 1
1 0 1 0
1 1 0 1
1 1 1 X
Characteristics table
From these two tables, we know the transition from the present state to the next state. To
find the latch input conditions that will cause the specified transition, We need a table that
lists the required inputs for a given change of state. It is called an excitation table.
We can also obtain the expression for from the characteristics table using the K Map
technique as follows.
0 0 0 X
0 1 1 0
1 0 0 1
1 1 X 0
Excitation Table
JK Flip flop
The JK Flip flop can be viewed as a modification of the SR Flip flop. The intermediate state
in a JK Flip flop is more refined and precise than that of an SR Flip flop.
Expressions for , and can be obtained from the table using the K Map technique
as follows.
The circuit also includes an inverter and is connected. It passes the inverted clock pulse to
the slave flip-flop. If the clock pulse is set to 0 for the master, then the clock pulse will
become 1 for the slave and if Clk=1 for the master flipflop, it will become 0 for the slave
flipflop. The circuit diagram of a master-slave Jk Flip flop is given below.
D Flip Flop
The D(data) flip-flop stores the value that is given on the data line. It can be thought of as
a basic memory cell.
D Flip flop Block Diagram
When both the inputs of an SR flip-flop are at the same logic level, then a no change or
invalid output condition occurs. If we avoid these conditions, there will be only two output
conditions: SET or RESET. There are many applications, where only SET and RESET
conditions of the latch are required. In these applications, we can use inputs (S and R)
which are always the complement of each other.
This can be designed by a single input (S) to the latch and the R input achieved by
inverting this S. This single input is called data input and it is labelled with D.
When the clock is set to low, the output remains as it is whether the input signal is set high
or low.
When clock is high, if D = 1 then it is equivalent to S = 1 and R = 0 hence the latch is set(1).
On the other hand, when D = 0 then it acts like S = 0, and R = 1 hence the latch is reset(0).
The characteristics table and truth table of a D flip flop is given below.
0 0 0
0 1 1 0 X Qt
1 0 0 1 0 0
1 1 1 1 1 1
Characteristics table Truth table
The equation for and the excitation table derived from the characteristic table is
given below :
0 0 0
0 1 1
1 0 0
1 1 1 D Flipflop K-Map
T Flip Flop
A T flip-flop is a modified form of the JK flip flop. It is called a toggle flip flop because of
its toggling operation. T flip-flop is constructed by connecting the J and K inputs, creating
a single input called T as shown in the following figure.
0 0 0
0 1 1 0 X
1 0 1 1 0
1 1 0 1 1
The equation for can be derived from the excitation table using K-map as following.
0 0 0
0 1 1
1 0 1
1 1 0
Shift Registers
Registers
A register is a collection of flip-flops, each of which can store one bit of information. An n-
bit register is a group of n flip-flops that can store binary information of n bits. Register
memory is the smallest and most powerful type of memory in a computer. It stores
frequently used data, instructions, and memory addresses for use by the CPU.
in most digital systems, a master clock generator provides a continuous train of clock
pulses. The clock pulse is applied to all of the flip-flops and registers in the system.
Shift Registers
The information stored in registers can be transferred using shift registers. The registers
that shift the bits to the left are referred to as a shift left registers and the registers that
shift the bits to the right are referred to as shift right registers.
The shift register uses D flip flops. It is because the D flipflop can operate moving data
from the input to the output while a clock pulse is applied.
In shift registers, data can be entered and extracted sequentially or parallelly. Based on
this, Shift registers are classified as follows:
1. SISO – Serial In Serial Out
2. SIPO – Serial In Parallel Out
3. PISO – Parallel In Serial Out
4. PIPO – Parallel In Parallel Out
SISO (Serial In Serial Out) Shift Registers
The SISO is on the simplest of all the shift registers. The block diagram of a 4-bit shift
right SISO shift register is shown below. Each flipflop has one input(D),i one output and (Q)i
and a clock pulse input.
Initially 0 0 0 0
↓ 1 0 0 0
↓ 1 1 0 0
↓ 1 1 1 0
↓ 1 1 1 1
This operation can be also represented using a timing diagram as follows.
Shift Right Registers Timing Diagram
The data shifts from one stage to the next for each negative edge triggering of the clock
signal. We can access the outputs of all D flip-flops at the same time. So we get parallel
outputs from the shift register at the same time.
In SISO shift registers, the input and output operation is performed serially. The data is
loaded into the input of the left-most flip-flop bit by bit. The data bit is shifted from one
flip-flop to the next for each clock pulse. The data loaded will be received bit by bit for
each clock pulse on the output side of the rightmost flipflop.
An n-bit SIPO shift register requires n clock pulses to shift n bit data. That is, the above 4-
bit shift register only requires 4 clock pulses to shift the data given in the input.
PIPO (Parallel In Parallel Out) Shift Registers
In a PIPO shift register, the input data is loaded parallel into each flip-flop and the output is
received from each flip-flop parallelly.
Introduction to Counters
A counter is a sequential circuit that stores the number of times a particular event has
occurred in form of a clock pulse. Counters can be designed by connecting individual flip-
flops together.
Counters are used in digital electronics for the purpose of counting. When the clock pulses
are applied to a counter, it progresses from one state to the next, and the final output of
the counter’s flip-flop indicates the pulse count.
Counter Types
Basically, two types of counters are there.
1. Asynchronous Counters – Counters in which are flip flops are not clocked at the same
time.
2. Synchronous Counters – Counters in which all flip flops are clocked simultaneously.
The difference between synchronous counters and asynchronous counters are described
in the following table.
SYNCHRONOUS COUNTERS ASYNCHRONOUS COUNTERS
All flip flops are triggered with same clock Different flip flops are triggered with different clock,
simultaneously. not simultaneously.
Faster than asynchronous counter in operation. Slower than synchronous counters n operation.
Designing is complex due to increasing number of Designing as well as implementation is easy.
states.
Based on the type of counting, the following types of counters are also there:
1. Up Counter – Counts in increasing order.
2. Down Counter – Counts in decreasing order.
3. Up/ Down Counter – Count in both directions, increasing as well as decreasing.
Modulus of a Counter
The modulus of a counter indicates the maximum count a counter can reach or the total
number of states a counter has. The modulus of an n-bit counter is 2n. The maximum
decimal the counter can reach is given by 2n – 1.
That is the number of bits = n, modules = 2n, maximum count = 2n – 1.
For example, the modulus of a 3 bit counter is 23 = 8. The maximum count will be 7.
In the case of a Mod-16 counter,
2n=16. So n = 4, which means that it is a 4 bit counter, having 16 states, and the maximum
count it can reach is, 2n – 1 = 15.
Asynchronous Counters
Counters in which the flip-flops are supplied with different clock signals. The first flip-flop
is clocked by the external clock pulse and then each successive flip-flop is clocked by the
output of the preceding flip-flop.
2-bit Asynchronous Up Counter
The logic diagram of a 2-bit asynchronous up counter using JK flip-flop is shown in the
figure.
The J and K inputs of 2 flip flops are connected to logic 1. An external clock is applied to
flip-flop A and its output QA is applied to flip-flop B as the clock input. At the negative-
going edge of each clock pulse, flip-flop A changes its state. Flipflop B changes state only
when triggered by a negative-going transition of the QA output of flipflop A. The truth
table and timing diagram are given below.
CLOCK DECIMAL EQUIVALENT
Initially 0 0 0
🡫 0 1 1
🡫 1 0 2
🡫 1 1 3
2-bit Asynchronous Up Counter Timing Diagram
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. The truth table and timing diagram are given
below.
CLOCK DECIMAL EQUIVALENT
Initially 0 0 0 0
🡫 0 0 1 1
🡫 0 1 0 2
🡫 0 1 1 3
🡫 1 0 0 4
🡫 1 0 1 5
🡫 1 1 0 6
🡫 1 1 1 7
Here, we have 4 flip flops, and the number of states is 16, from 0000 – 1111 (0 to 15). The
truth table and timing diagram are given below.
CLOCK DECIMAL EQUIVALENT
Initially 0 0 0 0 0
🡫 0 0 0 1 1
🡫 0 0 1 0 2
🡫 0 0 1 1 3
🡫 0 1 0 0 4
🡫 0 1 0 1 5
🡫 0 1 1 0 6
🡫 0 1 1 1 7
🡫 1 0 0 0 8
🡫 1 0 0 1 9
CLOCK DECIMAL EQUIVALENT
🡫 1 0 1 0 10
🡫 1 0 1 1 11
🡫 1 1 0 0 12
🡫 1 1 0 1 13
🡫 1 1 1 0 14
🡫 1 1 1 1 15
The combination of inputs to the combinational circuit that we have to design and the
corresponding output it should produce is given below. The equation for Y can be found
out using K-Map.
0 0 0 0
0 0 1 0
0 1 0 1
0 1 1 1
1 0 0 0
1 0 1 1
1 1 0 0
1 1 1 1
AND gates 1, 3 and 5 has one input connected with input and the other input from Q
output of flip flop preceding it. Similarly, gates 2, 4 and 6 have input from M and .
When M = 0, gates 1, 3 and 5 gives Q as output and gates 2, 4 and 6 gives 0.
When these outputs are given to OR gate, it produces Q as output, which is connected
to the clock input of next flip flop.
Hence, we have up counting.
When M = 1, gates 1, 3 and 5 gives 0 as output and gates 2, 4 and 6 gives Q as output.
When these outputs are given to OR gate, it produces Q as output, which is connected
to the clock input of next flip flop.
Hence, we have down counting.
Synchronous Counters
The clock inputs of all the individual flip-flops are clocked together at the same time by
the same clock signal, giving rise to the name “synchronous counter.” Because all of the
flip-flops are clocked together simultaneously (in parallel) at the same time, changes in
output occur in “synchronisation” with the clock signal.
As a result, all of the individual output bits change state at the same time, in response to
the common clock signal, with no ripple effect and thus no propagation delay, as in
asynchronous counters.
How to design a synchronous counter
The designing of synchronous counters follows the steps given below :
Decide the number of flip flops required.
2. Decide the type of flip flop and draw excitation table of flip flop.
3. Draw the state diagram and circuit excitation table.
4. Obtain simplified equations for inputs using K-Map.
5. Draw the logic diagram based on the equations obtained.
Designing a 2-bit Synchronous up Counter
1
.
Step 1
Number of flipflops = 2, since it is a 2-bit counter.
Step 2
The flipflop we are going to use is JK flip flop. Excitation table of JK flip flop is:
0 0 0 X
0 1 1 X
1 0 X 1
1 1 X 0
Step 3
Since it is a 2-bit counter, it has 22 = 4 states. It can count from 0 to 3. Hence, the state
diagram can be drawn as shown below :
Using the excitation table of the flip-flop, we have to enter the flip-flop inputs, that are
capable of producing the next state of the counter from the present state in a table. For
this we create Circuit Excitation Table.
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
Step 4
Step 5
Based on the equations we found, we have to design the counter. The diagram hence
constructed is shown below. (Note that the clock input is given to all flip flops and here,
MSB is at Q1 and LSB is at Q2.)
0 0 0
0 1 1
1 0 1
1 1 0
Step 3
Since it is a 3-bit counter, it has 23 = 8 states. It can count from 0 to 7. Hence, the state
diagram can be drawn as shown below :
Using the excitation table of the flip-flop, we have to enter the flip-flop inputs, that are
capable of producing the next state of the counter from the present state in a table. For
this, we create Circuit Excitation Table.
0 0 0 0 0 1 0 0 1
0 0 1 0 1 0 0 1 1
0 1 0 0 1 1 0 0 1
0 1 1 1 0 0 1 1 1
1 0 0 1 0 1 0 0 1
1 0 1 1 1 0 0 1 1
1 1 0 1 1 1 0 0 1
1 1 1 0 0 0 1 1 1
Step 4
Step 5
Based on the equations we found, we have to design the counter. The diagram hence
constructed is shown below. Here MSB is at QC and LSB is at QA.
The count starts from 0000 (zero) to 1001 (9) and then on encountering 1010 (10) it resets
to 0000.
Decade Counter Circuit Diagram
The diagram given below shows an asynchronous decade counter constructed using JK
flip flops.
The overriding input(ORI) is connected to the PRE input of the first flip flop and the CLR
input of all other flip flops. They are active low, and hence, when ORI is low(0), the first flip
flop is SET(when PRE=0, Q 0 =0) and all other flip flops are RESET (when CLR=0,
output=0).
Initially, the ORI is low, therefore the state of counter is 1000.
After this, ORI is made high and hence the flip flops give outputs based on D input on
encountering the negative edge of incoming Clock pulses(Clk).
Ring counters have only one bit high at any instant of time.
The states of counter affected by each clock pulse are given below. The bit patterns
repeat after every 4 clock cycles.
ORI CLOCK
🡫 1 0 0 0
1 🡫 0 1 0 0
1 🡫 0 0 1 0
1 🡫 0 0 0 1
1 🡫 1 0 0 0
Johnson’s Counter
Also known as Inverse Feedback Counter or Twisted Ring Counter. Here, a D-flip flop is
used to construct a Johnson Counter. All flip-flops are arranged such that the output of
the preceding flip-flop is fed as an input to the immediate next flip-flop. It is to be noted
that the complement output of the last flip-flop is back-fed to the first flip-flop.
Johnson’s Counter is of Synchronous type and, Number of states = 2 x Number of flip
flops. Therefore, a 4-bit Johnson’s Counter can count 8 states.
Here, the CLR signal is connected to the CLEAR input of all flip flops. Initially, CLR is
low(0) and hence the counter state is 0000.
After this, the CLR is maintained at high which will make the flip flops to produce
outputs on the negative edge of incoming clock pulses based on D inputs.
The states of counter affected by each clock pulse are given below. The bit patterns
repeat after every 8 clock cycles.
CLR CLOCK
0 X 0 0 0 0
1 🡫 1 0 0 0
1 🡫 1 1 0 0
1 🡫 1 1 1 0
1 🡫 1 1 1 1
1 🡫 0 1 1 1
1 🡫 0 0 1 1
CLR CLOCK
1 🡫 0 0 0 1
1 🡫 0 0 0 0
HAPPY
LEARNING