Tema- Código VHDL para elevador.
Enviado por Sandra75 • 26 de Abril de 2018 • 1.281 Palabras (6 Páginas) • 567 Visitas
...
WHEN 6 => csal <= "0101";
WHEN 7 => csal <= "0110";
END CASE;
END PROCESS piso2;
PROCESS (p3)
VARIABLE conteo :INTEGER RANGE 0 TO 7;
BEGIN
IF (p3’EVENT AND p3 =’1’) THEN
IF (s1=’0’ AND s2=’0’) THEN conteo := conteo +1;
ELSIF (s2=’0’ AND s3=’0’) THEN conteo := conteo +1;
ELSIF (s3=’0’ AND s4=’0’) THEN conteo := 0;
ELSE conteo := conteo -1;
END IF;
q <= conteo;
END IF; --PASO COMPLET0
CASE conteo IS
WHEN 0 => csal <= "1010";
WHEN 1 => csal <= "1001";
WHEN 2 => csal <= "0101";
WHEN 3 => csal <= "0110";
WHEN 4 => csal <= "1010";
WHEN 5 => csal <= "1001";
WHEN 6 => csal <= "0101";
WHEN 7 => csal <= "0110";
END CASE;
END PROCESS piso3;
PROCESS (p4)
VARIABLE conteo :INTEGER RANGE 0 TO 7;
BEGIN
IF (p4’EVENT AND p4 =’1’) THEN
IF (s4=’0’ AND s5=’0’) THEN conteo := 0;
ELSE conteo := conteo +1;
END IF;
q <= conteo;
END IF; --PASO COMPLET0
CASE conteo IS
WHEN 0 => csal <= "1010";
WHEN 1 => csal <= "1001";
WHEN 2 => csal <= "0101";
WHEN 3 => csal <= "0110";
WHEN 4 => csal <= "1010";
WHEN 5 => csal <= "1001";
WHEN 6 => csal <= "0101";
WHEN 7 => csal <= "0110";
END CASE;
END PROCESS piso4;
end architecture;
...