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.

I tried it on Active-HDL too, there's all fine right there. It successfully compiles and works.

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<int_suma_necesara then 
            succes<='0';
        elsif int_suma_introdusa=int_suma_necesara then
            succes<='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>49 and bac_50>0 loop
                provi:= provi-50;
                bac_50:= bac_50-1;
            end loop;

            while provi>19 and bac_20>0 loop
                provi:= provi-20;
                bac_20:= bac_20-1;
            end loop;

            while provi>9 and bac_10>0 loop
                provi:= provi-10;
                bac_10:= bac_10-1;
            end loop;

            while provi>4 and bac_5>0 loop
                provi:= provi-5;
                bac_5:= bac_5-1;
            end loop;

            while provi>1 and bac_2>0 loop
                provi:= provi-2;
                bac_2:= bac_2-1;
            end loop;


            while provi>0 and bac_1>0 loop
                provi:= provi-1;
                bac_1:= bac_1-1;
            end loop;

            if provi=0 then 
                succes<='1';
            else succes<='0';
            end if;
        end if;
    end if;
end process;

So could you pleas egive me an idea?

0 Answers