salut,

j'ai un examen ecrit en VHDL le lundi ...le prof durant ces mois nous donne les TPs dans un fichier sans les faire comprendre ...

comme ce TP par exmple : horloge numérique sur l’écran du PC
Code :
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;

entity POLY_3  is    --vhdlmodule is
  Port ( CLKIN : in std_logic; 
         AN3 : inout std_logic;
         AN2 : inout std_logic;
         AN1 : inout std_logic;
         AN0 : inout std_logic;
         LED : out std_logic_vector(6 downto 0));
end POLY_3; --vhdlmodule;

architecture Behavioral of POLY_3  is    --vhdlmodule is

signal CTR          : STD_LOGIC_VECTOR(17 downto 0);
signal C            : STD_LOGIC_VECTOR(1 downto 0);
signal modulo10     : STD_LOGIC_VECTOR(3 downto 0);
signal modulo6      : STD_LOGIC_VECTOR(3 downto 0);
signal modulo10_2   : STD_LOGIC_VECTOR(3 downto 0);
signal modulo6_2    : STD_LOGIC_VECTOR(3 downto 0);
signal digit        : STD_LOGIC_VECTOR(3 downto 0);
signal h            :integer range 0 to 50000000 ;
signal h_sec        : STD_LOGIC;
signal ver_mod6     : STD_LOGIC;
signal h_minute     : STD_LOGIC;
signal ver_mod6_2   : STD_LOGIC;
signal h_heure      : STD_LOGIC;
begin		

	-----------------------------  une seconde -----------------
Process (clkin)
begin 
 if (clkin'event and clkin='1') 
 then 
   if ((h>=0) and (h<25000000))
	then
      h_sec<='0';
      h<=h+1;
   elsif ((h>=25000000) and (h<50000000 ))
	then 
	   h_sec<='1';
       h<=h+1;
      else
       h<= 0;
    end if;
 end if;
end Process; 
 -----------------------------  modulo 10  ---------------------------------
 Process (h_sec)
begin 
 if ( h_sec'event and h_sec ='1')
 then
   if (modulo10 = "1001")
   then 
     modulo10 <= "0000";
	  ver_mod6<='1';
    else 
      modulo10 <=modulo10+"0001";
      ver_mod6<='0';
    end if;
end if;	
end Process; 

 -----------------------------  modulo 06 ---------------------------------
 Process (ver_mod6)
begin 
 if ( ver_mod6'event and ver_mod6 ='1')
 then
   if (modulo6 = "0101")
   then 
     modulo6 <= "0000";
	  h_minute<='1';
    else 
      modulo6 <= modulo6+"0001";
      h_minute <='0';
    end if;
end if;	
end Process; 

 -----------------------------  modulo 10_2  ---------------------------------
 Process (h_minute)
begin 
 if ( h_minute'event and h_minute ='1')
 then
   if (modulo10_2 = "1001")
   then 
     modulo10_2 <= "0000";
	  ver_mod6_2<='1';
    else 
      modulo10_2 <=modulo10_2+"0001";
      ver_mod6_2<='0';
    end if;
end if;	
end Process; 

 -----------------------------  modulo 06 ---------------------------------
Process (ver_mod6_2)
begin 
 if ( ver_mod6_2'event and ver_mod6_2 ='1')
 then
   if (modulo6_2 = "0101")
   then 
     modulo6_2 <= "0000";
	  h_heure <='1';
    else 
      modulo6_2 <= modulo6+"0001";
      h_heure <='0';
    end if;
end if;	
end Process; 

---------------------------------   Refrachissement de l'affichage ----------
  Process (CLKIN)
     begin
       if CLKIN'event and CLKIN = '1' 
		  then
         if (CTR > "100000000000000000") 
			   then
				  CTR <= "000000000000000000";
		        C   <= C   + "01" ;
				else
 	           CTR  <= CTR + "000000000000000001";    
         end if;
      end if;			
  End Process;		

 -----------------------------  Choix de l'afficheurs  -----------------------------
 Process (C)		
	Begin	
	 case c is
		when "00" =>   digit <= Modulo10 ; AN0 <= '0'; AN1 <= '1'; AN2 <= '1';AN3 <= '1';		
		when "01" =>   digit <= Modulo6  ; AN0 <= '1'; AN1 <= '0'; AN2 <= '1';AN3 <= '1';
 		when "10" =>   digit <= Modulo10_2 ; AN0 <= '1'; AN1 <= '1'; AN2 <='0'; AN3 <= '1';
		when "11" =>   digit <= Modulo6_2  ; AN0 <= '1'; AN1 <= '1'; AN2 <='1'; AN3 <= '0';
		when others => digit <= "0000"   ; AN0 <='1';AN1 <='1';AN2 <='1';AN3 <= '1' ;
		end case ;
	End Process;

Process (modulo6)		
 Begin	
	  
	  case digit is
                          -- gfedcba
	   when "0000" => LED <= "1000000"; 		
	   when "0001" => LED <= "1111001"; 
 		when "0010" => LED <= "0100100"; 
		when "0011" => LED <= "0110000"; 
		when "0100" => LED <= "0011001"; 		
	   when "0101" => LED <= "0010010"; 
 		when "0110" => LED <= "0000010"; 
		when "0111" => LED <= "1111000"; 
		when "1000" => LED <= "0000000"; 		
	   when "1001" => LED <= "0010000"; 
		when others => LED <= "1111111" ;
		end case ;
 End Process;	


End Behavioral;

si vous pouvez me faire comprendre ce code
merci d'avance