Skip to content

Instantly share code, notes, and snippets.

@rescurib
Last active December 2, 2017 03:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rescurib/f8ff24c7b54dfaf38493cb4e5c0a8202 to your computer and use it in GitHub Desktop.
Save rescurib/f8ff24c7b54dfaf38493cb4e5c0a8202 to your computer and use it in GitHub Desktop.
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