title: Confusion between Behavioural and Dataflow model Programs in VHDL
body: <p>I'm using the textbook "VHDL: Programming By Example" by Douglas L Perry, Fourth Edition. He gave an example of the Dataflow programming model in page 4:</p>
  
  <p><strong>Code I:</strong></p>
  
  <pre><code>ENTITY mux IS
  PORT ( a, b, c, d : IN BIT;
  s0, s1 : IN BIT;
  x, : OUT BIT);
  END mux;
  ARCHITECTURE dataflow OF mux IS
  SIGNAL select : INTEGER;
  BEGIN
  select &lt;= 0 WHEN s0 = ‘0’ AND s1 = ‘0’ ELSE
            1 WHEN s0 = ‘1’ AND s1 = ‘0’ ELSE
            2 WHEN s0 = ‘0’ AND s1 = ‘1’ ELSE
            3;
  x &lt;= a AFTER 0.5 NS WHEN select = 0 ELSE
       b AFTER 0.5 NS WHEN select = 1 ELSE
       c AFTER 0.5 NS WHEN select = 2 ELSE
       d AFTER 0.5 NS;
  END dataflow;
  </code></pre>
  
  <p>Now in page 17,
  <strong>Code II</strong></p>
  
  <pre><code>LIBRARY IEEE;
  USE IEEE.std_logic_1164.ALL;
  ENTITY mux4 IS
  PORT ( i0, i1, i2, i3, a, b : IN std_logic;
  PORT ( i0, i1, i2, i3, a, q : OUT std_logic);
  END mux4;
  ARCHITECTURE mux4 OF mux4 IS
  SIGNAL sel: INTEGER;
  BEGIN
  WITH sel SELECT
  q &lt;= i0 AFTER 10 ns WHEN 0,
  q &lt;= i1 AFTER 10 ns WHEN 1,
  q &lt;= i2 AFTER 10 ns WHEN 2,
  q &lt;= i3 AFTER 10 ns WHEN 3,
  q &lt;= ‘X’ AFTER 10 ns WHEN OTHERS;
  sel &lt;= 0 WHEN a = ‘0’ AND b = ‘0’ ELSE
         1 WHEN a = ‘1’ AND b = ‘0’ ELSE
         2 WHEN a = ‘0’ AND b = ‘1’ ELSE
         3 WHEN a = ‘1’ AND b = ‘1’ ELSE
         4;
  END mux4;
  </code></pre>
  
  <p>This is supposed to be a <strong>behavioural model</strong>, as per the same textbook. Aside from the differences in variable name, the only major difference I see here is that there is an extra statement</p>
  
  <pre><code>WITH sel SELECT
  </code></pre>
  
  <p>in the second case, and small syntax differences. <strong>This Code II is concurrent.</strong> But from other sources in the internet(listed below), I've seen that a behavioural model is supposed to be sequential. Which one should I believe?</p>
  
  <p>Now from some other sources of the internet, the definition of these models are as follows:</p>
  
  <p>Behavioral – Circuit is described as an i/o relationship using <em>sequential</em> statements inside a <em>process</em>.</p>
  
  <p>Dataflow – Circuit is described using <em>concurrent</em> statements</p>
  
  <p>-San Jose State university</p>
  
  <p>Behavioral – describes how the output is derived from the inputs using structured
  statements.</p>
  
  <p>Dataflow – describes how the data flows.</p>
  
  <p>-University of Akron College of Engineering</p>
  
  <h2>Here I do not understand what structured statements mean.</h2>
  
  <p>in Behaviour level, process keyword is present </p>
  
  <p>in dataflow level , concurrent statement (&lt;=) is present </p>
  
  <hr>
  
  <p>This was seen in an online forum.</p>
  
  <p>Is process statement compulsory for Behavioural model? </p>
  
  <p>What is the actual difference between codes I and II? According to the author, they have different models, dataflow and behavioural. I cannot see how this is possible. What should I believe? </p>
  
  <p>Lastly, in Perry D L, Page 45, 46:</p>
  
  <pre><code>LIBRARY IEEE;
  USE IEEE.std_logic_1164ALL;
  ENTITY mux IS
  PORT (i0, i1, i2, i3, a, b : IN std_logic;
  PORT (q : OUT std_logic);
  END mux;
  ARCHITECTURE better OF mux IS
  BEGIN
  PROCESS ( i0, i1, i2, i3, a, b )
  VARIABLE muxval : INTEGER;
  BEGIN
  muxval := 0;
  IF (a = ‘1’) THEN
  muxval := muxval + 1;
  END IF;
  IF (b = ‘1’) THEN
  muxval := muxval + 2;
  END IF;
  CASE muxval IS
  WHEN 0 =&gt;
  q &lt;= I0 AFTER 10 ns;
  WHEN 1 =&gt;
  q &lt;= I1 AFTER 10 ns;
  WHEN 2 =&gt;
  q &lt;= I2 AFTER 10 ns;
  WHEN 3 =&gt;
  q &lt;= I3 AFTER 10 ns;
  WHEN OTHERS =&gt;
  NULL;
  END CASE;
  END PROCESS;
  END better;
  </code></pre>
  
  <p>This is a sequential version of MUX. According to the other definitions, this is supposed to be behavioural, but the author does not state so. Could you clear up my confusion regarding these models?</p>