Professional Documents
Culture Documents
Lgica
de
begin
process (reset,clk)
begin
1 INTRODUCCIN
end process;
2 DESARROLLO
2.1 CODIGO
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity maq is
Port ( clk : in STD_LOGIC;
reset : in STD_LOGIC;
A : in STD_LOGIC;
B : in STD_LOGIC;
Rojo : out STD_LOGIC;
.
end if;
end if;
when St3 =>
if (A= '0') then
if(B = '0') then
Es <= St0;
Aux
<=
Entrada + '1';
Entrada <=
Aux;
else
Es <= St3;
end if;
else
if (B = '1') then es <=
St0;
else Es <= St0;
end if;
end if;
when St4 =>
if (A = '1') then
if(B = '1') then
Es <= St5;
else Es <= St4;
end if;
else Es <= St4;
end if;
when St5 =>
if (A = '1') then
if (B = '0') then
Es <= St6;
else Es <= St5;
end if;
else Es <= St5;
end if;
when St6 =>
if (A = '1') then
if(B = '0') then
Es <= St0;
Aux
<=
Entrada - '1';
Entrada <=
Aux;
else Es <= St6;
end if;
else Es <= St6;
end if;
end case;
end process;
Show: process(Entrada)
begin
case (Entrada) is
when "000000" =>
output1 <= "0111111";
output2 <= "0111111";--0
when "000001" =>
output1 <= "0111111";
output2 <= "0000110";--1
when "000010" =>
output1 <= "0111111";
output2 <= "1011011";--2
when "000011" =>
output1 <= "0111111";
.
when "011001" =>
output1 <= "1011011";
output2 <= "1101101";--25
when "011010" =>
output1 <= "1011011";
output2 <= "1111101";--26
when "011011" =>
output1 <= "1011011";
output2 <= "0000111";--27
when "011100" =>
output1 <= "1011011";
output2 <= "1111111";--28
when "011101" =>
output1 <= "1011011";
output2 <= "1100111";--29
when "011110" =>
output1 <= "1001111";
output2 <= "0111111";--30
when "011111" =>
output1 <= "1001111";
output2 <= "0000110";--31
when "100000" =>
output1 <= "1001111";
output2 <= "1011011";--32
when "100001" =>
output1 <= "1001111";
output2 <= "1001111";--33
when "100010" =>
output1 <= "1001111";
output2 <= "1100110";--34
when "100011" =>
output1 <= "1001111";
output2 <= "1101101";--35
when "100100" =>
output1 <= "1001111";
output2 <= "1111101";--36
when "100101" =>
output1 <= "1001111";
output2 <= "0000111";--37
when "100110" =>
output1 <= "1001111";
output2 <= "1111111";--38
when "100111" =>
output1 <= "1001111";
output2 <= "1100111";--39
when "101000" =>
output1 <= "1100110";
output2 <= "0111111";--40
when "101001" =>
output1 <= "1100110";
output2 <= "0000110";--41
when "101010" =>
output1 <= "1100110";
output2 <= "1011011";--42
when "101011" =>
output1 <= "1100110";
output2 <= "1001111";--43
when "101100" =>
output1 <= "1100110";
output2 <= "1100110";--44
when "101101" =>
output1 <= "1100110";
output2 <= "1101101";--45
when others =>
output1
<=
"0111110";
--Muestra U (Undefined)
output2 <= "0111110";
end case;
end process;
Semaforo: process(Entrada)
begin
if(Entrada = "101101") then
Rojo <= '1';
Verde <= '0';
else
Rojo <= '0';
Verde <= '1';
end if;
end process;
process(clk, reset)
begin
if reset = '1' then
Ep <= St0;
elsif rising_edge(clk) then
Ep <= Es; -- transition on
clock
end if;
end process;
end Behavioral;
En el inicio del cdigo se observa claramente la
lgica de estado siguiente, esta es la que nos indica,
como su nombre lo dice, el estado siguiente de la
maquina segn las condiciones del sistema. Despus
encontramos el decodificador para mostrar el nmero de
autos dentro del parqueadero. Tenemos dos salidas
(Output1, Output2), cada una de ellos para uno de los 2
siete segmentos en los cuales mostraremos el nmero
de autos. Adelante encontramos el proceso en el cual se
controla el semforo. Finalmente el proceso que controla
el estado actual del sistema.
AQU VA EL DIAGRAMA!
3 CONCLUSIONES
Como principal conclusin tenemos que un
sistema digital es bastante til al momento de tener que
resolver algn problema.
Tambin
concluimos
que
un
sistema
desarrollado de manera secuencial es ms efectivo y
menos engorroso que un sistema combinacional, pero
no se tiene total control de las seales.