library IEEE;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;
--实体
entity da1_test is
port (
clk:in STD_LOGIC ; --系统主时钟
da1_clk:out std_logic; --给DA的时钟
da1_d:out std_logic_vector(13 downto 0) --给DA的数据
);
end da1_test;
------------------------------------------------
architecture topdesign_arch of da1_test is
------------------------------------------------
signal count_clk:std_logic_vector(13 downto 0);
------------------------------------------------
begin
-------------------------------------------------
da1_clk <=clk; --给DA的时钟
--da_clk <=not count_clk(0); --给DA的时钟
-------------------------------------------------
process(clk)
begin
if clk'event and clk='1' then
-------------------------------------------------
count_clk<=count_clk+1;
da1_d<=count_clk(13 downto 0);
-------------------------------------------------
end if ;
-------------------------------------------------
end process;
-------------------------------------------------
end topdesign_arch;
把图上了,帮忙看看代码行不
library IEEE;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;
--实体
entity da1_test is
port (
clk:in STD_LOGIC ; --系统主时钟
da1_clk:out std_logic; --给DA的时钟
da1_d:out std_logic_vector(13 downto 0) --给DA的数据
);
end da1_test;
------------------------------------------------
architecture topdesign_arch of da1_test is
------------------------------------------------
signal count_clk:std_logic_vector(13 downto 0);
------------------------------------------------
begin
-------------------------------------------------
da1_clk <=clk; --给DA的时钟
--da_clk <=not count_clk(0); --给DA的时钟
-------------------------------------------------
process(clk)
begin
if clk'event and clk='1' then
-------------------------------------------------
count_clk<=count_clk+1;
da1_d<=count_clk(13 downto 0);
-------------------------------------------------
end if ;
-------------------------------------------------
end process;
-------------------------------------------------
end topdesign_arch;
先把WRTx、CLKx拉低,然后输出DATA IN数据;
延时ts时间之后,再把它们拉高,并保持tLPW、tCPW时间,然后拉低;
上述动作重复一次,前次给查的DATA IN数据将在DAC端输出。
时序就是这意思,实现这个波形就可以。
延时怎么实现啊,计数器么?
当然。
一周热门 更多>