Advertisement
Guest User

Untitled

a guest
Mar 24th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. process (clk,reset)
  2. begin
  3. if (reset = '1') then
  4. S <= "000";
  5. end if;
  6.  
  7. if (clk'event and clk='1') then
  8. S <= Nst;
  9. end if;
  10.  
  11. end process;
  12.  
  13. Ano(1) <= not S(2);
  14. Ano(0) <= not(Ano(1));
  15.  
  16. sseg(2) <= Ano(1);
  17. sseg(3) <= Ano(1);
  18. sseg(4) <= Ano(1);
  19.  
  20. sseg(0) <= '0';
  21.  
  22. sseg(1) <= Ano(0);
  23. sseg(5) <= Ano(0);
  24. sseg(6) <= Ano(0);
  25.  
  26.  
  27.  
  28. Nst <= std_logic_vector(unsigned(S)+1) when cw = '1' else
  29. std_logic_vector(unsigned(S)-1);
  30.  
  31. an <= "0111" when S = "000" or S = "111" else
  32. "1011" when S = "001" or S = "110" else
  33. "1101" when S = "010" or S = "101" else
  34. "1110";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement