Hallo, guten Tag. Ich habe ein Ram wo jede Addresse ein Pixel darstellt. Wird dadurch immer wieder aktualisiert: address1 <= address1 + 1; Kann schon mit einem geänderten VHDL über RS232 Daten für eine Sinuskurve schicken die dargestellt wird (daher vorher meine Mult-Frage zum Zeitverzug). Nun habe ich eine Auflösung von 320x240 beim VGA 640x480. Die Abbildung ist 1/4 vom Screen 640x480 oben links abgebildet. Nun möchte ich das die Pixel doppelt so gross werden. Ich wollte dadurch Speicher sparen kann zwar auf dem DE0 bis ca 520000 gehen. Jetzt steht der Verbrauch bei 76800 bei 320x240 Finde aber keine Lösung, wie ich das machen kann. Danke. Gruss Danke. GRuss
1 | library IEEE; |
2 | use IEEE.STD_LOGIC_1164.ALL; |
3 | use ieee.numeric_std.ALL; |
4 | |
5 | entity vga_core is |
6 | port
|
7 | (
|
8 | clock : in std_logic; |
9 | red : out std_logic_vector(3 downto 0); |
10 | green : out std_logic_vector(3 downto 0); |
11 | blue : out std_logic_vector(3 downto 0); |
12 | hsync : out std_logic; |
13 | vsync : out std_logic |
14 | );
|
15 | end vga_core; |
16 | |
17 | architecture vga_core_arch of vga_core is |
18 | |
19 | signal clk : std_logic; |
20 | signal lineCounter : integer:=0; |
21 | signal pixelCounter: integer:=0; |
22 | |
23 | signal we1 : STD_LOGIC :='0'; |
24 | signal address1 : integer range 0 to 76797 := 0; |
25 | signal datain1 : STD_LOGIC_VECTOR(0 downto 0):="0"; |
26 | signal dataout1 : STD_LOGIC_VECTOR(0 downto 0):="0"; |
27 | |
28 | component ram1 port( |
29 | we1 : in STD_LOGIC; |
30 | address1 : in integer range 0 to 76797 := 0; |
31 | datain1 : in STD_LOGIC_VECTOR(0 downto 0); |
32 | dataout1 : out STD_LOGIC_VECTOR(0 downto 0); |
33 | clock : in std_logic |
34 | );
|
35 | end component; |
36 | |
37 | begin
|
38 | io1 : ram1 port map(we1,address1,datain1,dataout1,clock); |
39 | |
40 | process(clock) |
41 | begin
|
42 | if rising_edge(clock) then |
43 | clk <= NOT clk; |
44 | end if; |
45 | end process ; |
46 | |
47 | process(clk) |
48 | begin
|
49 | if rising_edge(clk) then |
50 | pixelCounter <= pixelCounter + 1; |
51 | |
52 | if pixelCounter = 800 then |
53 | pixelCounter <= 0; |
54 | lineCounter <= lineCounter + 1; |
55 | end if; |
56 | |
57 | if lineCounter = 525 then |
58 | lineCounter <= 0; |
59 | end if; |
60 | |
61 | if pixelCounter >= 655 AND pixelCounter <= 751 then |
62 | hsync <= '0'; |
63 | else
|
64 | hsync <= '1'; |
65 | end if; |
66 | |
67 | if lineCounter >= 489 AND lineCounter <= 491 then |
68 | vsync <= '0'; |
69 | else
|
70 | vsync <= '1'; |
71 | end if; |
72 | |
73 | if pixelCounter >= 0 AND pixelCounter <= 319 AND lineCounter >= 0 AND lineCounter <= 239 then |
74 | red <= "0000"; |
75 | green <= "0000"; |
76 | blue <= "0000"; |
77 | |
78 | if dataout1 ="1" then |
79 | green <= "1111"; |
80 | else
|
81 | green <= "0000"; |
82 | end if; |
83 | |
84 | if address1 = 76798 then |
85 | address1 <= 0; |
86 | else
|
87 | address1 <= address1 + 1; |
88 | end if; |
89 | else
|
90 | red <= "0000"; |
91 | green <= "0000"; |
92 | blue <= "0000"; |
93 | end if; |
94 | end if; |
95 | end process ; |
96 | |
97 | end architecture; |