shaiko
Advanced Member level 5
- Joined
- Aug 20, 2011
- Messages
- 2,644
- Helped
- 303
- Reputation
- 608
- Reaction score
- 297
- Trophy points
- 1,363
- Activity points
- 18,302
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);