entityarchitecture1.py

Created by arthur-candillon

Created on May 02, 2024

1.01 KB


Compteur binaire 6 bits à remise 
à zéro et validation de comptage 
synchrones.Ecrire lentité et 
larchitecture dun compteur 
binaire 7 6bits (de sortie count)
à remise à zéro (raz) synchrone 
active à 1. Le comptage est rendu
possible lorsque le signal enable
est actif et le compteur doit 
s'arrêter à son maximum: 
  
  entity counter is 
    Port ( clk : in STD_LOGIC; 
    raz : in STD_LOGIC; 
    enable : in STD_LOGIC; 
    count : out STD_LOGIC_VECTOR (5 downto 0)); 
  end counter; 
  architecture Behavioral of counter is 
    constant cntmax : std_logic_vector (5 downto 0):= "111111"; 
    signal cnt : std_logic_vector (5 downto 0); 
    begin 
      process (clk) 
      begin 
        if clk'event and clk='1'then 
          if raz='1' then 
            cnt <= ( others => '0'); 
          elsif enable = '1' then 
            if cnt < cntmax then 
              cnt <= cnt+1; 
            end if; 
          end if; 
        end if; 
end process; 
count <= cnt; 
end Behavioral;

During your visit to our site, NumWorks needs to install "cookies" or use other technologies to collect data about you in order to:

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.