📄 2dimensional-vector.vhd
字号:
-- *************************************************-- Behavioral description of a single-port SRAM with:-- Active High write enable (WE)-- Rising clock edge (Clock)-- *************************************************library ieee;use ieee.std_logic_1164.all;use IEEE.std_logic_arith.all;use IEEE.std_logic_unsigned.all;entity reg_sram isgeneric (width : integer:=8;depth : integer:=8;addr : integer:=3);port (Data : in std_logic_vector (width-1 downto 0);Q : out std_logic_vector (width-1 downto 0);Clock : in std_logic;WE : in std_logic;Address : in std_logic_vector (addr-1 downto 0));end reg_sram;architecture behav of reg_sram istype MEM is array (0 to depth-1) of std_logic_vector(width-1downto 0);--definite the arraysignal ramTmp : MEM;beginprocess (Clock)beginif (Clock'event and Clock='1') thenif (WE = '1') thenramTmp (conv_integer (Address)) <= Data;end if;end if;end process;Q <= ramTmp(conv_integer(Address));end behav;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -