faye_hongdou
Member level 1
I saw ddt694's post, which mentioned:
In the lookup table, the address is "conv_integer(acc(23 downto 14))". I do not understand that why the address is conv_integer(acc(23 downto 14)), but not conv_integer(acc(23 downto 0)).
Code:
you can realize a accumulator like this
process(clk) begin
if rising_edge(clk) then
acc(23 downto 0) <= acc(23 downto 0) + input;
end if; end process;
then, you can address the lookup table like this
process(clk) begin
if rising_edge(clk) then
nco_out(7 downto 0) <= rom(conv_integer(acc(23 downto 14));
end if; end process;
In the lookup table, the address is "conv_integer(acc(23 downto 14))". I do not understand that why the address is conv_integer(acc(23 downto 14)), but not conv_integer(acc(23 downto 0)).