Forum Discussion
Altera_Forum
Honored Contributor
11 years agoIf you want to count to "k-1", you should replace:
value <= value + 1; by something like: if (value < k) then
value <= value + 1;
else
value <= (others => '0');
end if; And then you have two choices: Do you want to have "k" hard coded in your design then you can make a new generic with
k : integer :=32; Where 32 is only a pre-defined Value for k and can be replaced by the parent entity. Or for changing the Value while the Core runs, you can define a new port as Input: k : in unsigned (15 downto 0 ); Where 15 is the maximum width of the Input (actually 16Bit).