Analog and Digital Electronics Unit - 3: 1. Latch What It Is Level-Triggered
Analog and Digital Electronics Unit - 3: 1. Latch What It Is Level-Triggered
UNIT – 3
1. Latch
• What it is: A latch is a basic memory device that stores one bit of data. It is level-triggered,
meaning it responds to input as long as a control signal (like Enable) is at a certain level (high
or low).
• How it works: The output can change whenever the control signal (Enable) is active.
• Types:
Explanation:
o D Latch: Has one input, Data (D). The output follows the input (D) when the enable
signal (EN) is active.
Explanation:
• Enable (EN): Controls whether the latch responds to the data input.
• Data (D): The input data that sets the output when EN is active.
• Output (Q): Follows the input (D) only when EN = 1.
2. Flip-Flop
• What it is: A flip-flop is similar to a latch but it is edge-triggered, meaning it only responds to
changes at the edge of a clock signal (either rising or falling edge).
• How it works: The output only changes at the specific moment when the clock signal
transitions from 0 to 1 (rising edge) or from 1 to 0 (falling edge).
• Types:
o SR Flip-Flop: Similar to the SR latch, but it only responds on the clock edge.
▪ Set (S) = 1 and Reset (R) = 0 sets the output to 1 on the clock edge.
▪ Set (S) = 0 and Reset (R) = 1 resets the output to 0 on the clock edge.
o D Flip-Flop: Like the D latch but only stores data at the clock edge.
o
▪ If D = 1 at the clock edge, the output becomes 1.
o
o T Flip-Flop: Toggles (switches) its state on every clock edge when T = 1.
o
Key Difference (Simplified):
• Latch: Changes when the control signal (Enable) is on. It keeps changing as long as the signal
stays on.
• Flip-Flop: Changes only at the moment the clock signal switches (like a button press). It doesn't
change again until the next clock switch.
1. S-R Flip-Flop :
S-R flip-flop is similar to S-R latch expect clock signal and two AND gates. The circuit responds to
the positive edge of clock pulse to the inputs S and R.
2. D Flip-Flop :
D Flip-Flop is a modified SR flip-flop which has an additional inverter. It prevents the inputs from
becoming the same value.
Conversion of S-R Flip-Flop into D Flip-Flop :
• Step-1:
We construct the characteristic table of D flip-flop and excitation table of S-R flip-flop.
• Step-2:
Using the K-map we find the boolean expression of S and R in terms of D.
S=D
R = D'
• Step-3:
We construct the circuit diagram of the conversion of S-R flip-flop into D flip-flop.
1. S-R Flip-Flop :
S-R flip-flop is similar to S-R latch expect clock signal and two AND gates. The circuit responds to
the positive edge of clock pulse to the inputs S and R.
2. D Flip-Flop :
D Flip-Flop is a modified SR flip-flop which has an additional inverter. It prevents the inputs from
becoming the same value.
• Step-1:
We construct the characteristic table of D flip-flop and excitation table of S-R flip-flop.
• Step-2:
Using the K-map we find the boolean expression of S and R in terms of D.
S=D
R = D'
• Step-3:
We construct the circuit diagram of the conversion of S-R flip-flop into D flip-flop.
1. J-K Flip-Flop: JK flip-flop shares the initials of Jack Kilby, who won a Nobel prize for his
fabrication of the world’s first integrated circuit, some people speculate that this type of flip flop
was named after him because a flip-flop was the first device that Kilby build when he was
developing integrated circuits. J-K flip-flop is the gated version of SR flip-flop with an addition of
extra input i.e. clock input. It prevents invalid output conditions when both the inputs are at the
same value.
2. T Flip-Flop: T flip-flop means Toggle flip-flop. It changes the output on each clock edge and
gives an output that is half the frequency of the signal to the input.
• Step-1: Construct the characteristic table of T flip-flop and excitation table of the J-K flip-flop.
• Step-2: Using the K map, find the boolean expression for J and K in terms of T.
J=T
K=T
• Step-3: Construct the circuit diagram for the conversion of the J-K flip-flop into a T flip-flop.
JK Flip-Flip is basically a gated SR flip-flop which has an additional input that is clock input. It
prevents the invalid output that may be obtained when both the inputs are 1. Whereas D Flip-
Flop is a modified SR flip-flop which has an additional inverter. It prevents the inputs from
becoming the same value.
What is Flip-Flop?
A flip-flop is a basic component of digital electronics. This kind of circuit has two stable states and
is frequently used in storing one bit of information. Various flip-flops such as SR (Set-Reset), D
(Data or Delay), JK and T belong to this category. Each category has distinct features and
functions within digital circuits. Simply put, a flip-flop can preserve some binary value (0 or 1)
changing its output according to input signals received. Hence, it resembles computer memory
cell that retains certain data until it gets altered by new ones.
Step-1: We construct the characteristic table of D flip-flop and excitation table of JK flip-flop.
Step-2: Using the K-map we find the boolean expression of J and K in terms of D.
J=D
K = D'
Step-3: We construct the circuit diagram of the conversion of JK flip-flop into D flip-flop.
JK Flip-Flop D Flip-Flop
The JK flip flop has two inputs, J (set) and K Also called DFF, data or delay flip flop,
(reset), which determine what it does. has only one data input (D) and a clock
input.
It has two inputs, J and K, as well as a clock At the rising or falling edge of the clock
input. signal the output of a DFF switches to
the value of D input.
Based on the inputs J and K, JK flip flop can Because it acts according to clock
toggle its output between stable states (0 and signal during storage and transfer, it is
1). suitable for synchronization and
storage purposes.
Because of its ability to function as either DFF truth table is simpler than JKFF
toggle FFs or SR_FFs or data FFs depending on because it merely duplicates its input to
input state, it has a more complicated truth output.
table than any other type of flip flop.
Advantages of Flip Flop
Memory storage : Flip-flops can retain binary information (0 or 1) until something new is sent to
them. This function of keeping data is essential for sequential logic circuits like registers and
memories.
Synchronization : Data input and output timing can be controlled by using clock signals in flip-
flops. This synchronization guarantees that there will be no errors with processing data during
specific periods which is one of most important things for digital systems.
Controlled output : The output of a flip-flop can only change when it has been triggered by either
a clock signal or particular input conditions. With such behavior, it helps with making sure digital
circuits are stable and reliable.
versatility : Various types of flip-flops including D, JK, SR and T type flip-flops provide different
functionalities for different types of circuits requirements. Thus, this flexibility enables designers
implement a wide range of logical operations within short periods.
Sequential logic : In sequential logic circuits, where output depends not only on current input but
also previous state(s), flip-flop is an important element allowing us to perform complex
operations and algorithms in digital systems.
Disadvantages of Flip Flop
Complexity : As an example, the JK flip-flops have complex truth tables and multiple input
configurations making the design of their circuits more intricate and necessitating additional
logic for effective operation control.
Propagation Delay : Flip-flops introduce some delays in the circuit because it takes time for the
output to respond after changes in inputs. Such delays may affect speed and performance of a
digital system as a whole.
Power Consumption : Even when they are not changing state, flip-flops use power perpetually. In
large digital systems with many of them, their constant power drain leads to higher energy
consumption levels and heat generation rates.
Size and Cost : The implementation of more flip-flops within any given circuit leads to increased
size as well as manufacturing costs associated with that system which can be problematic
especially where there are space constraints or budget limitations as is often seen in most
applications.
We can feed and extract data to and from a shift register in two ways:
1. Serially: Data enters the cascade of flip-flops in a stream. Each bit passes through the
cascade in a line. We get the data output at the last flip-flop. The output is in the same order
as the input.
2. Parallel: Each flip-flop can have its own input. This particular setting of giving input is known
as parallel input. Similarly, each flip-flop can have its own output too. This is parallel output.
Since a shift register comprises of flip-flops, we can use them for the following general purposes
1. To shift data – Shift registers can shift data either to the right, to the left or in both directions.
In this post, we will look at shift registers where the data moves in the right direction.
2. To store data – The flip-flops shift data on the application of a clock pulse. In the absence of a
clock pulse, the shift register holds that data.
3. To produce a delay – The data can stay inside the shift register or pass through it. Either way,
the processes consume some clock cycles. So we can use them to introduce some delay if we
need it.
4. To convert between serial-parallel – Since we have both serial and parallel types of inputs
and outputs, we can use shift registers to convert serial data to parallel or vice versa.
The shift register, which allows serial input (one bit after the other through a single data line)
and produces a serial output is known as a Serial-In Serial-Out shift register. Since there is
only one output, the data leaves the shift register one bit at a time in a serial pattern, thus
the name Serial-In Serial-Out Shift Register. The logic circuit given below shows a serial-in
serial-out shift register. The circuit consists of four D flip-flops which are connected in a serial
manner. All these flip-flops are synchronous with each other since the same clock signal is
applied to each flip-flop.
The above circuit is an example of a shift right register, taking the serial data input from the
left side of the flip flop. The main use of a SISO is to act as a delay element.
The shift register, which allows serial input (one bit after the other through a single data line)
and produces a parallel output is known as the Serial-In Parallel-Out shift register. The logic
circuit given below shows a serial-in-parallel-out shift register. The circuit consists of four D
flip-flops which are connected. The clear (CLR) signal is connected in addition to the clock
signal to all 4 flip flops in order to RESET them. The output of the first flip-flop is connected to
the input of the next flip flop and so on. All these flip-flops are synchronous with each other
since the same clock signal is applied to each flip-flop.
The above circuit is an example of a shift right register, taking the serial data input from the
left side of the flip-flop and producing a parallel output. They are used in communication
lines where demultiplexing of a data line into several parallel lines is required because the
main use of the SIPO register is to convert serial data into parallel data.
The shift register, which allows parallel input (data is given separately to each flip flop and in
a simultaneous manner) and produces a serial output is known as a Parallel-In Serial-Out
shift register. The logic circuit given below shows a parallel-in-serial-out shift register. The
circuit consists of four D flip-flops which are connected. The clock input is directly connected
to all the flip-flops but the input data is connected individually to each flip-flop through a
multiplexer at the input of every flip-flop. The output of the previous flip-flop and parallel
data input are connected to the input of the MUX and the output of MUX is connected to the
next flip-flop. All these flip-flops are synchronous with each other since the same clock signal
is applied to each flip-flop.
A Parallel in Serial Out (PISO) shift register is used to convert parallel data to serial data.
• Advantages: Converts parallel data to serial, which is useful for data transmission over serial
lines.
• Disadvantages: Slower to load data into the register compared to parallel processing, and
requires a shift register to convert data to serial form.
The shift register, which allows parallel input (data is given separately to each flip flop and in
a simultaneous manner) and also produces a parallel output is known as Parallel-In parallel-
Out shift register. The logic circuit given below shows a parallel-in-parallel-out shift register.
The circuit consists of four D flip-flops which are connected. The clear (CLR) signal and clock
signals are connected to all 4 flip-flops. In this type of register, there are no interconnections
between the individual flip-flops since no serial shifting of the data is required. Data is given
as input separately for each flip flop and in the same way, output is also collected individually
from each flip flop.
A Parallel in Parallel out (PIPO) shift register is used as a temporary storage device and like
SISO Shift register it acts as a delay element.
Shift Register Counters are the shift registers in which the outputs are connected back to the
inputs in order to produce particular sequences. There are basically two types:
• Ring Counter
• Johnson Counter
Ring Counter
A ring counter is basically a shift register counter in which the output of the first flip-flop is
connected to the next flip-flop and so on and the output of the last flip-flop is again fed back
to the input of the first flip-flop, thus the name ring counter. The data pattern within the shift
register will circulate as long as clock pulses are applied. The logic circuit given below shows
a Ring Counter.
Ring Counter Truth Table
The circuit consists of four D flip-flops which are connected. Since the circuit consists of four
flip-flops the data pattern will repeat after every four clock pulses as shown in the truth
table. A Ring counter is generally used because it is self-decoding. No extra decoding circuit is
needed to determine what state the counter is in.
Johnson Counter- A Johnson counter is basically a shift register counter in which the output
of the first flip flop is connected to the next flip flop and so on and the inverted output of the
last flip flop is again fed back to the input of the first flip flop. They are also known as twisted
ring counters. The logic circuit given below shows a Johnson Counter. The circuit consists of
four D flip-flops which are connected.
An n-stage Johnson counter yields a count sequence of 2n different states, thus also known
as a mod-2n counter. Since the circuit consists of four flip-flops the data pattern will repeat
every eight clock pulses as shown in the truth table. The main advantage of the Johnson
counter is that it only needs n number of flip-flops compared to the ring counter to circulate a
given data to generate a sequence of 2n states.
Johnson Counter
There are two types of counters in digital logic circuit that are used to count the
numbers of bits and these types depends upon the clock pulse applied to the flip flops.
1. Asynchronous Counter:
These are the counters in which we do not use universal clock, main clock is only
applied to the first flip flop and then for rest of flip flops the output of previous flip
flop is taken as a clock.
ASYNCHRONOUS COUNTER
2. Synchronous Counter:
These are the counters in which we use a universal clock that is common to all flip
flops. The Circuit diagram of Synchronous Counter is given Below:
SYNCHRONOUS COUNTER
Difference Table:
The value of N can be different from power of 2. Also, the counting sequence may be
random for example some cyclic code (8421, 2423 etc). The following method is
applied for designing for mod N and any counting sequence.
N <= 2n
Here we are designing Mod-10 counter Therefore, N= 10 and number of Flip flops(n)
required is
For n =3, 10<=8, which is false.
For n= 4,10<=16, which is true.
Step 4 : Create Karnaugh map for each FF input in terms of flip-flop outputs as the
input variable –
Simplify the K map –
Explanation :
• Initially Q3 Q2 Q1 Q0 are 0 0 0 0.
• The sequence of counter can be verified from the timing diagram. At every falling
edge of the clock output Q0 toggles because T0 is connected to logic 1.
• T1 becomes 1 only when expression T1 = Q’3Q0 becomes 1 also if clock falling edge
occurs(because there is negative edge triggering) then the output state of T1 i.e Q1 will
change.
• T2 becomes 1 only when expression T2 = Q1Q0 becomes 1 also if clock falling edge
occurs then the output state Q2 will change.
• T3 becomes 1 only when expression T1 = Q3Q0 + Q2Q1Q0 resultant becomes 1 also if
clock falling edge occurs(because there is negative edge triggering) then the state of
Q3 will change.
• We get Output as Q3(MSB) Q2 Q1 Q0(LSB).
• After 10th falling edge the output state of all the FFs again becomes 0 0 0 0.