Sequential logic

Comprehensive study notes, diagrams, and exam preparation for Sequential logic.

Sequential Logic

Definition

Sequential logic is a type of digital logic in which the output depends on the present input values and the stored previous state of the circuit. It uses memory elements, such as latches and flip-flops, often controlled by a clock signal, to retain information and produce time-dependent outputs.


Main Content

1. Memory Elements

Latches and flip-flops

  • are the basic storage units of sequential logic. A latch is typically level-sensitive, while a flip-flop is usually edge-triggered and changes state only at a clock transition.
  • These elements store one bit each, and combining many of them allows the creation of larger storage structures such as registers, shift registers, and counters.

A memory element is what makes sequential logic different from combinational logic. Without memory, a circuit cannot “remember” what happened earlier. For example, in a traffic light controller, the circuit must remember the current light state before switching to the next one.

Common examples:

  • SR latch: Set-Reset storage circuit
  • D flip-flop: Data storage circuit
  • JK flip-flop: Improved version with toggle capability
  • T flip-flop: Toggle flip-flop used in counters

Basic idea of a flip-flop storing state:

      +-------------+
D --->|             |---> Q
CLK ->|  Flip-Flop  |
      |             |---> Q'
      +-------------+

Here, the output Q keeps the stored value until the next active clock edge updates it.


2. Clock and Timing Control

  • Most sequential circuits operate synchronously, meaning their state changes are controlled by a clock signal. The clock provides a timing reference so that all parts of the system change in an organized and predictable way.
  • Timing parameters such as setup time, hold time, propagation delay, and clock period are critical because the input must be stable around the clock edge for correct operation.

The clock is like a conductor in an orchestra: it ensures every part of the circuit acts at the right moment. Without proper timing, a circuit may become unstable, produce incorrect outputs, or enter unpredictable states.

Important timing terms:

Setup time

  • Input must remain stable before the clock edge.

Hold time

  • Input must remain stable after the clock edge.

Propagation delay

  • Time taken for output to change after input or clock changes.

Clock edge

  • The instant when a flip-flop samples the input.

Timing illustration:

CLK:  __/‾‾\__/‾‾\__/‾‾\__
D:    ----1------0---1-----
Q:    ____1______0---1-----

This shows that output Q changes only at clock transitions, not continuously with the input.


3. State, State Transition, and Sequential Circuits

  • A state is the stored condition of a sequential circuit at a particular time. The state determines how the circuit will respond to future inputs.

State transitions

  • describe how the circuit moves from one state to another when inputs are applied. This behavior is often represented using a state table or state diagram.

Sequential circuits can be classified into:

Synchronous sequential circuits

  • All state changes happen in coordination with a clock.

Asynchronous sequential circuits

  • State changes occur immediately when inputs change, without a global clock.

State diagrams are very useful for modeling systems such as vending machines, elevators, and digital controllers.

Example: simple 2-state system

State A --input=1--> State B
State B --input=0--> State A

A state machine can be thought of as a digital decision system with memory. For instance, a door lock may stay locked until the correct code is entered, then move to the unlocked state.

State diagram for a simple toggle system:

   +-------+   input=1   +-------+
   | State | ----------> | State |
   |   0   |             |   1   |
   +-------+ <---------- +-------+
      ^      input=1        ^
      |---------------------|

This kind of representation helps analyze the behavior of systems over time.


Working / Process

1. Input is applied to the circuit.

  • The sequential logic circuit receives external inputs along with the current stored state.

2. Clock or control signal determines state update.

  • In synchronous systems, the circuit checks inputs at the active clock edge and updates the memory element only at that moment.

3. New state is stored and output is produced.

  • The updated state is saved in the memory element, and the output is generated based on both the stored state and current inputs.

A more detailed process can be understood through a D flip-flop:

  • The D input is prepared and held stable.
  • The clock edge arrives.
  • The flip-flop samples D.
  • The sampled value is stored as the new Q.
  • Q remains unchanged until the next triggering event.

Example in a counter:

  • On each clock pulse, the counter increases by 1.
  • The present count is stored in flip-flops.
  • The next count depends on the current count and the clock.
  • This sequence continues in an ordered manner, such as 0000 → 0001 → 0010 → 0011.

Process flow:

Inputs + Stored State -> Combinational Logic -> Next State Logic -> Memory Element -> Output

This cycle repeats continuously, making the circuit behave as a time-based system.


Advantages / Applications

Memory capability

  • Sequential logic can store information, which is necessary for building registers, counters, and memory units.

Controlled behavior over time

  • It allows circuits to react in a planned sequence, making it ideal for control systems and processors.

Wide practical use

  • It is used in computers, digital clocks, traffic signal controllers, elevators, communication devices, and finite state machines.

Sequential logic is essential whenever a system must remember previous events. For example:

  • In a CPU, sequential logic helps manage instruction execution.
  • In a digital alarm clock, it tracks time and updates display values.
  • In a vending machine, it keeps track of money inserted and item selection.
  • In shift registers, it moves data bit by bit for storage or serial communication.

Without sequential logic, modern digital systems would not be able to perform tasks that require timing, order, or memory.


Summary

Sequential logic is digital logic that uses memory and timing to produce outputs based on both current inputs and past states.

  • It stores information using latches and flip-flops
  • It changes state according to clock or control signals
  • It is used in counters, registers, and control systems
  • Important terms to remember: latch, flip-flop, clock, state, next state, synchronous, asynchronous