FPGA Center


In this section you will learn how to assign values to signals by using different methods.

signal_name <= [delay] value ;
signal_name <= [delay] value1 when condition1 else
                            [delay] value2 when condition2 else
                            . . .

                            [delay] valueN;
with choice select
    signal_name <= [delay] value1 when option1,
                                 [delay] value2 when option2,
                                . . .
                                [delay] valueN when others;



signal A, B, C, X, Y, Z : integer;
process (A, B, C)
      A <= X - 5;
      B <= X * Y; --Operation is invalid.
      C <= Z + A;
       B <= Y;  --Operation is valid since it is the last assignment to B
end process;

In the example, all the lines are valid except (B <= X * Y). Becuase the last assignment to B is valid after all lines are processed in the process.


signal A, B, C, X, Y, Z : integer;
process ( X, Y, Z)
     A <= X - 5;
     B <= X * Y;
     C <= Z + A;
      Y <= Z * C; 
end process;

Suppose that this process is recalled somewhere becuse of a change on signal Z. After processing, signal Y will be change as well. This is another signal which is in the sensiticity list of te current process. So this process wil be recaalled again.


architecture concurrent of HalfAdder is
  Sum <= X xor Y;
  Carry <= X and Y;
end architectureconcurrent;

In this example, Sum and Cary outputs will be assigned with new values concurrently, at the ame time one of the signals X and Y is changed.


architecture Conditional of TS_Buffer is
  B_Out <= B_In when EN = '1'
    else 'Z';
end architecture Conditional;

This is a tristate buffer example. As yoou can see, the B_In will be assigned to B_Out when only EN is 1. For the other values output is 'Z' (high impedance)


with Command select
  MuxOut <= In1 when 0 to 3,  --Range is used as options.
                      In2 when 4 | 5,    --In2 will be directed to output, as long as 4 or 5 are choosed.
                      In3 when 6,
                       'Z' when others;


Sequential Signal Assignment

If there are more than one signal assignment in a process, the result will be seen after this process will be suspended. If there are multiple assignments on one signal, the latest assignment will determine the result. (EXAMPLE 1)

If you try to assign a signal which is in the sensitivity list in the process, it will cause this process to recall again. (EXAMPLE 2)

Concurrent Signal Assignment

Concurrent signal assignment can be done in archiecture. Here any change of a signla is independent from others. (EXAMPLE 3)

If you want to assign muliple aclues to one signal, that signal must be in resolved type.

Conditional Signal Assignment

Conditional signal assignment is actually a concurrent process. However it is similar to if then else in a porcess. Signal assignment is done if there is a boolean condition after "when" expression. (EXAMPLE 4)

Selected Signal Assignment

Selected signal assingment is similar to concurrent signal assignment by using "case". If the last option is not declared with "others" expression, all the options must be declared one by one. Range or values can be 覺sed as options. (EXAMPLE 5)







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