|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区
您需要 登录 才可以下载或查看,没有账号?立即注册
×
--N = 2^32
--fc = 50 000 000 HZ
--fo = fc*K/(2^32)
--K = fo*(2^32)/fc
entity DDS_FRE is
port(
clk : in std_logic;
rst_n : in std_logic;
clk_o : out std_logic
);
end DDS_FRE;
architecture Behavioral of DDS_FRE is
--constant Freq_Word : std_logic_vector(31 downto 0) := x"0000218e";--100K
--constant Freq_Word : std_logic_vector(31 downto 0) := x"0AA7EF9E";--666K
constant Freq_Word : std_logic_vector(31 downto 0) := x"08000000";--500K
--constant Freq_Word : std_logic_vector(31 downto 0) := x"08CCCCCC";--550K
--constant Freq_Word : std_logic_vector(31 downto 0) := x"0C000000";--750K
signal max_value : std_logic_vector(31 downto 0);
begin
process(clk,rst_n)
begin
if(rst_n = '0')then
max_value <= x"00000000";
elsif(clk'event and clk = '1')then
max_value <= max_value + Freq_Word;
end if;
end process;
process(clk,rst_n)
begin
if(rst_n = '0')then
clk_o <= '0';
elsif(clk'event and clk = '1')then
if(max_value < x"7fffffff")then
clk_o <= '0';
else
clk_o <= '1';
end if;
end if;
end process;
end Behavioral; |
|