Created
November 20, 2013 21:36
-
-
Save Atlantic777/7571515 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- uključiti ovu biblioteku | |
use IEEE.STD_LOGIC_UNSIGNED.ALL | |
-- dodati ovaj interni signal | |
signal sCOUNTER : STD_LOGIC_VECTOR (7 downto 0); | |
signal sSECONDS : STD_LOGIC_VECTOR (7 downto 0); | |
process (iCLK) begin | |
if(iCLK'event and iCLK = '1') then | |
if(inRST = '0') then | |
sCOUNTER <= "00000000"; | |
elsif (sCOUNTER = "00001011") then | |
sCOUNTER <= "00000000"; | |
sTC <= '1'; | |
else | |
sCOUNTER <= sCOUNTER + 1; | |
sTC <= '0'; | |
end if | |
end if; | |
end process; | |
process(iCLK) begin | |
if(iCLK'event and iCLK = '1') then | |
if(inRST = '0') then | |
sSECONDS <= "00000000"; | |
elsif (sTC = '1') then | |
sSECONDS <= sSECONDS + 1; | |
end if; | |
end if; | |
end process; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment