title: VHDL Confusion using concurrent code and sequential code
body: <p>I am trying to code a 8 bit full adder using just concurrent code in VHDL but I got an error in the syntaxis. In the first instance i did this:</p>
  <pre><code>    LIBRARY ieee;
      USE ieee.std_logic_1164.ALL;
  
      ENTITY concfulladder IS
  
          PORT(     A: IN std_logic_vector (7 DOWNTO 0);
                    B: IN std_logic_vector (7 DOWNTO 0);
                  Cin: IN std_logic_vector (7 DOWNTO 0);
                  Sum: OUT std_logic_vector(7 DOWNTO 0);
                 Cout: OUT std_logic_vector(7 DOWNTO 0));
           
      END concfulladder;
  
      ARCHITECTURE cfulladder OF concfulladder IS
  
  
      BEGIN
  
        sum(0) &lt;= '0' WHEN (A(0) XOR B(0) XOR CIN(0)) = '0' ELSE
                  '1';
        cout(0) &lt;= '0' WHEN ((A(0) AND B(0)) OR (Cin(0) AND A(0)) OR (Cin(0) AND B(0))) = '0' ELSE
                   '1';
        sum(1) &lt;= '0' WHEN (A(1) XOR B(1) XOR CIN(1)) = '0' ELSE
                   '1';
        cout(1) &lt;= '0' WHEN ((A(1) AND B(1)) OR (Cin(1) AND A(1)) OR (Cin(1) AND B(1))) = '0' ELSE
                   '1';
         sum(2) &lt;= '0' WHEN (A(2) XOR B(2) XOR CIN(2)) = '0' ELSE
                   '1';
        cout(2) &lt;= '0' WHEN ((A(2) AND B(2)) OR (Cin(2) AND A(2)) OR (Cin(2) AND B(2))) = '0' ELSE
                   '1';
         sum(3) &lt;= '0' WHEN (A(3) XOR B(3) XOR CIN(3)) = '0' ELSE
                   '1';
        cout(3) &lt;= '0' WHEN ((A(3) AND B(3)) OR (Cin(3) AND A(3)) OR (Cin(3) AND B(3))) = '0' ELSE
                   '1';
         sum(4) &lt;= '0' WHEN (A(4) XOR B(4) XOR CIN(4)) = '0' ELSE
                   '1';
        cout(4) &lt;= '0' WHEN ((A(4) AND B(4)) OR (Cin(4) AND A(4)) OR (Cin(4) AND B(4))) = '0' ELSE
                   '1';
         sum(5) &lt;= '0' WHEN (A(5) XOR B(5) XOR CIN(5 )) = '0' ELSE
                   '1';
        cout(5) &lt;= '0' WHEN ((A(5) AND B(5)) OR (Cin(5) AND A(5)) OR (Cin(5) AND B(5))) = '0' ELSE
                   '1';
         sum(6) &lt;= '0' WHEN (A(6) XOR B(6) XOR CIN(6)) = '0' ELSE
                   '1';
        cout(6) &lt;= '0' WHEN ((A(6) AND B(6)) OR (Cin(6) AND A(6)) OR (Cin(6) AND B(6))) = '0' ELSE
                   '1';
         sum(7) &lt;= '0' WHEN (A(7) XOR B(7) XOR CIN(7)) = '0' ELSE
                   '1';
        cout(7) &lt;= '0' WHEN ((A(7) AND B(7)) OR (Cin(7) AND A(7)) OR (Cin(7) AND B(7))) = '0' ELSE
                   '1';
               
    END cfulladder;
  </code></pre>
  <p>And all of this is correct I don't get any error. But, if I try to decrease the number of lines using a for loop I got an error:</p>
  <pre><code>PROCESS (all) IS
  
  BEGIN
  
      FOR I IN 0 TO 7 LOOP
  
          Sum(I) &lt;= '0' WHEN (A(I) XOR B(I) XOR CIN(I)) = '0' ELSE 
                       '1';
                       
          Cout(I) &lt;= '0' WHEN ((A(I) AND B(I)) OR (Cin(I) AND A(I)) OR (Cin(I) AND B(I))) = '0' ELSE 
                        '1';
  
      END LOOP;
  
  END PROCESS;
  </code></pre>
  <p>The error is: Error near text WHEN;  expecting &quot;;&quot;. Searching a solution in internet I found that I can't use sequential code and concurrent code in the same program. Is there any solution for this problem?</p>