欢迎来到天天文库
浏览记录
ID:20431915
大小:808.20 KB
页数:23页
时间:2018-10-12
《eda技术与应用试验指导书2016版》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、实验一全加器设计仿真与下载四.实验内容及操作步骤1.设计一位全加器(1)完成电路的输入,以及对引脚的命名等(参考电路如图2—1)◊(2)对一位全加器进行编译、仿真与下载。(3)点击File菜单的CreateDefaultSymbol项,创建缺省模块。2.利用一位全加器模块进行四位全加器的设计。(1)创建一个新的项目,新建文件。在新打7T•的阁形编輯区双击左键,从EnterSymbol对话框屮的用户目录(自创目录)下选择模块名。(2)连接线路,并进行编译(如图2—2)。(3)点击Assign菜单的Device项选择芯片。(4)
2、管脚分配。(5)后编译,并进行下载。观察实验结果。实验二分频扫描与计数器设计4.四.实验内容与步骤1.设计一个分频电路已知cpld/fpga信号源脉冲频率为50M,试编写一•分频程序,得到一周期为1秒(频率为1Hz)的脉冲频率,并将之形成include文件。(1)vhdl设计输入参考程序libraryieee;~调用痒useieee.std_logic_l164.al1;useieee.std_logic_unsigned.all;entityfpis实体说明(实体名需与文件名一致)port(inclk:instdlogic
3、;端口说明outputa:outstd_logic);endfp;architecturearch_fpoffpis构造体说明signalfp:std_logic_vector(24downto0);信号定义signalf:std_logic;beginprocess(inclk)进程语句描述beginif(inclk’eventandinclk=’1’)then将时钟分频至1Hziffp=24999999thenfp<=〃0000000000000000000000000〃;f<=notf;elsefp<=fp+l;end
4、if;endif;endprocess;outputa<=f;endarchfp;构造体结束(2)编译与仿真。耍求:自己设计,试用VHDL编写一10分频程序,并创建include文件。2.12归1电路设计(1)创建一个新的项口。点击File—ProjectProjectName项;输入项□名称。(2)打开文本编辑窗口。点击File菜单下New项,选TextEditor项。(3)时钟源采用上面的分频电路所分得的1秒的时钟源。(4)用vhdl编写的例子libraryieee;调用库useieee.std_logic_l164.a
5、ll;useieee.std_logic_unsigned.al1;entitytwelvctolis实体描述port(finclk:instd_logic;端口说明outputa:outstd_logic_vector(6downto0);outputb:outstd_logic_vector(6downto0));endtwelvetol;architecturearch_twclvetoloftwelvctolis结构体描述signalsa:std_logic_vector(3downto0);signalsb:std
6、_logic_vector(3downto0);signalf:std_logic;componentfp调用分频模块(分频模块需与此程序在同一•文件夹下)port(inclk:instd_logic;outputa:outstd_logic);endcomponent;beginul:fpportmap(inclk=>finclk,outputa=>f);process(f)进程语句描述beginif(risingedge(f))thenI•二归一条件语句模块if(sa=2andsb=l)thensa〈="0001〃;sb
7、<=〃0000〃;elseifsa=9thensa〈="0000〃;sb〈=sb+l;elsesa<=sa+l;endif;endif;endif;endprocess;sa表不个位when"0001",when"0010",when"0011",when"0100〃,when"0101",when"0110",when"0111",when"1000",when"1001",when"1010",when"1011",when"1100",when"1101",when"1110〃,when"1111",withsasel
8、ectoutputa<="0110000""1101101""1111001""0110011〃"1011011""1011111""1110000""1111111""1111011〃"1110111""0011111""1001110〃"0111101""1001111〃"100011
此文档下载收益归作者所有