Sequential circuits, latches and flip-flops — Unit 4 Notes (Digital Logic Design)

BCS303 · Unit 4

Sequential circuits, latches and flip-flops notes — Unit 4

Free unit-wise study notes on sequential circuits, latches and flip-flops for Digital Logic Design, Semester 3 of B.Tech — Computer Science & Engineering — key concepts, examples, important questions and a revision checklist for semester exams.

The introduction of Memory. Covers the distinction between Latches and Flip-Flops, Clocking, and the detailed analysis of SR, D, JK, and T Flip-Flops including their Characteristic and Excitation tables.

Notebook — 14 pages

Page 1

Wink Notes

B.Tech CSE — 3rd Semester

Digital Logic Design

Unit - 4

1. Introduction to Sequential Circuits

Unlike combinational circuits, the output of a Sequential Circuit depends not only on the present inputs but also on the past history of inputs.

1.1 The Role of Memory and Feedback

Sequential circuits require memory elements. This is achieved by taking the output of a combinational circuit and feeding it back into the input. This feedback loop allows the circuit to "remember" a state.

1.2 Synchronous vs Asynchronous

  • Synchronous: The state of the memory elements is updated only at discrete instants of time, controlled by a master signal called a Clock. Highly predictable and standard in all modern processors.
  • Asynchronous: The state changes immediately when inputs change. No clock is used. Faster, but extremely difficult to design due to timing issues and race conditions.

Next — The Clock Signal

1 of 14

Page 2

Wink Notes

B.Tech CSE — 3rd Semester

Digital Logic Design

Unit - 4

2. The Clock Signal

A Clock is a periodic square wave signal that alternates continuously between 0 (LOW) and 1 (HIGH). It acts as the heartbeat of a synchronous digital system.

2.1 Clock Edges and Levels

A clock pulse has defined regions:

  • Positive Level: The duration when the clock is HIGH.
  • Negative Level: The duration when the clock is LOW.
  • Positive Edge (Rising Edge): The exact, instantaneous moment the clock transitions from LOW to HIGH.
  • Negative Edge (Falling Edge): The instantaneous moment the clock transitions from HIGH to LOW.

The fundamental difference between Latches and Flip-Flops is how they respond to these clock regions.

Next — Latches vs Flip-Flops

2 of 14

Page 3

Wink Notes

B.Tech CSE — 3rd Semester

Digital Logic Design

Unit - 4

3. Latches vs Flip-Flops

Both are basic memory elements capable of storing 1 bit of data. The difference lies in their triggering mechanisms.

3.1 Latches (Level-Triggered)

A Latch is transparent while the enable (or clock) signal is at an active level (e.g., HIGH). During this entire time, any change in the inputs will immediately flow through and change the output. It only "latches" and locks the data when the signal goes LOW.

3.2 Flip-Flops (Edge-Triggered)

A Flip-Flop only reads its inputs and updates its output at the exact instant of a clock edge (either rising or falling). During the rest of the clock cycle, inputs can change wildly but the output will remain strictly locked. This prevents glitches from cascading through a system.

Next — The SR Latch

3 of 14

Page 4

Wink Notes

B.Tech CSE — 3rd Semester

Digital Logic Design

Unit - 4

4. The SR (Set-Reset) Latch

The most basic memory element, built using cross-coupled NOR gates (or NAND gates).

4.1 NOR-based SR Latch Operation

Inputs: Set (SS) and Reset (RR). Outputs: QQ and QQ' (which must always be opposites).

  • S=0,R=0S=0, R=0: Memory State. The output QQ remains whatever it was previously.
  • S=1,R=0S=1, R=0: Set State. QQ is forced to 1.
  • S=0,R=1S=0, R=1: Reset State. QQ is forced to 0.
  • S=1,R=1S=1, R=1: Invalid / Forbidden. This forces both QQ and QQ' to 0, breaking the rule that they must be complements. If inputs return to 00 simultaneously, the final state is unpredictable (Race condition).

Next — The SR Flip-Flop

4 of 14

Page 5

Wink Notes

B.Tech CSE — 3rd Semester

Digital Logic Design

Unit - 4

5. The SR Flip-Flop

By adding edge-triggering circuitry to an SR Latch, we get an SR Flip-Flop.

5.1 Characteristic Table

Defines the next state (Qn+1Q_{n+1}) based on present state (QnQ_n) and inputs.

  • S=0, R=0 \to Qn+1=QnQ_{n+1} = Q_n (No Change)
  • S=0, R=1 \to Qn+1=0Q_{n+1} = 0 (Reset)
  • S=1, R=0 \to Qn+1=1Q_{n+1} = 1 (Set)
  • S=1, R=1 \to Invalid

5.2 Characteristic Equation

Derived from a K-Map of the characteristic table:
Qn+1=S+RQnQ_{n+1} = S + R'Q_n
*(Constraint:
SR=0SR = 0 must be maintained to avoid the invalid state).*

Next — The D (Data/Delay) Flip-Flop

5 of 14

Page 6

Wink Notes

B.Tech CSE — 3rd Semester

Digital Logic Design

Unit - 4

6. The D (Data/Delay) Flip-Flop

Designed to eliminate the invalid S=1,R=1S=1, R=1 state. We simply tie the SS input to the RR input through an inverter. So S=DS=D and R=DR=D'.

6.1 Operation

Whatever data is on the DD input is transferred to the QQ output exactly at the clock edge.

  • If D=0D=0 at clock edge \to Qn+1=0Q_{n+1} = 0
  • If D=1D=1 at clock edge \to Qn+1=1Q_{n+1} = 1

Characteristic Equation: Qn+1=DQ_{n+1} = D.

The D Flip-Flop is the fundamental building block of CPU registers and RAM. It simply delays the input by one clock cycle.

Next — The JK Flip-Flop

6 of 14

Page 7

Wink Notes

B.Tech CSE — 3rd Semester

Digital Logic Design

Unit - 4

7. The JK Flip-Flop

The JK Flip-Flop improves on the SR Flip-Flop. It behaves identically for JJ (Set) and KK (Reset), but it solves the invalid 1,11,1 state by defining a useful operation for it.

7.1 Characteristic Table

  • J=0, K=0 \to Qn+1=QnQ_{n+1} = Q_n (No Change)
  • J=0, K=1 \to Qn+1=0Q_{n+1} = 0 (Reset)
  • J=1, K=0 \to Qn+1=1Q_{n+1} = 1 (Set)
  • J=1, K=1 \to Qn+1=QnQ_{n+1} = Q_n' (Toggle. The output flips to its opposite state).

Characteristic Equation: Qn+1=JQn+KQnQ_{n+1} = JQ_n' + K'Q_n.

The JK Flip-Flop is considered the most versatile of all flip-flops.

Next — Race Around Condition

7 of 14

Page 8

Wink Notes

B.Tech CSE — 3rd Semester

Digital Logic Design

Unit - 4

8. The Race Around Condition

A severe problem occurs in JK Latches (or level-triggered JK flip-flops) when J=1J=1 and K=1K=1.

8.1 The Phenomenon

If J=1J=1 and K=1K=1, the output is supposed to toggle. However, if the clock pulse remains HIGH for longer than the propagation delay of the gates, the output will toggle, feed back into the input, toggle again, and continue oscillating (racing) between 0 and 1 until the clock goes LOW. The final state becomes completely unpredictable.

8.2 Solutions

  • Ensure the clock pulse duration is shorter than the gate propagation delay (impractical to manufacture reliably).
  • Use edge-triggering instead of level-triggering.
  • Use the Master-Slave configuration.

Next — Master-Slave JK Flip-Flop

8 of 14

Page 9

Wink Notes

B.Tech CSE — 3rd Semester

Digital Logic Design

Unit - 4

9. Master-Slave JK Flip-Flop

A hardware solution to the Race Around Condition. It consists of two cascaded JK Latches: a "Master" and a "Slave".

9.1 Operation

The clock signal to the Slave is inverted.
- When the Clock is HIGH: The Master is active and reads the J/K inputs. The Slave is inactive, so the final output
QQ does not change.
- When the Clock goes LOW: The Master becomes inactive, locking its data. The Slave becomes active and copies the Master's data to the final output
QQ.

Because the output only changes when the Master is locked out from reading new inputs, feedback oscillation is impossible. This effectively creates a negative-edge-triggered flip-flop.

Next — The T (Toggle) Flip-Flop

9 of 14

Page 10

Wink Notes

B.Tech CSE — 3rd Semester

Digital Logic Design

Unit - 4

10. The T (Toggle) Flip-Flop

A specialized flip-flop derived from the JK Flip-Flop by tying the J and K inputs together (J=K=TJ = K = T).

10.1 Characteristic Table

  • If T=0T = 0, Qn+1=QnQ_{n+1} = Q_n (Memory / Hold state).
  • If T=1T = 1, Qn+1=QnQ_{n+1} = Q_n' (Toggle state).

Characteristic Equation: Qn+1=TQnQ_{n+1} = T \oplus Q_n.

The T Flip-Flop is almost exclusively used in designing binary counters and frequency dividers. If T is held at 1, the output toggles on every clock edge, effectively dividing the clock frequency by 2.

Next — Excitation Tables

10 of 14

Page 11

Wink Notes

B.Tech CSE — 3rd Semester

Digital Logic Design

Unit - 4

11. Excitation Tables

A Characteristic table tells you the Next State if you know the inputs.
An
Excitation Table works backwards: It tells you what Inputs you need to apply to achieve a desired state transition from QnQ_n to Qn+1Q_{n+1}.
Excitation tables are absolutely critical for designing counters.

11.1 SR Excitation Table

000 \to 0: S=0, R=X (Don't care)
010 \to 1: S=1, R=0
101 \to 0: S=0, R=1
111 \to 1: S=X, R=0

11.2 JK Excitation Table

000 \to 0: J=0, K=X
010 \to 1: J=1, K=X
101 \to 0: J=X, K=1
111 \to 1: J=X, K=0

(Notice the abundance of Don't Cares in the JK table. This is why JK flip-flops result in simpler logic gate designs for counters).

Next — Flip-Flop Conversions

11 of 14

Page 12

Wink Notes

B.Tech CSE — 3rd Semester

Digital Logic Design

Unit - 4

12. Flip-Flop Conversions

A common exam problem: Given one type of flip-flop, design the external combinational logic required to make it behave like a different type of flip-flop.

12.1 General Conversion Procedure

Example: Convert an SR Flip-Flop into a D Flip-Flop.

  • 1. Write the truth table for the target (D) flip-flop: Columns for DD, QnQ_n, and desired Qn+1Q_{n+1}.
  • 2. Append columns for the inputs of the available (SR) flip-flop.
  • 3. Use the Excitation Table of the available (SR) flip-flop to fill in the SR columns based on the transition from QnQ_n to Qn+1Q_{n+1}.
  • 4. Draw K-Maps to find Boolean equations for SS and RR in terms of DD and QnQ_n.
  • 5. Result: S=DS = D, R=DR = D'. Draw the circuit.

Next — Asynchronous Inputs (Preset and Clear)

12 of 14

Page 13

Wink Notes

B.Tech CSE — 3rd Semester

Digital Logic Design

Unit - 4

13. Asynchronous Inputs (Preset & Clear)

Standard flip-flop inputs (S, R, J, K, D, T) are Synchronous. Their effect is delayed until the next clock edge.

However, practical flip-flop ICs include two Asynchronous override pins: `Preset` (PR) and `Clear` (CLR).

  • Preset (PR): When activated, it immediately forces the output QQ to 1, completely ignoring the clock and the synchronous inputs.
  • Clear (CLR): When activated, it immediately forces the output QQ to 0, ignoring the clock.

These are usually active-low pins (they activate when fed a 0). They are crucial for initializing a digital system (like a CPU reset button) to a known starting state before the clock starts ticking.

Next — Summary & Review Checklist

13 of 14

Page 14

Wink Notes

B.Tech CSE — 3rd Semester

Digital Logic Design

Unit - 4

14. Summary & Review Checklist

Unit 4 introduces time and memory into digital logic.

14.1 University Exam Checklist

  • What is the difference between a Latch and a Flip-Flop? (Level vs Edge triggering).
  • Draw the logic diagram of an SR Latch using NAND gates and explain its truth table.
  • Explain the Race Around Condition in a JK flip-flop. How does the Master-Slave configuration resolve it?
  • Derive the Characteristic Equation for the JK and T flip-flops.
  • Write the Excitation Tables for SR, JK, D, and T flip-flops from memory.
  • Convert a JK Flip-Flop into a T Flip-Flop using the systematic conversion procedure.

14.2 Hardware/VLSI Interview Focus

  • Setup and Hold Times: The input to a flip-flop must be stable slightly before the clock edge (Setup time) and remain stable slightly after (Hold time). Violating this causes Metastability.
  • Why are D Flip-Flops the industry standard for CPU registers rather than JK flip-flops?

14 of 14

Continue in this subject