## Introduction

• Sequential circuits are digital circuits that have a state or memory, which allows to store information and perform operations based on that stored information.

## Terminology

##### Clock-Pulse/Clock Signal
• A clock pulse is a periodic digital signal that is used to synchronize the timing of operations of digital circuits, particularly in sequential circuits.
• The clock signal is a square wave signal that alternates between two voltage levels (usually 0/low voltage and a positive/high voltage) at a regular and consistent/fixed frequency.
• In sequential circuits, the clock pulse is used to control the timing of state changes and data transfers.
• The clock pulse is used to trigger the flip-flops or other memory elements in the circuit to update their state at a specific time. This ensures that all the state transitions in the circuit happen simultaneously and in a predictable way. Thus, when a clock pulse occurs, the circuit updates its internal state or performs an operation based on the inputs that it has received up to that point.
• The duration of each clock pulse is known as the clock period, and it determines the maximum speed at which the circuit can operate.
• A clock pulse can have two states – 0 or 1 i.e., disabled or active state.
• The storage elements or flip-flop can change their current state only when a clock pulse occurs.
• The use of a clock pulse ensures that all parts of the circuit operate at the same rate and in a coordinated manner. This is particularly important in complex digital systems, where multiple circuits may be interconnected and operating in parallel. Without a clock signal, there would be no way to ensure that each part of the circuit operates at the correct time, which could lead to errors or unpredictable behavior.
• The clock pulse is a critical component of many digital circuits, particularly sequential circuits. Its regular and consistent timing ensures that the circuit operates correctly and reliably.
• The frequency of the clock pulse is typically determined by the system’s timing requirements, and it is designed to be high enough to provide adequate speed for the system’s operation while avoiding excessive power consumption or signal distortion.
• In addition to synchronous sequential circuits, clock pulses are also used in other digital systems such as microprocessors, communication systems, and memory devices. The clock pulse is often generated by a crystal oscillator or a phase-locked loop (PLL) circuit to ensure accurate and stable timing.
##### State Table
• A state table is a tool used in the design and analysis of sequential circuits, particularly finite state machines (FSMs).
• It provides a way to represent the behavior of a sequential circuit in terms of its input, output, and internal states.
• The state table can be used to analyze the behavior of the circuit, determine the sequence of states that the circuit will follow for a given set of inputs, and identify any potential issues such as timing or stability problems.
• A state table includes the functional relationships between the inputs, output and flip-flop states (present and next) of a sequential circuit.
• It is a chart/table that lists all the possible states of the FSM, along with the input conditions and the resulting next state and output.
• State tables are useful for analyzing the behavior of the circuit and ensuring that it operates correctly for all possible inputs and states.
• The state table is usually created based on a state diagram, which shows the states of the FSM and the transitions between them.
• By systematically filling in the state table based on the desired behavior of the circuit, designers can determine the necessary logic functions and components needed to implement the circuit.
• The state table typically consists of the following columns:
1. State (Present/Current): This column lists all the possible states of the FSM. Each state is given a unique name or label.
2. Inputs: This column lists all the possible input conditions that the FSM can receive. For example, if the FSM has a single-bit input, the input column will have two rows: one for input=0 and one for input=1.
3. Next State: This column lists the next state of the FSM based on the current state and input. For example, if the FSM is currently in state A and receives input=1, the next state may be B.
4. Outputs: This column lists the output of the FSM based on the current state and input. For example, if the FSM is in state B and receives input=0, the output may be 1.
• Each row of the state table represents a unique combination of present state and input. The output column specifies the output that the circuit will produce in response to that input and present state combination, while the next state column specifies the state that the circuit will transition to base on that input and present state combination.
• Once the state table is complete, it can be used to analyze the behavior of the FSM and ensure that it operates correctly for all possible inputs and states.
• State table can also be used to generate the logic equations and circuitry needed to implement the FSM in hardware.
##### State Diagram
• A state diagram is a graphical representation of the behavior of a sequential circuit. It depicts the different states that the circuit can be in and the transitions between those states in response to input signals.
• The state diagram is used to identify the input conditions and next state for each transition, which are then entered into the state table.
• A state diagram pictorially describes the state transition.
• State diagrams can be used to analyze and design sequential circuits, as they provide an intuitive and visual way to understand the behavior of the circuit. By examining the state diagram, designers can identify potential issues such as timing problems, race conditions, or invalid state transitions. They can also use the state diagram to optimize the design by eliminating redundant states, reducing the number of transitions, or minimizing the number of inputs required.
• It depicts the different states that a system can be in, the events or inputs that cause the system to transition between states, and the outputs or actions associated with each state.
• A state diagram consists of nodes, which represent the different states of the circuit, and directed edges or arcs, which represent the transitions between states. The edges are labeled with the input conditions that cause the transition, and the outputs associated with the transition can also be indicated.
• In state diagram, a circle or bubble describes a state and directed lines indicate the transition between states. The state of flip-flop is written inside the circle. The directed lines are labelled with two binary numbers separated by a slash. The first one indicates the input value during present state and second number indicates output during present state. Each arrow is labeled with the event or input that triggers the transition, and the associated action or output is usually written next to the arrow or in the state bubble.
• State diagrams can be created using various tools, including software design tools or drawing software. They are commonly used in the design of digital systems, such as microprocessors, control systems, and communication systems, as well as in software engineering, to model the behavior of software applications.
• The state diagram is a useful tool for analyzing and designing sequential circuits. It allows designers to visualize the sequence of state transitions that a circuit will undergo in response to a sequence of input signals. This can help to identify potential issues such as timing or stability problems, and to optimize the circuit design for performance and reliability.
• State diagrams can also be used to derive state tables, which provide a more detailed description of the circuit’s behavior in terms of input, output, and internal states. By systematically analyzing the state diagram, designers can fill in the state table based on the desired behavior of the circuit.
• State diagrams can be used to model a wide range of sequential circuits, including flip-flops, counters, shift registers, and memory elements. They are commonly used in the design of digital systems such as microprocessors, communication systems, and control systems.

## Definition

• Sequential circuits are digital circuits that are capable of storing information and using that information to make decisions. Unlike combinational circuits, this circuits output a value based solely on their input values, sequential circuits have memory elements that allow them to remember past inputs and outputs.
• A sequential circuit is an interconnection of combinational circuits and storage elements(flip-flop) that indicates the state of sequential circuit at that time.
• A sequential circuit is specified by a time sequence of external inputs, external outputs and internal flip-flop binary states.

## Features

• In contrast to combinational circuits, sequential circuit only use the current inputs to produce an output, sequential circuits also take into account their previous state or history.
• Unlike combinational circuits, Sequential circuits are time dependent.
• The synchronization in a sequential circuit is achieved by a clock pulse generator, which produces continuous clock pulse.
• Sequential circuits that have clock pulses as input to flip-flops are called clocked sequential circuit.

## Structure

• The following are some structural characteristics of sequential circuits:
1. State: Sequential circuits have a state or memory element that can store information, such as the previous input values or the current count in a counter.
2. Feedback: The output of a sequential circuit is fed back to its input, which allows the circuit to maintain its state and perform sequential operations.
3. Clock signal: Sequential circuits often use a clock signal to synchronize the timing of their state transitions. The clock signal ensures that all the state transitions in the circuit happen simultaneously and in a predictable way.
4. Memory: Sequential circuits can be used to store and retrieve information, such as in RAM and ROM memory elements.
5. Combinational logic: Sequential circuits also use combinational logic to perform operations based on their current state and input values.
6. Timing considerations: Timing is an important consideration in the design of sequential circuits, as incorrect timing can lead to errors and instability in the circuit.
7. Design complexity: Sequential circuits can be more complex to design than combinational circuits due to their state and feedback elements, and they often require careful analysis and testing to ensure correct functionality and performance.

## Types of Sequential Circuit

(A) Depending upon the time at which Sequential circuits are observed and their internal state changes, they are broadly classified into –

(a) Synchronous Sequential Circuits
(b) Asynchronous Sequential Circuits

#### (a) Synchronous Sequential Circuits

• Synchronous sequential circuits are digital circuits that use a clock signal to synchronize the operations of the circuit. The clock signal ensures that all the memory elements in the circuit change their state at the same time, based on the current input values. This makes it easier to design and analyze the circuit, and also ensures that the circuit operates correctly even if there are delays or variations in the propagation of signals.
• In a synchronous sequential circuit, the output depends not only on the current input, but also on the current state of the circuit.
• A sequential circuit consists of combinational logic and a set of flip-flops. The combinational logic is used to generate the next state of the circuit based on the current input and the current state. The flip-flops are used to store the current state of the circuit.
• In a synchronous sequential circuit, the flip-flops are updated on the rising or falling edge of the clock signal, and the combinational logic uses the current state of the flip-flops and the current input to generate the next state of the circuit. This process repeats on every clock cycle, and the circuit transitions from one state to the next.
• Synchronous sequential circuits have several advantages over asynchronous sequential circuits. One of the main advantages is that the use of a clock signal ensures that all parts of the circuit are synchronized and operate at the same speed. This makes it easier to design and test the circuit. Synchronous sequential circuits are also more reliable and less susceptible to timing errors and glitches than asynchronous circuits.
• Some common examples of sequential circuits include flip-flops, counters, shift registers, and memory elements like RAM and ROM.
• Synchronous circuits are commonly used in digital systems such as microprocessors, communication systems, and control systems.

#### (b) Asynchronous Sequential Circuits

• An asynchronous sequential circuit is a digital circuit in which the output depends not only on the current input, but also on the current state of the circuit, without using a clock signal to synchronize its operations.
• In an asynchronous sequential circuit, the output is updated as soon as the inputs or the internal state of the circuit change.
• In contrast to synchronous sequential circuits, asynchronous sequential circuits do not rely on a clock signal to coordinate the timing of their operations. Instead, they use a variety of techniques, such as delay lines, pulse generators, and hazard detection circuits, to ensure that the circuit behaves correctly even in the presence of timing variations.
• Advantages : Despite of the complexity, asynchronous sequential circuits have some advantages over synchronous circuits. They can be faster, more power-efficient, and more flexible, especially for applications that require fast response times or low power consumption. Asynchronous sequential circuits are used in a variety of applications, including digital signal processing, communication systems, and control systems.
• Disadvantages : The design of asynchronous sequential circuits can be more complex than synchronous circuits due to the lack of a clock signal. Asynchronous circuits also have some disadvantages, such as the potential for glitches and hazards, which are caused by the different delays of the signals in the circuit. These glitches and hazards can result in incorrect output values and require additional logic to be added to the circuit to avoid them.

## Examples of Sequential Circuits

The popular sequential circuits are –

### (1.) Registers

• A register is a digital sequential circuit which consists of a group of flip-flops that stores binary data temporarily and other storage elements (such as Logic gates which controls when and how information is transferred to the register).
• An n-bit register has n flip-flops and stores n-bits of binary information.
• The stored data in a register then can be used as inputs to other parts of the digital system.
• Types of Register :
• There are several types of register circuits based on their function and how they store and retrieve data:-
• Parallel Registers :
• Parallel register circuit stores binary data in parallel format.
• Parallel register is commonly used in microprocessors, where a large amount of data needs to be stored and retrieved quickly.
• A parallel register is one of the simplest registers, consisting of a set of flip-flops that can be read or written simultaneously.
• For example, a 4-bit parallel register having 4 parallel input-output. The signal lines say i1 Io to i3 inputs to flip-flops, which may be output of other arithmetic circuits like multipliers, so that data from different sources can be loaded into the register.
• It has one additional line called Clear line, which can clears the register completely.
• This register is called a parallel register as all the bits of the register can be loaded in a single clock pulse.
• Shift registers:
• This type of register circuit is used for shifting data from one position to another i.e. a shift register is used for shifting the data to the left or right.
• It is commonly used in applications that require bidirectional data transfer.
• Shift register is commonly used for serial-to-parallel and parallel-to-serial data conversion.
• A shift register operates in serial input-output mode i.e. data is entered in first register one bit at a time from one end of the register and can be read from the other end as one bit at a time.
• In this register, signal shift enable is used instead of clock pulse to make this register ON or OFF, because it is not necessary that this register to perform shift ON each clock pulse.
• Shift register may be Uni-directional, which shifts data only in one direction and a register, which can shift data in both directions, called Bi-directional shift register.
• A Shift register can be constructed for bi-directional shift with parallel input-output.
• A general shift register structure may have parallel data transfer to or from the register along with added facility of left or right shift. This structure will require additional control lines for indicating whether parallel or serial output is desired and left or right shift is required.
• There may be 3 main control lines present in a register i.e., if Parallel load enable is active, parallel input-output operation is done otherwise serial input- output. Shift select line for selecting right or left shift. If it has value 0 then right shift is performed and for value 1, left shift is done. Shift enable signal indicates when to start shift operation.
• Serial Register:

• This type of register circuit stores binary data in a serial format.
• It is commonly used in communication systems, where data needs to be transmitted and received in a serial format.
• Bidirectional Register:
• This type of register circuit can both, store and retrieve data, in both directions.
• It is commonly used in applications that require a fast data transfer rate.
• Counter Register:

• This type of register circuit is used for counting events or data.
• It is commonly used in digital clocks and other timing applications.
• Storage Register:

• This type of register circuit is used for storing data temporarily.
• It is commonly used in microcontrollers and digital signal processing applications.

• This type of register circuit can be loaded with data from an external source.
• It is commonly used in data acquisition systems and other applications that require external data storage.

### (2.) Counters

• A counter is a digital circuit that counts the number of pulses received at its input.
• Counters are used in many digital applications such as frequency measurement, timing, and control.
• A counter is also a register, which goes through a predetermined sequence of states when clock pulse is applied.
• In principle, the value of counters is incremented/decremented by 1 module the capacity of register i.e., when the value stored in a counter reaches its maximum value, the next incremented value becomes zero.
• The counters are mainly used in circuits of digital systems where sequence and control operations are performed.
• For example- In CPU, program counter (PC) is a type of Counters.
• Types of Counters :
• Counters can be classified into two categories, based on the way they operate:-
• Asynchronous/Ripple counters:
1. In Asynchronous counters, the change in state of one flip-flop triggers the other flip-flops.
2.  This is more often referred to as ripple counter, as the change, which occurs in order to increment the counter ripples through it from one end to the other.
3. This is more often referred to as ripple counter, as the change, which occurs in order to increment the counter ripples through it from one end to the other.
4. For example – A 4-bit ripple counter using J-K flip-flops starts the counter operation by incrementing the value on the occurrence of each clock pulse and counts from 0000 to 1111 (i.e. 0 to 15).
5. In this, the input line to J & K of all flip-flops is kept high i.e. logic1. Here, each time a clock pulse occurs then the value of flip-flop is complemented.  The clock pulse is given only to first flip-flop and second flip-flop onwards, the output of previous flip-flop is fed as clock signal. This implies that these flip-flops will be complemented if the previous flip-flop has a value 1. Thus, the effect of complement will ripple through these flip-flops.
6. The major disadvantage of ripple counter is the delay in changing the value i.e. for example- suppose the state of ripple counter is 0111. Now the next state will be 1000, which means the change will occur in the state of all flip-flops. But it will not occur simultaneously in all the flip-flop of ripple counter rather first O0 will change then O1, O2 & lastly O3. This delay is proportional to the length of the counter.
• Synchronous counters:
1. Synchronous counter is a type of digital counter in which all the flip-flops are triggered by the same clock signal, and the outputs change simultaneously, or “in sync,” with the clock signal.
2. This type of counter is often used in digital circuits where precise timing and synchronization are critical.
3. Synchronous counters are relatively faster because the state of all flip-flops can be changed at the same time.
4. Synchronous counters are designed to eliminate the problems (delay changing of ripple counters) associated with ripple counters.
5. A synchronous counter is typically constructed using a series of flip-flops connected in a cascade configuration. The first flip-flop is triggered by the clock signal, and the output of this flip-flop serves as the clock input for the next flip-flop in the series. The output of each flip-flop is connected to the next flip-flop’s clock input, which ensures that all the flip-flops change state at the same time.
6. Synchronous counters are advantageous over asynchronous counters because they avoid the issues of propagation delay that asynchronous counters generate, which can lead to timing errors and glitches.
7. Synchronous counters are widely used in digital electronics applications such as frequency dividers, shift registers, timers, digital clocks and other digital circuits where precise timing and synchronization are essential.
8. A synchronous counter is a type of digital circuit that uses flip-flops to count pulses or events.
9. In a synchronous counter, the flip-flops are all clocked at the same time, which means that they all change state simultaneously.
10. There are two main types of synchronous counters: the up-counter and the down-counter. In an up-counter, the count sequence goes from 0 to a maximum value, while in a down-counter, the count sequence goes from a maximum value down to 0.
11. Each flip-flop in a synchronous counter represents a binary bit, and the output of each flip-flop is connected to the clock input of the next flip-flop in the sequence. This means that the clock signal is propagated through the chain of flip-flops, and the count sequence is determined by the state of each flip-flop.
12. They are typically faster and more reliable than asynchronous counters, which use separate clock signals for each flip-flop in the sequence.

Categories: Computer Organization