I have a simple VHDL code which has two process. The second process updates the output port m_LED based on the state CF value. In simulation I see the behavior as expected. But when I program the FPGA I noticed that, the output port m_LED is producing some random values which is not even assigned in the code. I am totally clueless from where these values are coming. Any hint will be much appreciated!
entity monitor is
Port (
io_LED: in std_logic_vector(3 downto 0);
m_LED: out std_logic_vector(3 downto 0)
);
end monitor;
architecture Behavioral of monitor is
type state_type is (s0, s1, s2,s3);
signal state: state_type :=s0;
signal nrst:std_logic:='1';
begin
Process (io_LED)
begin
if (nrst= '0') then
state<= s0;
else
case state is
when s1 =>
if (io_LED = "0000") then
state <= s2;
end if;
when others => state <= s0;
end case;
end if;
end Process;
Process(io_LED)
begin
m_LED<="0000";
case state is
when s0 =>
m_LED<="0000";
when s1 =>
m_LED<="0001";
when others => m_LED<="0000";
end case;
end Process;
end Behavioral;