Estoy tratando de escribir un pequeño contador en VHDL usando la metodología de los dos procesos. Sin embargo no está funcionando. ¿Podría alguien explicarme por qué?
library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.std_logic_arith.all;
USE ieee.numeric_std.ALL;
use IEEE.std_logic_unsigned.all;
entity myCounter is
port(
clk: in std_logic;
clkEnable:in std_logic;
reset:in std_logic;
);
end myCounter;
architecture Behavioral of myCounteris
TYPE STATE_TYPE IS (counterDecr, countIncr, resetCounter);
signal stateMachine: STATE_TYPE:=counterDecr;
signal nextState: STATE_TYPE:=counterDecr;
signal counter: integer:=15;
signal test: std_logic:='0';
begin
synchronous: process(clk)begin
if(clkEnable='1')then
if(rising_edge(clk))then
if(reset='1')then
stateMachine<=counterDecr;
else
stateMachine<=nextState;
end if;
end if;
end if;
end process;
combin:process(stateMachine)begin
counter<=counter-1;
nextState<=counterDecr;
test<= not test;
end process;
end;