欢迎来到天天文库
浏览记录
ID:21916352
大小:203.00 KB
页数:8页
时间:2018-10-25
《周期可调多波形发生器》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、EDA技术实用教程实验报告实验名称:周期可调的多波形发生器系别:XXX专业:电子信息工程姓名:XXX学号:XXXXXXX2010.12.2周期可调的多波形发生器1、实验目的熟悉MAX+plusⅡ的VHDL文本设计流程的全过程,学会用可编程逻辑器件设计制作一个波形发生器,该波形发生器能产生正弦波、方波、三角波等波形。2、实验要求(1)具有产生正弦波、方波、三角波3种周期性波形的功能。(2)用开关输入编辑生成上述3中波形的线性组合波形。(3)输出波形的频率范围100—1KHz,频率可调。3、分析:(1)产生正弦波,是通过预先计算出正弦波表,然后查表输出实现
2、的(此处一个周期正弦波取64点)。(2)产生方波,是通过交替送出全0和全1,给以适当的延时实现的。(3)产生三角波,是通过由全0不断加同一个数,到全1之后再不断减同一个数来实现的。4、所用器件:EP1K30QC208-3和EPC2LC20以及D/A转换芯片。5、流程图6、各模块功能模块CHUZHI提供初值,供下一个模块FANA分频时用,通过不同的初值,是由输入a决定的。libraryieee;useieee.std_logic_1164.all;entitychuzhiisport(a:instd_logic_vector(3downto0);q:ou
3、tintegerrange0to312);endchuzhi;architecturechu_arcofchuzhiisbeginprocess(a)begincaseaiswhen"0001"=>q<=313;when"0010"=>q<=156;when"0011"=>q<=104;when"0100"=>q<=78;when"0101"=>q<=63;when"0110"=>q<=52;when"0111"=>q<=45;when"1000"=>q<=39;when"1001"=>q<=35;when"1010"=>q<=31;whenother
4、s=>null;endcase;endprocess;endchu_arc;模块FANA的功能是将前一模块CHUZHI送来的初值对时钟进行分频,得到不同的工作频率,从而调节波形频率。libraryieee;useieee.std_logic_1164.all;useieee.std_logic_unsigned.all;entityfanaisport(a:inintegerrange0to312;clk:instd_logic;q:outstd_logic);endfana;architecturefan_arcoffanaisbeginproces
5、s(clk)variableb,d:std_logic;variablec:integerrange0to312;beginifclk'eventandclk='1'thenifb='0'thenc:=a-1;b:='1';elseifc=1thenb:='0';d:=notd;elsec:=c-1;endif;endif;endif;q<=d;endprocess;endfan_arc;模块SQUARE的功能是产生方波。libraryieee;useieee.std_logic_1164.all;entitysquareisport(clk,clr:
6、instd_logic;q:outintegerrange0to255);endsquare;architecturesq_arcofsquareissignala:bit;beginprocess(clk,clr)variablecnt:integer;beginifclr='0'thena<='0';elsifclk'eventandclk='1'thenifcnt<31thencnt:=cnt+1;elsecnt:=0;a<=nota;endif;endif;endprocess;process(clk,a)beginifclk'eventand
7、clk='1'thenifa='1'thenq<=255;elseq<=0;endif;endif;endprocess;endsq_arc;方波的功能仿真:模块DELTA的功能是产生三角波。libraryieee;useieee.std_logic_1164.all;useieee.std_logic_unsigned.all;entitydeltaisport(clk,reset:instd_logic;q:outstd_logic_vector(7downto0));enddelta;architecturedelta_arcofdeltaisb
8、eginprocess(clk,reset)variabletmp:std_logic_vec
此文档下载收益归作者所有