Bonjour à tous
Je suis débutante en programmation en VHDL. Actuellement, je travaille sur la carte Spartan-3. J'ai trouvé cet exemple de code sur le net :
http://www.derepas.com/fabrice/hard/
Pour l'exemple de "squares", je n'ai pas compris cette partie :
ou, plus précisément, je n'ai pas compris l'utilité de " horizontal-counter" et "vertical_counter".
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43 process (clk25) begin if clk25'event and clk25 = '1' then if (horizontal_counter >= "0010010000" ) -- 144 and (horizontal_counter < "1100010000" ) -- 784 and (vertical_counter >= "0000100111" ) -- 39 and (vertical_counter < "1000000111" ) -- 519 then red_out <= horizontal_counter(3) and vertical_counter(3); green_out <= horizontal_counter(4) and vertical_counter(4); blue_out <= horizontal_counter(5) and vertical_counter(5); else red_out <= '0'; green_out <= '0'; blue_out <= '0'; end if; if (horizontal_counter > "0000000000" ) and (horizontal_counter < "0001100001" ) -- 96+1 then hs_out <= '0'; else hs_out <= '1'; end if; if (vertical_counter > "0000000000" ) and (vertical_counter < "0000000011" ) -- 2+1 then vs_out <= '0'; else vs_out <= '1'; end if; horizontal_counter <= horizontal_counter+"0000000001 "; if (horizontal_counter="110010000 0") then vertical_counter <= vertical_counter+"0000000001"; horizontal_counter <= "0000000000"; end if; if (vertical_counter="1000001001" ) then vertical_counter <= "0000000000"; end if; end if; end process;
Je me demande si quelqu'un peut m'expliquer ce code.
Merci d'avance
Partager