Professional Documents
Culture Documents
Divisores de frecuencia
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity divi151 is
Port (reloj : in STD_LOGIC;
clk : out STD_LOGIC);
end divi151;
architecture Behavioral of divi151 is
Begin
process (reloj)
variable cuenta: std_logic_vector(27 downto 0):=X"0000000";
begin
if rising_edge (reloj) then --hay un flanco de subida?
if cuenta=X"48009E0" then -- si cuenta es igual a 75500000?
cuenta:=X"0000000"; --entonces cuenta es igual 0
else --si no
cuenta:=cuenta+1; --cuenta= cuenta +1
end if;
end if;
clk <= cuenta(26); --sacamos sobre "clk" el valor del bit 26
end process;
end Behavioral;
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
ENTITY divi1seg IS
PORT (
Clk50Mhz: IN STD_LOGIC;
BEGIN
PROCESS
BEGIN
WAIT UNTIL Clk50Mhz'EVENT and Clk50Mhz = '1';
IF count < max THEN count <= count + 1;
ELSE count <= 0;
END IF;
IF count < half THEN Clk <= '0';
ELSE Clk <= '1';
END IF;
END PROCESS;
END Div;
Divisor de frecuencias
a 1 seg y Dc 50%
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity clk200Hz is
Generic ( limite : integer := 124999);
Port ( entrada: in STD_LOGIC;
reset : in STD_LOGIC;
salida : out STD_LOGIC );
end clk200Hz;
Divisor de frecuencia a
200HZ y DC 50%
Practica 8
Construir un divisor de
frecuencias variable para
ciclos de trabajo:
25%
50%
75%
88%
y una frecuencia de 3
Segundos, cargarla en las
tarjeta Spartan