Hallo Ich habe folgenden Code: library ieee; use ieee.std_logic_1164.all; entity fteiler is Port ( CLOCK : in std_logic; CLK1 : out std_logic; CLK2 : out std_logic); end fteiler; architecture behavior of fteiler is signal count_int : std_logic_vector(0 to 19) := "00000000000000000000"; begin process (CLOCK) begin if CLOCK='1' and CLOCK'event then count_int <= count_int + '1'; end if; end process; CLK1 <= count_int(19); CLK2 <= count_int(18); end behavior; ------------------------------------------------------------------ und bekomme dazu folgende Fehlermeldund: Error (10327): VHDL error at fteiler.vhd(19): can't determine definition of operator ""+"" -- found 0 possible definitions Kann mir jemand weiter helfen?
Nein leider nicht. + '1'; statt + 1; habe ich zum probieren eingefügt, es geht beides nicht.
Definiere ein constant namens one mit '0000000...01' und mache count_int <= count_int + one; oder mache einfach: count_int <= count_int + '0000000...01' brauchst auf jedenfall brauchst du 20 stellen. grüße
Mit std_logic_vector-Typen kann man in VHDL nicht direkt rechnen, egal wie lang die Vektoren sind. Oben kam ja schon der Hinweis auf unsigned, das wäre in diesem Fall die sinnvollste Lösung. Hier sind nochmal alle Möglichkeiten zusammengefasst: http://www.mikrocontroller.net/articles/Rechnen_in_VHDL
Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
Bestehender Account
Schon ein Account bei Google/GoogleMail? Keine Anmeldung erforderlich!
Mit Google-Account einloggen
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.