Contador 00 - 99 Ascendente - Descendente
Enviado por AlanisMarsh • 28 de Abril de 2015 • 236 Palabras (1 Páginas) • 285 Visitas
Realizar un algoritmo que cuente de manera ascendente y descendente dentro de un rango de 00 hasta 99, con ambos displays de la tarjeta Cool runner.
entity examen is
Port ( rst : in STD_LOGIC;
clk : in STD_LOGIC;
cat1 : out STD_LOGIC;
cat2 : out STD_LOGIC;
up : in STD_LOGIC;
salida : out STD_LOGIC_VECTOR (06 downto 0));
end examen;
architecture Behavioral of examen is
signal unidad: STD_LOGIC_VECTOR (3 downto 0);
signal decena: STD_LOGIC_VECTOR (3 downto 0);
signal selecc: STD_LOGIC_VECTOR (3 downto 0);
signal cont: STD_LOGIC_VECTOR (3 downto 0);
signal reloj: STD_LOGIC;
begin
process (selecc,clk)
begin
if (clk = '0')then
selecc <= unidad;
cat2 <= '1';
cat1 <= '0';
else
selecc <= decena;
cat1 <= '1';
cat2 <= '0';
end if;
case selecc is
when "0000" => salida <= "1111110";
when "0001" => salida <= "0110000";
when "0010" => salida <= "1101101";
when "0011" => salida <= "1111001";
when "0100" => salida <= "0110011";
when "0101" => salida <= "1011011";
when "0110" => salida <= "1011111";
when "0111" => salida <= "1110000";
when "1000" => salida <= "1111111";
when "1001"=> salida <= "1110011";
when "1010" => selecc <= "0000";
when "1111" => selecc
...