compteurbinaire4bitsàremiseàzéroasynchroneetvalidationdecomptagesynchroneetretenue.Ecrirel'entité et l'architectured'un compteur décimal 4 bits (de sortie
count) à remise à zéro (raz) asynchrone active à 1. Le comptage est rendu
possible lorsque le signal enable est actif.
Un signal de sortie carry (à traiter) permet le chaînage de plusieurs compteurs
élémentaires pour la réalisation d'uncompteurmultidigitscommesurleschémacomplet.entitycounterisPort (clk:inSTD_LOGIC;raz:inSTD_LOGIC;enable:inSTD_LOGIC;count:outSTD_LOGIC_VECTOR (3downto0);carry:outSTD_LOGIC);endcounter;architectureBehavioralofcounterisconstantcntmax:std_logic_vector (3downto0):="1001";signalcnt:std_logic_vector (3downto0);beginprocess (clk,raz)beginifraz='1'thencnt<=(others=>'0');elsifclk'event and clk='1' then
if enable = '1' then
if cnt < cntmax then
cnt <= cnt+1;
else
cnt <= ( others => '0');
end if;
end if;
end if;
end process;
count <= cnt;
carry <= '0' when cnt<cntmax else '1';
end Behavioral;
*******************************
multiplexeur de signaux mux4_4.
Ecrire l’entité et l’architecture du composant mux4_4 utilisé sur le schéma.
Le vecteur de sortie dépendra dela valeur du vecteur de commande.
entity mux4_4 is
Port ( cde : in STD_LOGIC_VECTOR (1 downto 0);
in_0 : in STD_LOGIC_VECTOR (3 downto 0);
in_1 : in STD_LOGIC_VECTOR (3 downto 0);
in_2 : in STD_LOGIC_VECTOR (3 downto 0);
in_3 : in STD_LOGIC_VECTOR (3 downto 0);
mux_out : out STD_LOGIC_VECTOR (3 downto 0));
end mux4_4;
architecture Behavioral of mux4_4 is
begin
with cde select
mux_out <= in_0 when "00",
in_1 when "01",
in_2 when "10",
in_3 when "11",
"1111" when others;
end Behavioral;
*******************************
regroupement de compteurs en VHDL.
Ecrire le code VHDL (entité et architecture) d'uncompteurde0à999regroupantles3compteursduschémaavecleursinterconnexions.Vousdéclarerezlessignauxnécessairesaucâblageinterne.Onsupposeraqu’unebibliothèqueapermisladéclarationducomposantcounter (nepasledéclarerjustel'instancier)
entity counter_0_999 is
Port ( clk : in STD_LOGIC;
raz : in STD_LOGIC;
enable : in STD_LOGIC;
count_u, count_d, count_c,: out STD_LOGIC_VECTOR (3 downto 0);
carry : out STD_LOGIC);
end counter_0_999 ;
architecture arch of counter_0_999 is
signal carry_u, carry_d : std_logic;
begin
C1: counter port map(clk ,raz, enable, count_u , carry_u);
C2: counter port map(clk ,raz, carry_u, count_d , carry_d);
C3: counter port map(clk ,raz, carry_d, count_c, carry );
end;
*******************************
en considérant le codage de la machine et en cas de parasite un blocage est
possible.Pourquoi ?
Le codage de la machine nécessite 3 bits (6 possibiliés) hors seules 5 sont
identifiées,si la machine tombe dans le 6ème état, rien n'estpévupourensortir.Proposersurlecodefourniunemodificationpermettantd'éviter ce blocage.
A la fin de l'instructioncase,ilsuffitd'ajouter les 2 lignes suivantes :
when others => -- trap state
Sreg0 <= coherence;
During your visit to our site, NumWorks needs to install "cookies" or use other technologies to collect data about you in order to:
Ensure the proper functioning of the site (essential cookies); and
Track your browsing to send you personalized communications if you have created a professional account on the site and can be contacted (audience measurement cookies).
With the exception of Cookies essential to the operation of the site, NumWorks leaves you the choice: you can accept Cookies for audience measurement by clicking on the "Accept and continue" button, or refuse these Cookies by clicking on the "Continue without accepting" button or by continuing your browsing. You can update your choice at any time by clicking on the link "Manage my cookies" at the bottom of the page. For more information, please consult our cookies policy.