- 13
- 0
- 约4.7千字
- 约 7页
- 2017-08-11 发布于重庆
- 举报
实验二简易DDS波形发生器
实验二 简易DDS波形发生器
强佳欢 116040315
实验目的:1. 进一步熟悉绘制ASM图分析实验的方法;
2. 进一步掌握将VHDL程序符号化的使用方法;
3. 熟悉ROM表的制作与符号化;
4.了解DDS波形发生器的基本原理。
实验内容:
利用FPGA和DAC,设计一个简易的DDS波形发生器并发出正弦波。
具体要求:1.分辨率优于1Hz;
2.ROM表长度8位,位宽10位;
3.输出频率优于100kHz(每个周期数据点大于50);
4.显示信号频率/频率控制字(可切换);
5.直接输入频率控制字或输出频率。
实验原理:
具体流程图:
实验器材:1.计算器一台;
2.示波器一台;
3.实验箱一台;
实验步骤:
1.根据实验要求计算参数:
M*fc/2^n1;
Fout=M*fc/2^n100000;
2^n/M50;
可得:频率控制字M选择18位,fc选择10MHZ;
打开QUARTUS,新建一个工程(MMM),新建一个block文件;
利用vhdl形成图形文件画一个M值的输入端:
程序如下:
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
use ieee.std_logic_arith.all;
entity aaaa is
port(a1,a2,a3,ret,cp:in std_logic;
p1,p2,p3,p4,p5:buffer std_logic_vector(3 downto 0));
end aaaa;
architecture aa of aaaa is
begin
process(cp,a1,a2,a3,ret)
begin
if(ret=1)then
p1=0000;p2=0000;p3=0000;p4=0000;p5=0000;
elsif(cp event and cp=1)then
if(a1=0 and a2=0 and a3=0)then
p1=p1+1;
elsif(a1=1 and a2=0 and a3=0)then
p2=p2+1;
elsif(a1=0 and a2=1 and a3=0)then
p3=p3+1;
elsif(a1=1 and a2=1 and a3=0)then
p4=p4+1;
elsif(a1=0 and a2=0 and a3=1)then
p5=p5+1;
end if;
end if;
end process;
end aa;
利用vhdl形成图形文件画一个累加器:
程序如下:
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
use ieee.std_logic_arith.all;
entity err is
port(q1:in unsigned(19 downto 0);
ret,cp:in std_logic;
p:out unsigned(7 downto 0));
end err;
architecture aa of err is
signal n:unsigned(23 downto 0);
begin
process(cp,ret)
begin
if(ret=1)then
n=000000000000000000000000;
elsif (cpevent and cp=1)then
n=n+q1;
end if;
p=n(23 downto 16);
end process;
end aa;
制作lpm_rom:
首先,先在excel中写好rom表中的值(表格如下):
Addr +0 +1 +2 +3 +4 +5 +6 +7 0 512 524 537 549 562 574 587 599 8 611 624 636 648 660 672 684 6
您可能关注的文档
最近下载
- LaserjetCP1025系列打印机打印质量故障排除手册.pdf VIP
- 年会小品剧本小品剧本:搞笑小品剧本《都是喝酒惹事》台词大全.docx VIP
- 2026年高考全国II卷文科综合真题试卷(新课标卷)(+答案).docx VIP
- 安路科技(688107)补国产短板,突高端应用,拓新应用与技术大市场-240717-东北证券-38页.pdf VIP
- [搞笑小品剧本]上当了小品剧本.docx VIP
- 数据中心800V直流供电技术白皮书2.0.pdf
- 上海大学2022-2023学年第1学期《高等数学(上)》期末考试试卷(B卷)附参考答案.pdf
- 上海大学2022-2023学年第1学期《高等数学(上)》期末考试试卷(A卷)附参考答案.pdf
- 中国教育行业人才流动与薪酬水平_2025年12月.docx
- 2024全国初中数学联赛初二卷 .pdf VIP
原创力文档

文档评论(0)