Forum Discussion
Altera_Forum
Honored Contributor
9 years agosomething like this, though i tried different combinations for the 'if' condition, as in in different places or using 'elseif', yet still same result...
process(clk, rst) variable cnt : unsigned(3 downto 0) begin if rst = '0' then cnt := (others => '1'); elsif rising_edge(clk) then if load = '1' then cnt := new_data; end if; if ena = '1' then cnt := cnt +1; end if; end if; cnt_out <= cnt; end process;