Liebe Kollegen!
Ich habe ein Modul geschrieben, dass einen Integer Wert in ein array
schreibt. Leider funktioniert die if-Abfrage für das negative Vorzeichen
nicht. Kann mir bitte jemand sagen was ich übersehe?
1 | when rdy =>
|
2 | ...
|
3 | if count = 31 then
|
4 | count <= 0;
|
5 | rd <= '1';
|
6 | if vz = '1' then
|
7 | a(1) <= "1111";
|
8 | else
|
9 | a(1) <= s_shift(63 downto 60);
|
10 | end if;
|
11 | a(2) <= s_shift(59 downto 56);
|
12 | a(3) <= s_shift(55 downto 52);
|
13 | a(4) <= s_shift(51 downto 48);
|
14 | a(5) <= s_shift(47 downto 44);
|
15 | a(6) <= s_shift(43 downto 40);
|
16 | a(7) <= s_shift(39 downto 36);
|
17 | a(8) <= s_shift(35 downto 32);
|
18 | s_state <= idle;
|
19 | else
|
20 | count <= count + 1;
|
21 | s_state <= shift;
|
22 | end if;
|
23 | end case;
|
24 | ...
|
25 |
|
26 | package myarray is
|
27 | type stdarray is array (1 to 8) of std_logic_vector (3 downto 0);
|
28 |
|
29 | end package myarray;
|
das nächste Modul sendet das array and die RS232. Deshalb verwende ich
für ein Minus "1111" weil das RS232 Modul alles in ASCII umwandelt.
DANKE