收藏 分销(赏)

基于DDS信号技术的信号发生器的设计.doc

上传人:pc****0 文档编号:8133597 上传时间:2025-02-05 格式:DOC 页数:15 大小:31KB 下载积分:10 金币
下载 相关 举报
基于DDS信号技术的信号发生器的设计.doc_第1页
第1页 / 共15页
基于DDS信号技术的信号发生器的设计.doc_第2页
第2页 / 共15页


点击查看更多>>
资源描述
基于DDS信号技术的信号发生器的设计 直接数字式频率合成技术DDS是新一代的频率合成技术,采用数字控制信号的相位增加技术,具有频率分辨率高,频率切换快,频率切换时相位连续和相位噪声低以及全数字化易于集成等优点而被广泛采用。 一. 程序代码 (1) ADDER32B library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; entity ADDER32B is port( ain : in std_logic_vector(31 downto 0); bin : in std_logic_vector(31 downto 0); cout: ou t std_logic_vector(31 downto 0) ); end; architecture one of ADDER32B is begin cout <= ain + bin; end; (2)juxing_rom LIBRARY ieee; USE ieee.std_logic_1164.all; LIBRARY altera_mf; USE altera_mf.all; ENTITY juxing_rom IS PORT ( address : IN STD_LOGIC_VECTOR (11 DOWNTO 0); clock : IN STD_LOGIC ; q : OUT STD_LOGIC_VECTOR (7 DOWNTO 0) ); END juxing_rom; ARCHITECTURE SYN OF juxing_rom IS SIGNAL sub_wire0 : STD_LOGIC_VECTOR (7 DOWNTO 0); COMPONENT altsyncram GENERIC ( address_aclr_a : STRING; init_file : STRING; intended_device_family : STRING; lpm_hint : STRING; lpm_type : STRING; numwords_a : NATURAL; operation_mode : STRING; outdata_aclr_a : STRING; outdata_reg_a : STRING; widthad_a : NATURAL; width_a : NATURAL; width_byteena_a : NATURAL ); PORT ( clock0 : IN STD_LOGIC ; address_a : IN STD_LOGIC_VECTOR (11 DOWNTO 0); q_a : OUT STD_LOGIC_VECTOR (7 DOWNTO 0) ); END COMPONENT; BEGIN q <= sub_wire0(7 DOWNTO 0); altsyncram_component : altsyncram GENERIC MAP ( address_aclr_a => "NONE", init_file => "../MIF/juxing.mif", intended_device_family => "Cyclone", lpm_hint => "ENABLE_RUNTIME_MOD=NO", lpm_type => "altsyncram", numwords_a => 4096, operation_mode => "ROM", outdata_aclr_a => "NONE", outdata_reg_a => "CLOCK0", widthad_a => 12, width_a => 8, width_byteena_a => 1 ) PORT MAP ( clock0 => clock, address_a => address, q_a => sub_wire0 ); END SYN; (3)mux3_1 library ieee; use ieee.std_logic_1164.all; entity mux3_1 is port( sin:in std_logic_vector(7 downto 0); sanjiao,juxing:in std_logic_vector(7 downto 0); a,b:in std_logic; cout:out std_logic_vector(7 downto 0) ); end mux3_1; architecture behavior of mux3_1 is signal addr:std_logic_vector(1 downto 0); begin process(a,b) begin addr(0)<=a; addr(1)<=b; case addr is when "00" => cout<=sin; when "01" => cout<=sanjiao; when "10" => cout<=juxing; when others => null; end case; end process; end behavior; (4)sanjiao_rom LIBRARY ieee; USE ieee.std_logic_1164.all; LIBRARY altera_mf; USE altera_mf.all; ENTITY sanjiao_rom IS PORT ( address : IN STD_LOGIC_VECTOR (11 DOWNTO 0); clock : IN STD_LOGIC ; q : OUT STD_LOGIC_VECTOR (7 DOWNTO 0) ); END sanjiao_rom; ARCHITECTURE SYN OF sanjiao_rom IS SIGNAL sub_wire0 : STD_LOGIC_VECTOR (7 DOWNTO 0); COMPONENT altsyncram GENERIC ( address_aclr_a : STRING; init_file : STRING; intended_device_family : STRING; lpm_hint : STRING; lpm_type : STRING; numwords_a : NATURAL; operation_mode : STRING; outdata_aclr_a : STRING; outdata_reg_a : STRING; widthad_a : NATURAL; width_a : NATURAL; width_byteena_a : NATURAL ); PORT ( clock0 : IN STD_LOGIC ; address_a : IN STD_LOGIC_VECTOR (11 DOWNTO 0); q_a : OUT STD_LOGIC_VECTOR (7 DOWNTO 0) ); END COMPONENT; BEGIN q <= sub_wire0(7 DOWNTO 0); altsyncram_component : altsyncram GENERIC MAP ( address_aclr_a => "NONE", init_file => "../MIF/sanjiao.mif", intended_device_family => "Cyclone", lpm_hint => "ENABLE_RUNTIME_MOD=NO", lpm_type => "altsyncram", numwords_a => 4096, operation_mode => "ROM", outdata_aclr_a => "NONE", outdata_reg_a => "CLOCK0", widthad_a => 12, width_a => 8, width_byteena_a => 1 ) PORT MAP ( clock0 => clock, address_a => address, q_a => sub_wire0 ); END SYN; (5)sinx256_rom LIBRARY ieee; USE ieee.std_logic_1164.all; LIBRARY altera_mf; USE altera_mf.all; ENTITY sinx256_rom IS PORT ( address : IN STD_LOGIC_VECTOR (7 DOWNTO 0); inclock : IN STD_LOGIC ; q : OUT STD_LOGIC_VECTOR (7 DOWNTO 0) ); END sinx256_rom; ARCHITECTURE SYN OF sinx256_rom IS SIGNAL sub_wire0 : STD_LOGIC_VECTOR (7 DOWNTO 0); COMPONENT altsyncram GENERIC ( address_aclr_a : STRING; init_file : STRING; intended_device_family : STRING; lpm_hint : STRING; lpm_type : STRING; numwords_a : NATURAL; operation_mode : STRING; outdata_aclr_a : STRING; outdata_reg_a : STRING; widthad_a : NATURAL; width_a : NATURAL; width_byteena_a : NATURAL ); PORT ( clock0 : IN STD_LOGIC ; address_a : IN STD_LOGIC_VECTOR (7 DOWNTO 0); q_a : OUT STD_LOGIC_VECTOR (7 DOWNTO 0) ); END COMPONENT; BEGIN q <= sub_wire0(7 DOWNTO 0); altsyncram_component : altsyncram GENERIC MAP ( address_aclr_a => "NONE", init_file => "../MIF/sinx256_rom.mif", intended_device_family => "Cyclone", lpm_hint => "ENABLE_RUNTIME_MOD=NO", lpm_type => "altsyncram", numwords_a => 256, operation_mode => "ROM", outdata_aclr_a => "NONE", outdata_reg_a => "CLOCK0", widthad_a => 8, width_a => 8, width_byteena_a => 1 ) PORT MAP ( clock0 => inclock, address_a => address, q_a => sub_wire0 ); END SYN; (6)REG32B library ieee; use ieee.std_logic_1164.all; entity REG32B is port( clk : in std_logic; din : in std_logic_vector(31 downto 0); dout: out std_logic_vector(31 downto 0) ); end; architecture one of REG32B is begin process(clk,din) begin if clk'event and clk = '1' then dout <= din; end if; end process; ----dout <= passer ; end; (6)sin LIBRARY ieee; USE ieee.std_logic_1164.all; LIBRARY altera_mf; USE altera_mf.all; ENTITY sin IS PORT ( address : IN STD_LOGIC_VECTOR (7 DOWNTO 0); clock : IN STD_LOGIC ; q : OUT STD_LOGIC_VECTOR (7 DOWNTO 0) ); END sin; ARCHITECTURE SYN OF sin IS SIGNAL sub_wire0 : STD_LOGIC_VECTOR (7 DOWNTO 0); COMPONENT altsyncram GENERIC ( clock_enable_input_a : STRING; clock_enable_output_a : STRING; init_file : STRING; intended_device_family : STRING; lpm_hint : STRING; lpm_type : STRING; numwords_a : NATURAL; operation_mode : STRING; outdata_aclr_a : STRING; outdata_reg_a : STRING; widthad_a : NATURAL; width_a : NATURAL; width_byteena_a : NATURAL ); PORT ( clock0 : IN STD_LOGIC ; address_a : IN STD_LOGIC_VECTOR (7 DOWNTO 0); q_a : OUT STD_LOGIC_VECTOR (7 DOWNTO 0) ); END COMPONENT; BEGIN q <= sub_wire0(7 DOWNTO 0); altsyncram_component : altsyncram GENERIC MAP ( clock_enable_input_a => "BYPASS", clock_enable_output_a => "BYPASS", init_file => "../sin.mif", intended_device_family => "Stratix II", lpm_hint => "ENABLE_RUNTIME_MOD=NO", lpm_type => "altsyncram", numwords_a => 256, operation_mode => "ROM", outdata_aclr_a => "NONE", outdata_reg_a => "CLOCK0", widthad_a => 8, width_a => 8, width_byteena_a => 1 ) PORT MAP ( clock0 => clock, address_a => address, q_a => sub_wire0 ); END SYN; (二)仿真波形
展开阅读全文

开通  VIP会员、SVIP会员  优惠大
下载10份以上建议开通VIP会员
下载20份以上建议开通SVIP会员


开通VIP      成为共赢上传

当前位置:首页 > 学术论文 > 其他

移动网页_全站_页脚广告1

关于我们      便捷服务       自信AI       AI导航        抽奖活动

©2010-2026 宁波自信网络信息技术有限公司  版权所有

客服电话:0574-28810668  投诉电话:18658249818

gongan.png浙公网安备33021202000488号   

icp.png浙ICP备2021020529号-1  |  浙B2-20240490  

关注我们 :微信公众号    抖音    微博    LOFTER 

客服