Quantcast
Channel: CodingTalks » codingtalks
Viewing all articles
Browse latest Browse all 7

Sequential Behavior of VHDL

$
0
0

 VHDL Programming

 

Sequential Behavior :

 

There is yet another way to describe the functionality of a mux device in VHDL. The fact that VHDL has so many possible representations for similar functionality is what makes learning the entire language a big task. The third way to describe the functionality of the mux is to use a process statement to describe the functionality in an algorithmic representation. This is shown in architecture sequential, as shown in the following:

ARCHITECTURE sequential OF mux IS
(a, b, c, d, s0, s1 )
VARIABLE sel : INTEGER;
BEGIN
IF s0 = ‘0’ and s1 = ‘0’ THEN
sel := 0;
ELSIF s0 = ‘1’ and s1 = ‘0’ THEN
sel := 1;
ELSIF s0 = ‘0’ and s1 = ‘0’ THEN
sel := 2;
ELSE
sel := 3;
END IF;
CASE sel IS

WHEN 0 =>
x <= a;
WHEN 1 =>
x <= b;
WHEN 2 =>
x <= c;
WHEN OTHERS =>
x <= d;
END CASE;
END PROCESS;
END sequential;

 

 

The architecture contains only one statement, called a process statement. It starts at the line beginning with the keyword PROCESS and ends with the line that contains END PROCESS. All the statements between these two lines are considered part of the process statement.

 

Process Statements: 
The process statement consists of a number of parts. The first part is called the sensitivity list; the second part is called the process declarative part; and the third is the statement part. In the preceding example, the list of signals in parentheses after the keyword PROCESS is called the sensitivity list. This list enumerates exactly which signals cause the process statement to be executed.

In this example, the list consists of a, b, c, d, s0, and s1. Only events on these signals cause the process statement to be executed.
Process Declarative Region :
The process declarative part consists of the area between the end of the sensitivity list and the keyword BEGIN. In this example, the declarative part contains a variable declaration that declares local variable sel. This variable is used locally to contain the value computed based on ports s0 and s1.
Process Statement Part :
The statement part of the process starts at the keyword BEGIN and ends at the END PROCESS line. All the statements enclosed by the process are sequential statements. This means that any statements enclosed by the process are executed one after the other in a sequential order just like a typical programming language. Remember that the order of the statements in the architecture did not make any difference; however, this is not true inside the process. The order of execution is the order of the statements in the process statement.

 

 

The post Sequential Behavior of VHDL appeared first on CodingTalks.


Viewing all articles
Browse latest Browse all 7

Trending Articles