为什么当fifoclk的采样频率不同时
得出的结果不同呢?
有解决的办法吗?
程序如下:
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;
entity ChangeToLd is
port(fifoclk:in std_logic;
--reset :in std_logic;
out_dq :in std_logic_vector(63 downto 0);
ld ut std_logic_vector(7 downto 0));
end ChangeToLd;
architecture a_changeToLd of changeToLd is
signal count: integer range 0 to 8;
begin
process(fifoclk)
begin
if fifoclk = '1' and fifoclk'event then
if count = 0 then
ld<=out_dq(63 downto 56);
elsif count =1 then
ld<=out_dq(55 downto 48);
elsif count =2 then
ld<=out_dq(47 downto 40);
elsif count =3 then
ld<=out_dq(39 downto 32);
elsif count =4 then
ld<=out_dq(31 downto 24);
elsif count =5 then
ld<=out_dq(23 downto 16);
elsif count =6 then
ld<=out_dq(15 downto 8);
elsif count =7 then
ld<=out_dq(7 downto 0);
end if;
end if;
end process;
process(fifoclk)
begin
if fifoclk = '1' and fifoclk'event then
if count=7 then
count<=0;
else
count<=count+1;
end if;
end if;
end process;
end a_changetold;
process(fifoclk) //
改成process(count)
begin
if fifoclk = '1' and fifoclk'event then
以下用case语句
if count = 0 then
ld<=out_dq(63 downto 56);
elsif count =1 then
ld<=out_dq(55 downto 48);
elsif count =2 then
ld<=out_dq(47 downto 40);
elsif count =3 then
ld<=out_dq(39 downto 32);
elsif count =4 then
ld<=out_dq(31 downto 24);
elsif count =5 then
ld<=out_dq(23 downto 16);
elsif count =6 then
ld<=out_dq(15 downto 8);
elsif count =7 then
ld<=out_dq(7 downto 0);
end if;
end if;
end process;