Salut tout le monde, j'essaie de faire un compteur bcd 4 digits, et j'y arrive vraiment pas. je suis désespéré depuis des heures que j'essaie.
Aidez moi à corriger mon programme s'il vous plait.....
--------------------------------------------------------------
-- declaration et utilisation des bibliotheques necessaires --
--------------------------------------------------------------
LIBRARY altera;
USE altera.maxplus2.all;
LIBRARY ieee;
USE ieee.std_logic_1164.all;
Use ieee.numeric_std.all;
Use ieee.std_logic_unsigned.all;
--------------------------------------------------------------------------
-- declaration de l'entite compteur_bcd et de ses ports d'entree-sortie --
--------------------------------------------------------------------------
entity Compteur_bcd is
PORT (
araz, CK, en : in std_logic;
mille, cent, diz, unite : out std_logic_vector (3 downto 0));
end Compteur_bcd;
--------------------------------------------------
-- architecture du programme, structure interne --
--------------------------------------------------
architecture DESCRIPTION of Compteur_bcd is
signal mille, cent, diz, unite : std_logic_vector (3 downto 0);
begin
process (CK)
begin
if araz ='1' then
mille <= (others=>'0');
cent <= (others=>'0');
diz <= (others=>'0');
unite <= (others=>'0');
elsif en = '0' then
mille <= mille;
cent <= cent;
diz <= diz;
unite <= unite;
if (CK ='1' and CK'event') then
if (unite < 9) then
unite <= unite + 1;
else
unite <= (others=>'0');
if (diz < 9) then
diz <= diz + 1 ;
else
diz <= (others=>'0');
if (cent < 9) then
cent <= cent + 1 ;
else
cent <= (others=>'0');
if (mille < 9) then
mille <= mille + 1 ;
else
mille <= (others=>'0');
end if;
end if;
end if;
end if;
end if;
end if;
end process;
end DESCRIPTION;
Projet VHDL
Modérateur : Modérateur