-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRom.vhd
47 lines (32 loc) · 868 Bytes
/
Rom.vhd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
library ieee;
use IEEE.STD_LOGIC_1164.ALL;
Use ieee.numeric_std.all ;
entity rom is
port(
en : in std_logic;
clk : in std_logic;
rst : in std_logic;
Adress : in std_logic_vector(7 downto 0);
Data_out: out std_logic_vector(7 downto 0)
);
end rom;
architecture rom_a of rom is
type rom is array(0 to 255) of std_logic_vector(7 downto 0);
signal Data_Rom : rom ;
--------------- BEGIN -----------------------------------------------------------------
begin
-- rw='1' alors lecture
acces_rom:process(rst, clk)
begin
if rst='1' then
Data_Rom(0) <= (others=>'0');
Data_Rom(1) <= (others=>'0');
else
if rising_edge(clk) then
if en='1'then
Data_out <= Data_Rom(to_integer(unsigned(Adress)));
end if;
end if;
end if;
end process acces_rom;
end rom_a;