FPGA Center



 * Constant

 * Signal

 * Operators

 * Component

 * Concurrent Assignments

 * Process

 * Sequential Statements

 * Variable

  * User Defined Types

 

Sequential Statements

Process, function ve procedure i癟lerinde kullan覺lan komutlard覺r. Basit sinyal atamalar覺nda da s覺ral覺 komutlar kullan覺l覺r. S覺ral覺 komutlar aa覺daki gibidir:

1. if-then

    if condition then
        statements
    elsifcondition then
       statements
    else
       statements
   end if;

Example:

1

process(in1,in2,in3,in4,sel)
   begin
      if sel = "00" then
          output<=in1;
      elsif sel = "01" then
         output<=in2;
      elsif sel = "10" then
          output<=in3;
       else
          output<=in4;
      end if;
  end process;

2. Case

case choice_expression is
         when choice=> assignment;
         when choice =>assignment;
         when choice =>assignment;
  end case;

Example:

process(in1,in2,in3,in4,sel)
    begin
        case sel is
           when "00" => output<=in1;
           when "01" => output<=in2;
           when "10" => output<=in3;
           when others => output<=in4;
       end case;
  end process;

3. Loops

a) Loop

Infinite loop stays active as long as there is no exit expression.

Loop_label: loop
                          sequential_statements
                          exit when
                          next when
                       end loop;

b) While Loop

While loop is used when a statement is related wih a condiion.

 While condition loop
     --sequential_statements
End loop;

c) For Loop

For loop is used in a range of loop parameters.

For loop_parameter in range loop
         --sequential_statements
End loop;

Exit and next expressions can be used in all loops.

4. Wait

a) Wait on signal_name

Execution waits until any change in signal.

Wait on clk,reset;

b) Wait until condition_expression

Execution waits until condition meets.

Wait until clk=1

c) Wait for time_expression

Execution waits for the time interval stated as time_expression. It is not synthesizable. You can use it for only simulation purpose.

Wait for 20 us;

 

 

 

 project                                                                                                                                    Vhdl_Code                                                                                                                                    

 

Home | Fpga | VHDL | VHDL Dictionary | Digital Design | Simulation | PCB | Examples | Contact Us
Copyright © 2010 - 2013 FPGAcenter. All Rights Reserved.