📄 ram1.vhd
字号:
library ieee;
use ieee.std_logic_1164.all;
use work.myfunction.all;
entity RAM is
port( rd:in std_logic;
addr:in std_logic_vector(7 downto 0);
data_i:in std_logic_vector(7 downto 0); data_o:out std_logic_vector(7 downto 0));
end RAM;
architecture beh of RAM is
type MEMORY is array(0 to 255) of std_logic_vector(7 downto 0);
signal MEM:MEMORY;
begin
READ:process(RD,ADDR,DATA_I)
begin
if RD='1' then
DATA_O<=MEM(vector_int(addr));
elsif RD='0' then
DATA_O<=(others=>'Z'); MEM(vector_int(addr))<=DATA_I;
end if;
end process READ;
end Beh;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -