Advertisement
ForcaDz

clk10

Oct 23rd, 2023
636
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VHDL 0.76 KB | None | 0 0
  1. library IEEE;
  2. use IEEE.STD_LOGIC_1164.ALL;
  3. use IEEE.STD_LOGIC_UNSIGNED.ALL;
  4.  
  5. entity ClkDivMC is
  6.     Port (
  7.         Clk100, Reset: in std_logic;
  8.         Clk10: out std_logic
  9.     );
  10. end ClkDivMC;
  11.  
  12. architecture archi of ClkDivMC is
  13.     signal cpt : std_logic_vector(3 downto 0) := "0000";
  14.     signal ClkDiviseur : std_logic := '0';
  15.  
  16. begin
  17.     process (Clk100, Reset)
  18.     begin
  19.         if Reset = '0' then
  20.             cpt <= "0000";
  21.             ClkDiviseur <= '0';
  22.         elsif rising_edge(Clk100) then
  23.             if cpt = 4 then
  24.                 cpt <= "0000";
  25.                 ClkDiviseur <= not ClkDiviseur;
  26.             else
  27.                 cpt <= cpt + 1;
  28.             end if;
  29.         end if;
  30.     end process;
  31.  
  32.     Clk10 <= ClkDivider;
  33. end archi;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement