集成电路技术分享

 找回密码
 我要注册

QQ登录

只需一步,快速开始

搜索
查看: 1914|回复: 4

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

[复制链接]
encounter 发表于 2010-6-27 23:53:15 | 显示全部楼层 |阅读模式
这个程序请懂的高手给我讲下原理好吗?
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 下一条

QQ|小黑屋|手机版|Archiver|fpga论坛|fpga设计论坛 ( 京ICP备20003123号-1 )

GMT+8, 2025-5-6 11:23 , Processed in 0.059488 second(s), 19 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表