VHDL Statements
VHDL Statements
Statement
End
No significance of order of statement It is executed one after another in sequential order.
Process is a concurrent statement Statements inside a process are executed sequentially
Cont….
Concurrent Sequential
Describes the connection between lower level Sequence of related events
components and combinational logic Such as state machines
It has two forms conditional assignment and selective It has only a single form which is an unconditional
assignment C<= a and b after 5ns;
Data flow Behavioural
BLOCK, PROCESS, ASSERT and COMPONENT PROCESS, IF, CASE, LOOP, EXIT, WAIT and Subprogram
Sequential statements
• Process
• Sensitivity list
• Process with incomplete sensitivity list
• WAIT
• Combinational and Sequential Process
• Signal Assignment
• Variable Assignment
Process
• It can have sensitivity list or wait
• Without this it runs forever at time 0.
• Syntax:
simple_1: process [(sensitivity_list)]
[type declaration]
[constant_declaration] constant x: integer:=4;
[variable_declaration]
[subprogram_declaration]
Begin
Sequential statements
End process simple_1;
Sensitivity list
• List of signals to which the process is sensitive.
• When a sensitivity list is specified the process will suspend only the
last statement , until a new event is produced on the signals in the
sensitivity list.
Syntax:
Process( a,b,c) sensitivity list
Y<= a and b or c;
Process with incomplete sensitivity list
Syntax
Process(a,b)
WAIT
• Syntax:
Wait until signal_condition;
Wait on signal 1, signal 2,…;
Wait for time;
Eg:
Wait until (clk=‘1’);
Wait on clk;
Wait for 50ns;
Combinational and Sequential Process
Case exp is
When options_1=>
Statement
……
When options_n=>
Statement
When others=>
Statement
End case;
Case sel is
When ‘0’=> y<=a
When ‘1’ => y<=b
End case;
case expression is
When “0000”=>
Statement_sequence0
When 0001|val2|val3 =>
Case a is
Statement1 When “00”|”01”|”10”=>
When val4 to val8=> Y<=‘0’;
When others=>
Statement2
Y<‘1’;
When val9 to val15|val16 to val20=> End case
Statement3
When others=>
Statement4
End case;
Architecture beh of and_gate is
Begin
Process(a,b)
variable temp:std_logic_vector(1 downto 0);
Begin
temp:=a&b;
Case temp is
When “00” => y<=‘0’;
When “01” => y<=‘0’;
When “10” => y<=‘0’;
When “11” => y<=‘1’;
When others => y<= ‘0’;
End case;
End process;
End beh;
Loop
[label:] loop
Statement
End loop [label];
Loop_one: loop
X<=x+1;
Exit loop_one when x>5;
End loop loop_one;
NULL
• It states that no action occurs
NULL;
Assert condition
[report character_string]
[severity severity_level]; [note warning error failure]
RETURN
• Allowed within the subprogram
• It is a required statement in a function where function returns its own
function value
• The selected signal assignment statement allows to select a source expression based on a
condition.
Syntax:
With selection_expression select
Signal<= express_1 when options_1,
express_n when options_n,
Expression when others;
If condition generate
[concurrent assignment]
End generate;
Others and unaffected
Concurrent assert statement