-- Fichier : compteur4_a2.vhd -- Société : ENSERB -- Auteur : P.Nouel -- Date de création : 7-6-96 ------------------------------------------------------------------------------ -- Utilisation de l'instruction GENERATE -- Description structurelle d'un compteur 4 bits -- Les équations determinent le modulo ------------------------------------------------------------------------------ ARCHITECTURE structure2 OF compteur4 IS SIGNAL d, s , sb : BIT_VECTOR( 3 DOWNTO 0); SIGNAL ra1 : BIT; COMPONENT bascule PORT ( h, d ,raz, ra1 : IN BIT; s, sb : OUT BIT); END COMPONENT; COMPONENT calcul PORT ( s, sb : IN BIT_VECTOR( 3 DOWNTO 0); compter : IN BIT; d : OUT BIT_VECTOR( 3 DOWNTO 0); plein : OUT BIT); END COMPONENT; -- FOR ALL : bascule USE ENTITY WORK.bascule_d(rtl); -- FOR ALL : calcul USE ENTITY WORK.equations(par_10); BEGIN ra1 <= '0'; implant : FOR i IN 0 TO 3 GENERATE b : bascule PORT MAP (h, d(i), raz, ra1, s(i), sb(i)); END GENERATE; combi : calcul PORT MAP ( s, sb, compter, d, plein); sortie <= s; END structure2; ------------------------------------------------------------------------------