Search code examples
concurrencyvhdl

How statements are executed concurrently in combinational logic using VHDL?


I wonder how signal assignment statements are executed concurrently in combinational logic using VHDL? For the following code for example the three statements are supposed to run concurrently. What I have a doubt in is that how the 'y' output signal is immediately changed when I run the simulation although if the statements ran concurrently 'y' will not see the effect of 'wire1' and 'wire2' (only if the statements are executed more than one time).

entity test1 is port (a, b, c, d : in bit; y : out bit);
end entity test1;
------------------------------------------------------
architecture basic of test1 is
signal wire1, wire2 : bit;
begin
    wire1 <= a and b;
    wire2 <= c and d;
    y <= wire1 and wire2;
end architecture basic;

Solution

  • Since VHDL is used for simulating digital circuits, this must work similarly to the actual circuits, where (after a small delay usually ignored in simulations) circuits continously follow their inputs.

    I assume you wonder how the implementation achieves this behaviour:

    The simulator will keep track of which signal depends on which other symbol and reevaluates the expression whenever one of the inputs changes.

    So when a changes, wire1 will be updated, and in turn trigger an update to y. This will continue as long as combinatorial updates are necessary. So in the simulation the updates are indeed well ordered, although no simulation time has passed. The "time" between such updates is often called a "delta cycle".