Gast
#2041929
Hallo, Habe ein paar Probleme mit dem bubblesort Algorithmus. Soll einen Algorithmus in VHDL schreiben, der einen Bubblesort macht und zwar mit Integerwerten. Ich weiss nur nicht, wie ich ein Integer Array erzeuge. Der Code sieht bis jetzt folgendermaßen aus: n := in'length; vertauscht <= '1'; while vertauscht = '1' and n > 1 loop vertauscht <= '0'; for i in in'range loop if in(i) > in(i+1) then temp <= in(i); in(i) <= in(i+1); in(i+1) <= temp; vertauscht <= '1'; end if; end loop; n <= n - 1; end loop; Ich habe als Array Defintion gedacht: type array_type1 is array (8 downto 0) of integer; Vielleicht kann ja mal jemand drüberschauen. Gruß paul