Soy nuevo en VHDL y estoy tratando de intentar crear un acelerador y un velocímetro. Quiero usar botones pulsadores y 7 segmentos para implementar. Quiero poder cambiar a cada sentencia de caso y ejecutar hasta que se presione un botón. No se simulará con el reloj retirado, y el error anterior ocurre cuando intento poner un reloj. ¿Alguna ayuda?
LIBRARY IEEE;
USE IEEE.NUMERIC_STD.ALL;
USE IEEE.STD_LOGIC_1164.all;
USE IEEE.STD_LOGIC_UNSIGNED.all;
ENTITY GearCounterFirst IS
PORT(
Clk : IN STD_LOGIC;
Gas: IN STD_LOGIC;
Speed : BUFFER STD_LOGIC_VECTOR (7 downto 0);
Acc : BUFFER STD_LOGIC_VECTOR(4 downto 0);
up: IN STD_LOGIC;
down: IN STD_LOGIC;
trans: BUFFER STD_LOGIC_VECTOR (2 downto 0)
);
END GearCounterFirst;
ARCHITECTURE Behavior OF GearCounterFirst IS
BEGIN
PROCESS (Clk,Speed, Gas, up, down, trans)
BEGIN
trans <= "000";
if (up = '1' and rising_edge(Clk)) then
trans <= trans + '1';
else
trans <= trans;
end if;
if (down = '1' and rising_edge(Clk)) then
trans <= trans - '1';
else
trans <= trans;
end if;
case trans is
when "000" =>
if (gas = '1' and rising_edge(Clk)) then
Speed <= Speed +4;
Acc <= "11111";
end if;
if (gas = '0' and rising_edge(Clk)) then
Speed <= Speed -4;
Acc <= "00000";
end if;
when "001" =>
if (gas = '1' and rising_edge(Clk)) then
Speed <= Speed -3;
Acc <= "01111";
end if;
if (gas = '0' and rising_edge(Clk)) then
Speed <= Speed -3;
Acc <= "00000";
end if;
when "010" =>
if (gas = '1') then
Speed <= Speed +2;
Acc <= "00111";
end if;
if (gas = '0') then
Speed <= Speed +1;
Acc <= "00000";
end if;
when "011" =>
if (gas = '1') then
Speed <= Speed +1;
Acc <= "00011";
end if;
if (gas = '0') then
Speed <= Speed -1;
Acc <= "00000";
end if;
when "100" =>
if (gas = '1') then
Speed <= Speed +1;
Acc <= "00001";
end if;
if (gas = '0') then
Speed <= Speed -1;
Acc <= "00000";
end if;
when others =>
Speed <= Speed -1;
Acc <= "00000";
end case;
END PROCESS;
END Behavior;