这个程序请懂的高手给我讲下原理好吗?
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;
entity sram is
generic(width:integer:=8;(generic是怎么用的啊,在什么情况下用啊)
depth:integer:=8;
adder:integer:=3);
port(datain:in std_logic_vector(width-1 downto 0);
dataout
ut std_logic_vector(width-1 downto 0);
clock:in std_logic;
we,re:in std_logic;
wadd:in std_logic_vector(adder-1 downto 0);
radd:in std_logic_vector(adder-1 downto 0));
end sram;
architecture art of sram is
type men is array(0 to depth-1)of
std_logic_vector(width-1 downto 0);
signal ramtmp:men;
begin
process(clock)
begin
if(clock'event and clock='1')then
if(we='1')then
ramtmp(conv_integer(wadd))<=datain;(这句话是什么意思)
end if;
end if;
end process;
process(clock)
begin
if(clock'event and clock='1')then
if(re='1')then
dataout<=ramtmp(conv_integer(radd));
end if;
end if;
end process;
end art;
有大侠能帮忙吗?
ut bit_vector(7downto0) inp: in std_logic_vector(2downto0) outp(covn_integer(inp))<='1'这句的功能是把inp转化为整形, 但是不知道这个1是赋值给几个单元的.covn_integer(inp)代表几个数啊.希望大家帮帮我啊 我是刚开始学的.