title: How can I replace the below while loops with something working on ISE?
body: <p>I'm working on my school project and after I finished it I realized that the code doesn't work on ISE. I can't imagine how should I change the algorithm in order to get what I need => multiple subtractions.  </p>
  
  <p>I tried it on Active-HDL too, there's all fine right there. It successfully compiles and works. </p>
  
  <pre><code>process(clk)
    variable provi, bac_10, bac_20, bac_50, bac_5, bac_2, bac_1: integer:=0;
    begin
      if enable='1' and clk='1' and clk'event then
          if int_suma_introdusa&lt;int_suma_necesara then 
              succes&lt;='0';
          elsif int_suma_introdusa=int_suma_necesara then
              succes&lt;='1';
          else
              provi:=int_suma_introdusa-int_suma_necesara;
              bac_50:=rez_50;
              bac_20:=rez_20;
              bac_10:=rez_10;
              bac_5:=rez_5;
              bac_2:=rez_2;
              bac_1:=rez_1;
  
  
              while provi&gt;49 and bac_50&gt;0 loop
                  provi:= provi-50;
                  bac_50:= bac_50-1;
              end loop;
  
              while provi&gt;19 and bac_20&gt;0 loop
                  provi:= provi-20;
                  bac_20:= bac_20-1;
              end loop;
  
              while provi&gt;9 and bac_10&gt;0 loop
                  provi:= provi-10;
                  bac_10:= bac_10-1;
              end loop;
  
              while provi&gt;4 and bac_5&gt;0 loop
                  provi:= provi-5;
                  bac_5:= bac_5-1;
              end loop;
  
              while provi&gt;1 and bac_2&gt;0 loop
                  provi:= provi-2;
                  bac_2:= bac_2-1;
              end loop;
  
  
              while provi&gt;0 and bac_1&gt;0 loop
                  provi:= provi-1;
                  bac_1:= bac_1-1;
              end loop;
  
              if provi=0 then 
                  succes&lt;='1';
              else succes&lt;='0';
              end if;
          end if;
      end if;
  end process;
  </code></pre>
  
  <p>So could you pleas egive me an idea?</p>