You are on page 1of 3

.

SITEMA DE CONTROL PARA UN PARQUEADERO CON UN LIMITE DE 45


COCHES.
Integrante 1 (Arial, 11 Pts, centrado)
e-mail: integrante1@institucin (quitar hipervnculo)

Verde : out STD_LOGIC;


output1
:
out
STD_LOGIC_VECTOR (6 downto 0);
output2
:
out
STD_LOGIC_VECTOR (6 downto 0)
);
end maq;

RESUMEN: Principalmente lo que se hizo para


este sistema fue tomar el decodificador a 7 segmentos
previamente hecho para una prctica de laboratorio.
Luego se procedi a realizar un diagrama de estados
correspondiente al problema dado. Ya, teniendo nuestro
diagrama de estados hacemos la lgica de estados en
el software para sistemas digitales: Xilinx. Como
principal resultado se obtuvo que la simulacin cumpli
con los resultados esperados. As podemos concluir que
el cdigo est perfectamente hecho para darle solucin
al problema principal, contabilizar los autos presentes en
un estacionamiento.

architecture Behavioral of maq is


type states is (St0, St1, St2, St3, St4, St5, St6);
signal Ep, Es: states;
signal Aux: STD_LOGIC_VECTOR (5 downto 0);
signal Entrada: STD_LOGIC_VECTOR (5 downto
0);

PALABRAS CLAVE: Decodificador,


estado siguiente, Sistema Digital, Xilinx.

Lgica

de

begin
process (reset,clk)
begin

1 INTRODUCCIN

end process;

En nuestra vida diaria surgen infinidad de


problemas, unos ms complejos que otros. Por ejemplo,
estamos disfrutando cmodamente de una pelcula en
nuestro silln, cuando nos damos cuenta que la luz
quedo encendida, as que, nos molestamos por olvidar
apagarla, pero al ver esto pensamos en alguna solucin,
es all donde entra la maravillosa funcionalidad de los
sistemas digitales, por ejemplo, algn sistema con el
cual estando en nuestro silln podamos apagar la luz
simplemente presionando un botn.
Pero, como decamos anteriormente, nos topamos
con problema ms complejos, como el principal objetivo
del desarrollo de este sistema de control para un
parqueadero, aunque tambin podemos mirarlo en otro
contexto, tal como el desarrollo de un procesador.

process(Ep, A ,B, Entrada)


begin
case Ep is -- describe transitions
when St0 =>
if (A = '1') then
if (B = '0') then
Es <= St1;
else Es <= St0;
end if;
else if (B = '1') then
Es
<= St4;
else Es <= St0;
end if;
end if;
when St1 =>
if (A = '1') then
if (B = '1') then Es <=
St2;
else Es <= St1;
end if;
else Es <= St0;
end if;
when St2 =>
if (A = '0') then
if (B = '1') then Es <=
St3;
else Es <= St0;
end if;
else if (B = '1') then Es <= St2;
else Es <= St0;

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
<=

output2 <= "1001111";--3


when "000100" =>
output1 <= "0111111";
output2 <= "1100110";--4
when "000101" =>
output1 <= "0111111";
output2 <= "1101101";--5
when "000110" =>
output1 <= "0111111";
output2 <= "1111101";--6
when "000111" =>
output1 <= "0111111";
output2 <= "0000111";--7
when "001000" =>
output1 <= "0111111";
output2 <= "1111111";--8
when "001001" =>
output1 <= "0111111";
output2 <= "1100111";--9
when "001010" =>
output1 <= "0000110";
output2 <= "0111111";--10
when "001011" =>
output1 <= "0000110";
output2 <= "0000110";--11
when "001100" =>
output1 <= "0000110";
output2 <= "1011011";--12
when "001101" =>
output1 <= "0000110";
output2 <= "1001111";--13
when "001110" =>
output1 <= "0000110";
output2 <= "1100110";--14
when "001111" =>
output1 <= "0000110";
output2 <= "1101101";--15
when "010000" =>
output1 <= "0000110";
output2 <= "1111101";--16
when "010001" =>
output1 <= "0000110";
output2 <= "0000111";--17
when "010010" =>
output1 <= "0000110";
output2 <= "1111111";--18
when "010011" =>
output1 <= "0000110";
output2 <= "1100111";--19
when "010100" =>
output1 <= "1011011";
output2 <= "0111111";--20
when "010101" =>
output1 <= "1011011";
output2 <= "0000110";--21
when "010110" =>
output1 <= "1011011";
output2 <= "1011011";--22
when "010111" =>
output1 <= "1011011";
output2 <= "1001111";--23
when "011000" =>
output1 <= "1011011";
output2 <= "1100110";--24

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.

2.2 DIAGRAMA DE ESTADOS

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.

You might also like