|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
x
我的本意是要输入一个数到指定地点,然后再输出,但是综合要十几分钟!好慢
entity rom_1 is
Port ( wr , cs ,rd : in std_logic;
adr : in std_logic_vector ( 7 downto 0 );
data_in : in std_logic_vector ( 7 downto 0 );
dout : out std_logic_vector(7 downto 0)
);
end rom_1;
architecture Behavioral of rom_1 is
type memory is array ( 0 to 255 ) of std_logic_vector(7 downto 0);
signal sram :memory;
begin
process (wr,cs)
begin
if cs = '1' then
dout <="ZZZZZZZZ";
elsif wr='1' and wr'event then
sram ( conv_integer ( adr ) ) <= data_in ;
end if ;
end process;
process ( rd ,cs )
begin
if ( cs ='1' ) then
if rd = '0' then
dout<= sram ( conv_integer ( adr ) );
end if;
end if ;
end process;
end behavioral ;
|
|