Last active
December 2, 2017 03:48
-
-
Save rescurib/f8ff24c7b54dfaf38493cb4e5c0a8202 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
library ieee; | |
use ieee.std_logic_1164.all; | |
USE IEEE.numeric_std.ALL; | |
entity divisor is | |
port ( pulso : inout std_logic:='0'; | |
clk : in std_logic); | |
end entity; | |
architecture div of divisor is | |
signal count : integer :=1; | |
begin | |
process(clk) begin | |
if(clk'event and clk='1') then | |
count <=count+1; | |
if(count = 25000000) then --count = frec de reloj/frec deseada | |
PULSO <= not PULSO; | |
count <=1; | |
end if; | |
end if; | |
end process; | |
end architecture; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment