# HDL Model of Sequential Circuits

Last Updated : 13 Nov, 2022

Digital electronics is the study of electronic circuits that are used to process digital signals. In this article, we will focus on the HDL model of sequential circuits. Sequential circuits are those in which the output of the circuit depends on the current input and the previous inputs. HDL is a hardware description language that can be used to design, simulate, and synthesize digital circuits. It is a powerful tool for designing complex digital systems.

In digital electronics, a hardware description language (HDL) is used to describe the behavior of electronic circuits. In this context, a sequential circuit is one whose output depends not only on its current input but also on its past history.

There are two common types of HDLs: Verilog and VHDL. Verilog is more commonly used in industry, while VHDL is more popular in academics. Both languages are based on the same underlying concepts, so they are largely interchangeable.

The most basic element of an HDL is the wire. Wires are used to connect different parts of a circuit together. They can be either unidirectional or bidirectional. Unidirectional wires can carry signals in only one direction, while bidirectional wires can carry signals in both directions.

Wires are made up of two terminals, called pins. The first terminal is called the source, and the second terminal is called the destination. The source supplies the signal that will be carried by the wire, and the destination receives that signal.

A simple digital circuit might consist of a wire connecting an AND gate to a NOT gate. The output of the AND gate would be connected to the input of the NOT gate, and the output of the NOT gate would be connected to one of the AND gate’s inputs. This circuit would have two inputs and one output.

The value of a signal carried by a wire can be either 0.

### Behavioral modeling:

Behavioral modeling is an approach to designing digital circuits. Its main focus is on the functionality of the circuit rather than its implementation. This makes it well-suited for designs that will be implemented in different ways or for exploring different design options.

A behavioral model is typically written in a high-level language such as Verilog or VHDL. It can be simulated using a software simulator or hardware emulator.

Behavioral models are often used to create test benches. These are used to verify the functionality of RTL (register transfer level) code or synthesized netlists. A test bench consists of stimulus files and checker routines. The stimulus files provide input values to the circuit under test and the checker routines compare the output of the circuit with the expected results.

Simulating a behavioral model is usually much faster than simulating an RTL model because fewer levels of logic need to be considered. This makes behavioral modeling an important tool for rapid prototyping and exploratory design.

### HDL models of flip-flops and latches:

Latches

There are two main types of sequential circuits: those that store data (flip-flops and latches) and those that don’t store data (counters). The type of sequential circuit you use will depend on the application.

Flip-flops and latches are digital circuits that store data. They have two main parts: a set-reset flip-flop or latch (SRFF) and a D flip-flop. The SRFF is responsible for storing the data, while the D flip-flop is responsible for outputting the stored data.

Edge-Triggered D Flip Flop

The most common type of flip-flop is the SR Flip-Flop. It has two inputs, SET and RESET, and two outputs, Q and ~Q. When SET is HIGH and RESET is LOW, the output Q is HIGH. When SET is LOW and RESET is HIGH, the output Q is LOW. If both SET and RESET are LOW, then the output Q does not change.

Latches are similar to flip-flops, but they have only one input. The input is called the DATA input. When DATA is HIGH, the output Q is HIGH. When DATA is LOW, the output Q is LOW. If DATA changes from LOW to HIGH while the clock signal is HIGH, then the output Q does not change until the clock signal goes LOW again.

Examples:

Digital electronics is a growing field with many different applications. HDL (Hardware Description Language) is one way to model digital circuits. It is a powerful tool for designers and engineers because it allows for a high level of abstraction. This means that the design can be described at a higher level, making it easier to understand and work with.

HDL can be used to describe both combinational and sequential circuits. Combinational circuits are those in which the output depends only on the current input values. Sequential circuits are those in which the output also depends on the past history of the inputs (i.e., they have memory).

Let’s take a look at an example of each type of circuit.

A simple AND gate is a good example of a combinational circuit. The output will be 1 only if both inputs are 1; otherwise, the output will be 0.

In contrast, a D flip-flop is an example of a sequential circuit. The output will be 1 only if the input changes from 0 to 1 while the clock signal is 1; otherwise, the output will remain 0. Notice that the output here depends not only on the current input value but also on the past history of the inputs (i.e., whether or not the input has changed from 0 to 1 in previous clock cycles).

Previous
Next