Advertisement
Guest User

Untitled

a guest
Dec 9th, 2019
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VHDL 1.42 KB | None | 0 0
  1. library ieee;
  2. use ieee.std_logic_1164.all;
  3. use ieee.std_logic_unsigned.all;
  4.  
  5. entity sekvkola is
  6.     port(
  7.         iCLK : in std_logic;
  8.         iRST : in std_logic;
  9.         iGO : in std_logic;
  10.         iSTOP : in std_logic;
  11.         oMUXROW : out std_logic_vector(1 downto 0);
  12.         o7SEGM : out std_logic_vector(6 downto 0)
  13.     );
  14. end entity;
  15.  
  16. architecture Behavioral of sekvkola is
  17.     signal sTC: std_logic;
  18.     signal sTCJed : std_logic;
  19.     signal sCNT1S : std_logic_vector (23 downto 0);
  20.     signal sCNTJED : std_logic_vector (3 downto 0);
  21.     signal sCNTDES : std_logic_vector (3 downto 0);
  22.     signal s7SEGM : std_logic_vector (3 downto 0);
  23.     signal sSTANJE : std_logic;
  24.    
  25. begin
  26.    
  27.     --Kontrola sistema pomocu signala pokretanja i signala zaustavljanja
  28.    
  29.     process (iCLK, iRST) begin
  30.         if(iRST = '1') then
  31.             sSTANJE <= '0';
  32.        
  33.         elsif(iCLK'event and iCLK = '1') then
  34.            
  35.             if(iSTOP = '1' and iGO = '0') then
  36.                 sSTANJE <= '0';
  37.            
  38.             elsif(iSTOP = '0' and iGO = '1') then
  39.                 sSTANJE <= '1';
  40.            
  41.             else
  42.                 sSTANJE <= sSTANJE;
  43.            
  44.             end if;
  45.         end if;
  46.     end process;
  47.  
  48.     --Odredjivanje takta rada
  49.     process(iCLK, iRST) begin
  50.         if(iRST = '1') then
  51.             sCNT1s <= (others => '0');
  52.        
  53.         elsif(iCLK'event and iCLK = '1') then
  54.            
  55.             if(sCNT1S > "101101110001101011111111")then
  56.                 sCNT1S <= (others => '0');
  57.            
  58.             else
  59.                
  60.                 if(sSTANJE = '1') then
  61.                     sCNT1S <= sCNT1S + '1';
  62.                
  63.                 else
  64.                     sCNT1S <= sCNT1S;
  65.                
  66.                 end if;
  67.            
  68.             end if;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement