shaiko
Advanced Member level 5
A single port VHDL RAM example from Altera:
my question:
why use "addr_reg" for reading? why not simply use:
Code:
process(clk)
begin
if(rising_edge(clk)) then
if(we = '1') then
ram(addr) <= data;
end if;
[COLOR="#FF0000"]addr_reg <= addr[/COLOR]; -- Register the address for reading
end if;
end process;
q <= ram(addr_reg);
my question:
why use "addr_reg" for reading? why not simply use:
Code:
q <= ram(addr);