Professional Documents
Culture Documents
use ieee.std_logic_1164.ALL;
use ieee.numeric_std.ALL;
use ieee.math_real.all;
entity rom_vhd is
generic (
ADDR_WIDTH : integer := 8;
DATA_WIDTH : integer := 8
);
port (
clk_i : in std_logic;
addr_i : in std_logic_vector(ADDR_WIDTH-1 downto 0);
data_o : out signed(DATA_WIDTH-1 downto 0)
);
end rom_vhd;
begin
process (clk_i)
begin
if rising_edge(clk_i) then
data_o <= mem(to_integer(unsigned(addr_i)));
end if;
end process;
end rtl;