Académique Documents
Professionnel Documents
Culture Documents
Chenillard
KEY(2)
SW(2 à 5)
Sortie
LEDG,LEDR,HEX
KEY(0)
SW(0 et 1)
Clock
Ordre 2 :
Bassa Najim Mistral Thomas Gr2A
-Mode 4 : les LEDs rouges suivent le mode 2, pendant que les LEDs
vertes s’allument de la 7 à la 0 puis de la 0 à la 7…
-Mode 7 : les afficheurs s’allument les uns après les autres en suivant le
cycle segment a puis b, puis c…
Programme :
Fréquence :
PROCESS(CLOCK_50(0))
BEGIN
if rising_edge(CLOCK_50(0)) then
if divi1 = 50000000 then divi1 <="00000000000000000000000000";
else divi1 <= divi1+1;
if divi1 < 25000000 then clock1Hz(0) <= '1';
else clock1Hz(0) <= '0';
if KEY(2)='1' then divi1 <= "00000000000000000000000000";
end if;
end if;
end if;
end if;
END PROCESS;
PROCESS(CLOCK_50(0))
BEGIN
if rising_edge(CLOCK_50(0)) then
if divi2 = 25000000 then divi2 <="00000000000000000000000000";
else divi2 <= divi2+1;
if divi2 < 12500000 then clock2Hz(0) <= '1';
else clock2Hz(0) <= '0';
end if;
end if;
end if;
END PROCESS;
PROCESS(CLOCK_50(0))
BEGIN
if rising_edge(CLOCK_50(0)) then
if divi3 = 10000000 then divi3 <="00000000000000000000000000";
else divi3 <= divi3+1;
if divi3 < 2500000 then clock5Hz(0) <= '1';
else clock5Hz(0) <= '0';
end if;
end if;
end if;
END PROCESS;
PROCESS(CLOCK_50(0))
BEGIN
if rising_edge(CLOCK_50(0)) then
if divi4 = 5000000 then divi4 <="00000000000000000000000000";
else divi4 <= divi3+1;
Bassa Najim Mistral Thomas Gr2A
PROCESS(CLOCK_50(0))
BEGIN
if rising_edge(CLOCK_50(0)) then
if SW = "00" then
clockAll(0)<=clock1Hz(0); else
if SW = "01" then
clockAll(0)<=clock2Hz(0); else
if SW = "10" then
clockAll(0)<=clock5Hz(0); else
if SW = "11" then
clockAll(0)<=clock10Hz(0);
end if;
end if;
end if;
end if;
end if;
END PROCESS;
RAZ :
PROCESS (clockAll(0))
begin
if KEY(2)='0' then x<="000";
elsIF rising_edge(clockAll(0)) THEN
IF x = 8 THEN x <= "000";
ELSE x <= x + 1;
end if;
end if;
end process;
Marche / Arrêt :
if SW(9)='1' then
LEDR <= "00000000";
LEDG <= "00000000";
HEX0 <= "1111111";
HEX1 <= "1111111";
HEX2 <= "1111111";
HEX3 <= "1111111";
end if;
Bassa Najim Mistral Thomas Gr2A
Pause :
if Key(0)='0' then x2 <= x2;
Mode 1 :
if SW(5)= '0' and SW(4)= '0' and SW(3)= '0' and SW(2)= '1' and
SW(9)='0' then
CASE x IS
WHEN "000"=> LEDR <= "00000001";
WHEN "001"=> LEDR <= "00000010";
WHEN "010"=> LEDR <= "00000100";
WHEN "011"=> LEDR <= "00001000";
WHEN "100"=> LEDR <= "00010000";
WHEN "101"=> LEDR <= "00100000";
WHEN "110"=> LEDR <= "01000000";
WHEN "111"=> LEDR <= "10000000";
WHEN OTHERS=> LEDR <="00000001";
end case;
end if;
Mode 2 :
if SW(5)= '0' and SW(4)= '0' and SW(3)= '1' and SW(2)= '0' and
SW(9)='0' then
CASE x1 IS
WHEN "0001"=> LEDR <= "00000001";
WHEN "0010"=> LEDR <= "00000010";
WHEN "0011"=> LEDR <= "00000100";
WHEN "0100"=> LEDR <= "00001000";
WHEN "0101"=> LEDR <= "00010000";
WHEN "0110"=> LEDR <= "00100000";
WHEN "0111"=> LEDR <= "01000000";
WHEN "1000"=> LEDR <= "10000000";
WHEN "1001"=> LEDR <= "01000000";
WHEN "1010"=> LEDR <= "00100000";
WHEN "1011"=> LEDR <= "00010000";
WHEN "1100"=> LEDR <= "00001000";
WHEN "1101"=> LEDR <= "00000100";
WHEN "1110"=> LEDR <= "00000010";
WHEN "1111"=> LEDR <= "00000001";
WHEN OTHERS=> LEDR <= "00000000";
end case;
end if;
Bassa Najim Mistral Thomas Gr2A
Mode 3 :
if SW(5)= '0' and SW(4)= '0' and SW(3)= '1' and SW(2)= '1' and
SW(9)='0' then
CASE x IS
CASE x IS
Mode 4 :
if SW(5)= '0' and SW(4)= '1' and SW(3)= '0' and SW(2)= '0' and
SW(9)='0' then
CASE x1 IS
end case;
CASE x1 IS
Mode 5 :
process(x(0))
begin
CASE x IS
WHEN "000"=> HEX0 <= "1111110";
WHEN "001"=> HEX0 <= "1111101";
WHEN "010"=> HEX0 <= "1111011";
WHEN "011"=> HEX0 <= "1110111";
WHEN "100"=> HEX0 <= "1101111";
WHEN "101"=> HEX0 <= "1011111";
WHEN "110"=> HEX0 <= "0111111";
WHEN "111"=> HEX0 <= "1111110";
WHEN OTHERS=> HEX0 <= "0000000";
end case;
end process;
end abcd;
Mode 6 :
process(x(0))
begin
CASE x IS
WHEN "000"=> HEX0 <= "1111110";
WHEN "001"=> HEX0 <= "1111101";
WHEN "010"=> HEX0 <= "1111011";
WHEN "011"=> HEX0 <= "1110111";
Bassa Najim Mistral Thomas Gr2A
process(x(0))
begin
CASE x IS
WHEN "000"=> HEX1 <= "1111110";
WHEN "001"=> HEX1 <= "1111101";
WHEN "010"=> HEX1 <= "1111011";
WHEN "011"=> HEX1 <= "1110111";
WHEN "100"=> HEX1 <= "1101111";
WHEN "101"=> HEX1 <= "1011111";
WHEN "110"=> HEX1 <= "0111111";
WHEN "111"=> HEX1 <= "1111110";
WHEN OTHERS=> HEX1 <= "0000000";
end case;
end process;
process(x(0))
begin
CASE x IS
WHEN "000"=> HEX2 <= "1111110";
WHEN "001"=> HEX2 <= "1111101";
WHEN "010"=> HEX2 <= "1111011";
WHEN "011"=> HEX2 <= "1110111";
WHEN "100"=> HEX2 <= "1101111";
WHEN "101"=> HEX2 <= "1011111";
WHEN "110"=> HEX2 <= "0111111";
WHEN "111"=> HEX2 <= "1111110";
WHEN OTHERS=> HEX2 <= "0000000";
end case;
end process;
process(x(0))
begin
CASE x IS
WHEN "000"=> HEX3 <= "1111110";
WHEN "001"=> HEX3 <= "1111101";
WHEN "010"=> HEX3 <= "1111011";
WHEN "011"=> HEX3 <= "1110111";
WHEN "100"=> HEX3 <= "1101111";
WHEN "101"=> HEX3 <= "1011111";
WHEN "110"=> HEX3 <= "0111111";
WHEN "111"=> HEX3 <= "1111110";
WHEN OTHERS=> HEX3 <= "0000000";
end case;
Bassa Najim Mistral Thomas Gr2A
end process;
end abcdefghij;
Mode 7 :
process(x(0))
begin
CASE x IS
WHEN "00000"=> HEX0 <= "11111110";
WHEN "00001"=> HEX0 <= "11111101";
WHEN "00010"=> HEX0 <= "11111011";
WHEN "00011"=> HEX0 <= "11110111";
WHEN "00100"=> HEX0 <= "11101111";
WHEN "00101"=> HEX0 <= "11011111";
WHEN "00110"=> HEX0 <= "10111111";
WHEN "00111"=> HEX0 <= "01111111";
end case;
end process;
process(x(0))
begin
CASE x IS
WHEN "01000"=> HEX1 <= "11111110";
WHEN "01001"=> HEX1 <= "11111101";
WHEN "01010"=> HEX1 <= "11111011";
WHEN "01011"=> HEX1 <= "11110111";
WHEN "01100"=> HEX1 <= "11101111";
WHEN "01101"=> HEX1 <= "11011111";
WHEN "01110"=> HEX1 <= "10111111";
WHEN "01111"=> HEX1 <= "01111111";
end case;
end process;
process(x(0))
begin
CASE x IS
WHEN "10000"=> HEX2 <= "11111110";
WHEN "10001"=> HEX2 <= "11111101";
WHEN "10010"=> HEX2 <= "11111011";
WHEN "10011"=> HEX2 <= "11110111";
WHEN "10100"=> HEX2 <= "11101111";
WHEN "10101"=> HEX2 <= "11011111";
WHEN "10110"=> HEX2 <= "10111111";
WHEN "10111"=> HEX2 <= "01111111";
end case;
end process;
process(x(0))
begin
CASE x IS
WHEN "11000"=> HEX3 <= "11111110";
Bassa Najim Mistral Thomas Gr2A
end case;
end process;
end abcdefghij;
Mode 8 :
process(x(0))
begin
CASE x IS
WHEN "0"=> HEX0 <= "1111111";
WHEN "1"=> HEX0 <= "0100100";
WHEN OTHERS=> HEX0 <= "1111111";
end case;
end process;
process(x(0))
begin
CASE x IS
WHEN "0"=> HEX1 <= "1111111";
WHEN "1"=> HEX1 <= "0100100";
WHEN OTHERS=> HEX1 <= "1111111";
end case;
end process;
process(x(0))
begin
CASE x IS
WHEN "0"=> HEX2 <= "1111111";
WHEN "1"=> HEX2 <= "1000000";
WHEN OTHERS=> HEX2 <= "1111111";
end case;
end process;
process(x(0))
begin
Bassa Najim Mistral Thomas Gr2A
CASE x IS
WHEN "0"=> HEX3 <= "1111111";
WHEN "1"=> HEX3 <= "0100100";
WHEN OTHERS=> HEX3 <= "1111111";
end case;
end process;
end yuip;
Mode 9 :
CASE x IS
WHEN "0"=> HEX0 <= "1111111";
WHEN "1"=> HEX0 <= "0100100";
WHEN OTHERS=> HEX0 <= "1111111";
end case;
end process;
process(x(0))
begin
CASE x IS
WHEN "0"=> HEX1 <= "1111111";
WHEN "1"=> HEX1 <= "0100100";
WHEN OTHERS=> HEX1 <= "1111111";
end case;
end process;
process(x(0))
begin
CASE x IS
WHEN "0"=> HEX3 <= "1111111";
WHEN "1"=> HEX3 <= "1000000";
WHEN OTHERS=> HEX3 <= "1111111";
end case;
end process;
process(x(0))
begin
CASE x IS
WHEN "0"=> HEX2 <= "1111111";
Bassa Najim Mistral Thomas Gr2A
process(z(0))
begin
CASE z IS
WHEN "0000"=> LEDR <= "00000000";
WHEN "0001"=> LEDR <= "00000001";
WHEN "0010"=> LEDR <= "00000010";
WHEN "0011"=> LEDR <= "00000100";
WHEN "0100"=> LEDR <= "00001000";
WHEN "0101"=> LEDR <= "00010000";
WHEN "0110"=> LEDR <= "00100000";
WHEN "0111"=> LEDR <= "01000000";
WHEN "1000"=> LEDR <= "10000000";
WHEN "1001"=> LEDR <= "01000000";
WHEN "1010"=> LEDR <= "00100000";
WHEN "1011"=> LEDR <= "00010000";
WHEN "1100"=> LEDR <= "00001000";
WHEN "1101"=> LEDR <= "00000100";
WHEN "1110"=> LEDR <= "00000010";
WHEN "1111"=> LEDR <= "00000001";
WHEN OTHERS=> LEDR <= "00000000";
end case;
end process;
process(z(0))
begin
CASE z IS
Mode 10 :
CASE x0 IS
WHEN "1" => HEX2 <= "1000000";
WHEN "0" => HEX2 <= "1111111";
WHEN OTHERS => HEX2 <= "1111111";
END CASE;
CASE x0 IS
WHEN "1" => HEX1 <= "0010000";
WHEN "0" => HEX1 <= "1111111";
WHEN OTHERS => HEX1 <= "1111111";
END CASE;
CASE x0 IS
WHEN "1" => HEX0 <= "0011001";
WHEN "0" => HEX0 <= "1111111";
WHEN OTHERS => HEX0 <= "1111111";
END CASE;
CASE x1 IS
WHEN "0000"=> LEDR <= "00000001";
WHEN "0001"=> LEDR <= "00000100";
WHEN "0010"=> LEDR <= "00010000";
WHEN "0011"=> LEDR <= "00001000";
WHEN "0100"=> LEDR <= "01000000";
WHEN "0101"=> LEDR <= "00010000";
WHEN "0110"=> LEDR <= "00100110";
WHEN "0111"=> LEDR <= "01010100";
WHEN "1000"=> LEDR <= "10100010";
WHEN "1001"=> LEDR <= "01001001";
WHEN "1010"=> LEDR <= "00100110";
WHEN "1011"=> LEDR <= "01000100";
WHEN "1100"=> LEDR <= "00001000";
WHEN "1101"=> LEDR <= "10101010";
WHEN "1110"=> LEDR <= "01010101";
WHEN "1111"=> LEDR <= "11110000";
WHEN OTHERS=> LEDR <= "00000000";
end case;
CASE x1 IS
Conclusion,
Pour conclure, notre projet n’a pas fonctionné à 100%.
Tous les modes fonctionnent ainsi que le RAZ, Marche/Arrêt et Pause mais la
fonction du choix des vitesses n’a pas marché, on pense que cela vient du
programme ou l’on associe la fréquence au SW(0 et 1).