encounter 发表于 2010-6-27 23:53:15

这个verilog程序请懂的高手给我讲下原理吗?

这个程序请懂的高手给我讲下原理好吗?
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;
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;

VVIC 发表于 2010-6-28 00:25:37

谢谢<br>
这句<br>
ramtmp(conv_integer(wadd))&lt;=datain<br>
书上没看到过类似的,是什么意思呢?

interige 发表于 2010-6-28 00:45:27

我波形图怎么弄不出来呢,设置了参数以后,运行打开输出信号波形是不会变的

inter 发表于 2010-6-28 01:37:00

mirson 真是高手,佩服,向你学习!

Sunlife 发表于 2015-7-4 10:59:41


我波形图怎么弄不出来呢,设置了参数以后,运行打开输出信号波形是不会变的
页: [1]
查看完整版本: 这个verilog程序请懂的高手给我讲下原理吗?