Professional Documents
Culture Documents
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
v: out std_logic_vector(1 downto 0); --"w" señal para decir que esta cerrado
f: out std_logic);
end puertas;
begin
begin
case Qp is
Qs <="0000";
end case;
begin
if ( w = '1') then
Qp<= "0000";
Qp <= Qs;
end if;
end ejem;
_______________________________________________________________________
Divisor de frecuencia (falta acomodar reset)
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity divisor is
port (
clk_in: in std_logic;
reset: in std_logic;
);
end divisor;
begin
temporal<='0';
counter <= 0;
temporal<= NOT(temporal);
counter<= 0;
else
counter<= counter+1;
end if;
end if;
end process;
clk_out<= temporal;
end behavioral;
______________________________________________________________________________
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
clk,p: in std_logic;
s: out std_logic
);
end motores;
begin
case Qp is
Qs <= "0000";
Qs <= "0011";
Qs <= "0110";
Qs <= "0111";
end if;
s <= '0';
Qs <= "0001";
Qs <= "1000";
Qs <= "0100";
Qs <= "0111";
end if;
exh <= "00";
s <= '0';
Qs <= "0010";
Qs <= "1000";
Qs <= "0101";
Qs <= "0101";
end if;
s <= '0';
Qs <= "0011";
Qs <= "1011";
Qs <= "0011";
Qs <= "0011";
end if;
s <= '0';
Qs <= "0100";
Qs <= "0100";
Qs <= "1011";
Qs <= "0100";
end if;
s <= '0';
Qs <= "0101";
Qs <= "0101";
Qs <= "0101";
end if;
s <= '0';
Qs <= "0110";
Qs <= "0110";
Qs <= "1011";
Qs <= "0110";
end if;
s <= '0';
Qs <= "0111";
Qs <= "0111";
Qs <= "0111";
elsif (slide = "100") then
Qs <= "1010";
end if;
s <= '0';
Qs <= "1000";
Qs <= "1010";
Qs <= "1000";
Qs <= "1000";
end if;
s <= '0';
Qs <= "1001";
Qs <= "1001";
Qs <= "1001";
end if;
s <= '0';
Qs <= "1011";
Qs <= "1011";
Qs <= "1011";
Qs <= "1011";
end if;
s <= '0';
Qs <= "1100";
s <= '1';
Qs <= "1100";
Qs <= "1100";
Qs <= "0000";
Qs <= "0001";
Qs <= "0010";
end if;
end if;
s <= '0';
Qs <= "0000";
end case;
begin
Qp <= Qs;
end if;
end función;