title: bubble sort in vhdl
body: <p>Can anyone help me in writing VHDL code for bubble sort given an array of data as input?</p>
  
  <p>I have declared in_array as input which contains 15 array elements. i want to bubble sort them in descending order.</p>
  
  <p><code>in_array</code> is input array.
  <code>sorted_array</code> is out put array.
  <code>in_array_sig</code> is signal of type in_array</p>
  
  <p>I am facing problem with statements inside process</p>
  
  <p>Below is my code:</p>
  
  <pre><code>architecture behav of Bubblesort is
    signal in_array_sig : bubble;
    signal temp : std_logic_vector(3 downto 0);
    signal i : integer := 0;
  begin
  
    in_array_sig &lt;= in_array;
  
    proc1 : process(clk, reset)
    begin
      if reset = '0' then
        if (clk'event and clk = '1') then
          while (i &lt;= 15) loop
            if (in_array_sig(i) &lt; in_array_sig(i + 1)) then
              temp &lt;= in_array_sig(i);
              in_array_sig(i) &lt;= in_array_sig(i + 1);
              in_array_sig(i + 1) &lt;= temp;
            end if;
            i &lt;= i + 1;
          end loop;
        end if;
      end if;
    end process;
  
    sorted_array &lt;= in_array_sig;
  
  end behav;
  </code></pre>
  
  <p>I am beginner in VHDL coding. Kindly help me with this.</p>