|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
x
--*************************************************
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;
--*************************************************
entity fifo is
port(wr,clk,fsyn:in std_logic;
address:in std_logic_vector(1 downto 0);
datain:in std_logic_vector(3 downto 0);
dataout1ut std_logic_vector(15 downto 0);---------(1)
dataoutut std_logic
);
end fifo;
architecture a of fifo is
signal data,data1:std_logic_vector(15 downto 0);
begin
process(wr,address)
begin
if wr='1' then
case address is
when "00"=>data1(3 downto 0)<=datain;
when "01"=>data1(7 downto 4)<=datain;
when "10"=>data1(11 downto 8)<=datain;
when "11"=>data1(15 downto 12)<=datain;
when others=> null;
end case;
end if;
end process;
process(clk,fsyn)
begin
if fsyn='0' then
dataout1<=data1;-------(2)
data<=data1;
elsif clk'event and clk='1'then
data(0)<=data(1);
for i in 1 to 14 loop
data(i)<=data(i+1);
end loop;
end if;
end process;
dataout<=data(0);
end a;
当我加入标记为(1)和(2)的语句时dataout的输出就一切正常,但是当我去掉它们时dataout的输出就出错,其实(1)和(2)句是没什么用处的,我用的是max+plus,请问这是怎么回事?谢谢 |
|