Advertisement
Guest User

Untitled

a guest
Mar 22nd, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VHDL 0.67 KB | None | 0 0
  1. architecture RingCounter of Counter is
  2. signal count : unsigned(7 downto 0);
  3. begin
  4. process(reset, Clock)
  5. begin
  6.     if reset = '1' then
  7.         count <= "00000000";
  8.     else if rising_edge(Clock) then
  9.         if Enable = '1' then
  10.             if Load = '1' then
  11.                 count <= unsigned(Data);
  12.             else if UpOn = '1' then
  13.                 if count = "00000000" or count = "10000000" then
  14.                     count <= "00000001";
  15.                 else
  16.                     count <= count(6 downto 0Ã) & '0';
  17.                 end if;
  18.             else if upDn = '0' then
  19.                 if (count = "00000000" or count "00000001" then
  20.                     count <= "10000000";
  21.                 else
  22.                     count <= '0' & count(7 downto 1);
  23.                 end if;
  24.             end if;
  25.         end if;
  26.     end if;
  27.  
  28. end process
  29. end architecture;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement