




版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
本文格式为Word版,下载可任意编辑——EDA试验总结EDA试验收获与体会(5篇)总结是对过去一定时期的工作、学习或思想状况进行回想、分析,并做出客观评价的书面材料,它可使零星的、短浅的、表面的感性认知上升到全面的、系统的、本质的理性认识上来,让我们一起认真地写一份总结吧。大家想知道怎么样才能写一篇比较优质的总结吗?下面是我为大家带来的总结书优秀范文,希望大家可以喜欢。
EDA试验总结EDA试验收获与体会篇一
eda技术试验
二、教材名称:《eda技术使用教程》,潘松等编著。
三、本课程教学目的、要求:
介绍eda的基本知识、常用的eda工具的使用方法和目标器件的结构原理、vhdl设计输入方法(图形和文本)、vhdl仿真、vhdl的设计优化等。
eda技术作为重要的专业课程,其实践性强。在教学时要重视理论和实践的紧凑结合,通过大量上机操作,使学生把握vhdl的基本结构和编程思想。试验1原理图输入方法及8位全加器设计(4课时)
1)试验目的:
熟悉利用max+plusⅱ的原理图输入方法设计简单组合电路,把握层次化设计的方法,并通过一个8位全加器的设计把握利用eda软件进行电子电路设计的详细流程。2)试验报告要求:
详细表达8位加法器的设计流程;给出各层次的原理图及其对应的仿真波形图;给出加法器的延时状况。
3)试验步骤:
(1)设计一个一位半加器。
步骤1:输入设计项目和存盘步骤2:输入半加器元件:步骤3:将项目设置为工程文件步骤4:选择目标器件并编译步骤5:时序仿真步骤6:包装元件入库
选择菜单“file〞→“open〞,在“open〞对话框中选择原理图编辑文件选项“graphiceditorfiles〞,,重新开启半加器设计文件,然后选择如图4-5中“file〞菜单的“createdefaultsymbol〞项,将当前文件变成了一个包装好的单一元件(symbol),并被放置在工程路径指定的目录中以备后用。
(2)利用半加器组成一个一位全加器,并记录仿真结果。(3)利用全加器组成一个八位全加器,并记录仿真结果。
试验二
简单组合电路和时序电路设计(4课时)
一、试验目的:
熟悉max+plusⅱ的vhdl文本设计流程全过程,学习简单组合电路和时序电路的设计和仿真方法。
二、试验内容
1:首先利用max+plusⅱ完成2选1多路选择器和一位全加器的文本编辑输入和仿真测试等步骤,给出仿真波形,验证本项设计的功能。
2:设计触发器(j-k),给出程序设计、软件编译、仿真分析、硬件测试及详细试验过程。
3:先设计或门和一位半加器的vhdl描述文件,并进行仿真调试,再用元件例化的方法实现一位全加器,并仿真调试。要求记录vhdl文件内容和仿真波形结果。
4:用一位全加器设计8为全加器。要求记录vhdl文件内容和仿真波形结果。(选作)参考程序entitymux21aisport(a,b:inbit;s:inbit;y:outbit);endentitymux21a;architectureoneofmux21aissignald,e:bit;begind=aand(nots);e=bands;y=dore;endarchitectureone;
libraryieee;use;entityor2aisport(a,b:instd_logic;c:outstd_logic);endentityor2a;
architecturefu1ofor2aisbeginc=aorb;endarchitecturefu1;
半加器描述(1)libraryieee;use;entityadderisport(a,b:instd_logic;co,so:outstd_logic);endentityadder;architecturefh1ofadderisbeginso=not(axor(notb));co=aandb;endarchitecturefh1;
1位二进制全加器顶层设计描述libraryieee;use;entityf_adderisport(ain,bin,cin:instd_logic;cout,sum:outstd_logic);endentityf_adder;architecturefd1off_adderiscomponenth_adderport(a,b:instd_logic;co,so:outstd_logic);endcomponent;componentor2aport(a,b:instd_logic;c:outstd_logic);endcomponent;
signald,e,f:std_logic;beginu1:h_adderportmap(a=ain,b=bin,co=d,so=e);u2:h_adderportmap(a=e,b=cin,co=f,so=sum);u3:or2aportmap(a=d,b=f,c=cout);endarchitecturefd1;二选一多路选择器仿真结果:
试验三
含异步清0和同步时钟使能的4位加法计数器(4课时)
一、试验目的:
学习计数器的设计、仿真,进一步熟悉vhdl设计技术。
二、试验内容:
设计一含计数使能、异步复位和能进行计数值并行预置功能的4位加法计数器。rst是异步清零信号,高电平有效;clk是时钟输入信号;d0、d1、d2、d3是4位数据输入端(数据预置输入端)。q0、q1、q2、q3为计数器输出端。cout为进位输出端。ena为使能端,为„1‟时,计数器实现对clk时钟脉冲信号的加1计数,为0时中止计数。
参考程序:libraryieee;use;use;entitycnt4bisport(clk:instd_logic;rst:instd_logic;ena:instd_logic;outy:outstd_logic_vector(3downto0);cout:outstd_logic);endcnt4b;architecturebehavofcnt4bissignalcqi:std_logic_vector(3downto0);beginp_reg:process(clk,rst,ena)beginifrst='1'thencqi=“0000〞;elsifclk'eventandclk='1'thenifena='1'thencqi=cqi+1;elsecqi=“0000〞;endif;endif;outy=cqi;endprocessp_reg;cout=cqi(0)andcqi(1)andcqi(2)andcqi(3);--进位输出endbehav;
试验四
7段数码显示译码器设计(2课时)
一、试验目的:
1、学习7段数码显示译码器设计;
2、学习vhdl的多层次设计方法。
二、试验原理:
7段数码是纯组合电路,寻常的小规模专用ic,如74或4000系列的器件只能作十进制bcd码译码,然而数字系统中的数据处理和运算都是2进制的,所以输出表达都是16进制的,为了满足16进制数的译码显示,最便利的方法就是利用译码程序在fpga/cpld中来实现。但为了简化过程,首先完成7段bcd码译码器的设计。例如输出为“1101101〞时,数码管的7个段:g、f、e、d、c、b、a分别接1、1、0、1、1、0、1;接有高电平的段发亮,于是数码管显示“5〞。
图6-21共阴数码管及其电路
三、试验内容
1、编程实现7段数码显示译码器设计;
2、对7段数码显示译码器设计进行编辑、仿真,给出其所有信号的时序仿真波形;参考程序:libraryieee;use;entitydecl7sisport(a:instd_logic_vector(3downto0);led7s:outstd_logic_vector(6downto0));end;architectureoneofdecl7sisbeginprocess(a)begincaseaiswhen“0000〞=led7s=“0111111〞;when“0001〞=led7s=“0000110〞;when“0010〞=led7s=“1011011〞;when“0011〞=led7s=“1001111〞;when“0100〞=led7s=“1100110〞;when“0101〞=led7s=“1101101〞;when“0110〞=led7s=“1111101〞;when“0111〞=led7s=“0000111〞;when“1000〞=led7s=“1111111〞;when“1001〞=led7s=“1101111〞;whenothers=null;endcase;endprocess;end;仿真结果:
综合后的计数器和译码器连接电路的顶层文件原理图:
试验五
用状态机实现序列检测器的设计(4课时)
一、试验目的:
1、把握状态机的编程方法和步骤;
2、把握用状态机设计序列检测器的方法和步骤;
二、试验内容
用状态机编程实现对系列数“11100101〞的检测,当某一系列串(以左移方式)进入检测器后,若该串与预置的系列数一致,则输出“a〞,否则输出“b〞。
三、试验步骤:
1、编辑系列检测器的vhdl程序;
2、仿真测试并给出仿真波形,了解控制信号的时序;
3、将上述方案改为系列检测密码为可预置(外部输入)状况,重新编写程序、编译和仿真,并记录仿真结果。参考程序:
libraryieee;use;entityschkisport(din,clk,clr:instd_logic;ab:outstd_logic_vector(3downto0));endschk;architecturebehvofschkissignalq:integerrange0to8;signald:std_logic_vector(7downto0);begind=“11100101〞;process(clk,clr)beginifclr='1'thenq=0;elsifclk='1'andclk'eventthencaseqiswhen0=ifdin=d(7)thenq=1;elseq=0;endif;when1=ifdin=d(6)thenq=2;elseq=0;endif;when2=ifdin=d(5)thenq=3;elseq=0;endif;when3=ifdin=d(4)thenq=4;elseq=0;endif;when4=ifdin=d(3)thenq=5;elseq=0;endif;when5=ifdin=d(2)thenq=6;elseq=0;endif;when6=ifdin=d(1)thenq=7;elseq=0;endif;when7=ifdin=d(0)thenq=8;elseq=0;endif;whenothers=q=0;endcase;endif;endprocess;process(q)beginifq=8thenab=“1010〞;elseab=“1011〞;endif;endprocess;endbehv;仿真结果:
提高型试验:
试验六
用vhdl实现数字钟及校园打铃系统(6课时)
一、试验目的及要求:
1、把握vhdl语言的基本结构及编程思想。
2、把握vhdl语言的进行系统设计的方法和步骤。
3、提高学生综合应用能力。
二、试验内容:
1、用vhdl实现数字钟及校园打铃系统的软件编辑。
2、用vhdl实现数字钟及校园打铃系统的软件仿真。
三、试验步骤
1、用vhdl编辑60进制计数器,并进行软件仿真。
2、用vhdl编辑24进制计数器,并进行软件仿真。
3、用vhdl编辑30进制计数器,并进行软件仿真。
4、用元件例化的方法实现数字钟的软件编辑及软件仿真。
5、实现数字钟的校时功能。
6、实现数字钟的打铃功能。
7、完成数字钟及校园打铃系统的试验报告。
试验七
a/d采样控制器设计
一、试验目的及要求:
1、把握vhdl语言的基本结构及编程思想。
2、把握a/d采样控制器的工作原理。
3、把握a/d采样控制器的vhdl语言编程方法。
二、试验内容:
1、设计一a/d0809模数转换器控制器。
2、将转换结果送数码管显示器显示(2位)。
3、模拟输入通道为in0。
三、试验步骤:
1、adc0809特点介绍
(1)、单极性输入,8位a/d转换精度。(2)、逐次迫近式,每次采样时间约为100us(3)、8通道模拟输入
2、a/d转换器外部引脚功能结构图
3、a/d转换器时序图
4、ad转换控制器与ad转换器的接口电路框图
5、状态控制
s0状态:初始状态。addc=‘1’,选择1通道模拟信号输入。
ale=start=oe=lock=‘0’;
s1状态:通道锁存。ale=‘1’,start=oe=lock=‘0’;
s2状态:启动a/d转换。ale=‘1’,start=‘1’,oe=lock=‘0’;s3状态:a/d转换等待状态。
ale=start=‘0’,oe=lock=‘0’;
ifeoc=‘0’
保持当前状态不变,继续等待a/d转换。
else
转换终止,进入下一状态。
s4状态:数据输出允许状态。a/d转换完毕,开启数据输出允许信号。
ale=‘0’,start=‘0’,oe=‘1’,lock=‘0’;
s5状态:数据锁存状态。开启数据锁存信号,将转换结果送锁存器锁存。
ale=‘0’,start=‘0’,oe=‘1’,lock=‘1’;s6状态:延时状态。为了保证数据可靠锁存,延时一个时钟状态周期。
ale=‘0’,start=‘0’,oe=‘1’,lock=‘1’;其它状态:返回到初始状态。ale=start=oe=lock=‘0’;
6、参考程序:libraryieee;use;entityad0809is
port(d:instd_logic_vector(7downto0);
clk0,eoc:instd_logic;
adda,oe:outstd_logic;
ale,start:outstd_logic;
q:outstd_logic_vector(7downto0);
:outintegerrange15downto0);endad0809;architecturebehavofad0809is
typest_typeis(s0,s1,s2,s3,s4,s5,s6,s7);
signalcurrent_state,next_state:st_type;
signalregl:std_logic_vector(7downto0);
signallock:std_logic;
begin
adda='1';
pro:process(current_state,eoc)
begin
casecurrent_stateis
whens0==0;ale='0';start='0';oe='0';lock='0';next_state=s1;
whens1==1;ale='0';start='0';oe='0';lock='0';next_state=s2;
whens2==2;ale='1';start='1';oe='0';lock='0';next_state=s3;
whens3==3;ale='1';start='1';oe='0';lock='0';
ifeoc='0'thennext_state=s4;
elsenext_state=s3;
endif;
whens4==4;ale='0';start='0';oe='0';lock='0';
ifeoc='1'thennext_state=s5;
elsenext_state=s4;
endif;
whens5==5;ale='0';start='1';oe='1';lock='0';next_state=s6;
whens6==6;ale='0';start='0';oe='1';lock='1';next_state=s7;
whens7==7;ale='0';start='0';oe='1';lock='1';next_state=s0;
whenothers=next_state=s0;
endcase;
endprocesspro;reg:process(clk0)
begin
ifclk0'eventandclk0='1'then
current_state=next_state;
endif;
endprocessreg;
com:process(lock)
begin
iflock'eventandlock='1'then
regl=d;
endif;
endprocesscom;
q=regl;endbehav;
试验八
数字频率计设计
一、试验目的及要求:
1、把握vhdl语言的基本结构及编程思想。
2、把握数字频率计的工作原理。
3、把握数字频率计的vhdl语言编程方法。
二、试验内容:
1、设计8位十进制数字频率计。
2、测量频率范围为1hz-50mhz
三、试验原理:测频原理框图
四、试验步骤1、8位十进制计数器设计
(1)用vhdl设计十进制计数器,并进行软件和硬件仿真参考程序如下:libraryieee;use;use;entitycnt10is
port(clk,rst,en:instd_logic;
cq:outstd_logic_vector(3downto0);
cout:outstd_logic);
endcnt10;architecturebehavofcnt10isbegin
process(clk,rst,en)
variablecqi:std_logic_vector(3downto0);
begin
ifrst='1'then
cqi:=(others='0');--计数器复位
elsifclk'eventandclk='1'then
--检测时钟上升沿
ifen='1'then
--检测是否允许计数
ifcqi“1001〞then
cqi:=cqi+1;--允许计数
else
cqi:=(others='0');--大于9,计数值清零
endif;
endif;
endif;
ifcqi=“1001〞thencout='1';--计数大于9,输出进位信号
else
cout='0';
endif;
cq=cqi;
--将计数值向端口输出
endprocess;endbehav;(2)8位十进制频率计电路图2、32位锁存器设计参考程序
libraryieee;use;use;entityreg32bis
port(load:instd_logic;
din:instd_logic_vector(31downto0);
dout:outstd_logic_vector(31downto0));
endreg32b;architecturebehavofreg32bisbegin
process(load,din)
begin
ifload'eventandload='1'then
dout=din;
endprocess;endbehav;3控制器设计
(1)控制器时序图
(2)参考程序libraryieee;use;use;entitytestctlis
port(clk:instd_logic;
tsten:out
std_logic;
clr_cnt:out
std_logic;
load:out
std_logic);
endtestctl;architecturebehavoftestctlis
signaldiv2clk:std_logic;begin
process(clk)
begin
ifclk'eventandclk='1'then
div2clk=notdiv2clk;
endprocess;
process(clk,div2clk)
begin
ifclk='0'anddiv2clk='0'
then
clr_cnt='1';
elseclr_cnt='0';
endif;
endprocess;
load=notdiv2clk;
tsten=div2clk;endbehav;
endif;endif;
试验九
dac接口电路与波形发生器设计
一、试验目的及要求:
1、把握vhdl语言的基本结构及编程思想。
2、把握da转换器接口方法。
3、把握da转换器的vhdl语言编程方法。
二、试验内容:
1、设计一dac0832数模转换器控制器。
2、要求使用dac转换器输出一正弦波,最大值为5v。(使用单缓冲方式)
3、要求正弦波频率能步进可调,步进间隔为100hz。(使用2个按键控制,一个步进为加,另一个为步进减)
三、试验原理
1、dac0832特点(1)、8位电流dac转换,输出为电流信号,因此要转换为电压输出,必需外接集成运算放大器。(2)、转换时间约为50500ns,转换速度比电压型dac转换器快,电压型一般为110us(3)、20脚双列直插式封装的cmos型器件。(4)、内部具有两极数据寄放器,可采用单或双缓冲方式。
2、d/a转换器外部引脚功能及内部结构图
3、工作方式
方式一:直通工作方式(本试验采用此种方式)
一般用于只有一路输出信号的状况。
接线状况:ile=1,cs=wr1=wr2
=xfer=0方式
二、双缓冲器工作方式
采用两步操作完成,可使da转换输出前一数据的同时,将采集下一个数据送到8位输入寄放器,以提高转换速度。
一般用于多路da输出。
4、da转换器与控制器接口电路设计
5、试验仪实际接口电路图
6、da转换器输出波形步进可调控制电路设计设计思想:
设输入控制器的时钟频率为50mhz。
1、da转换一次,需要一个时钟周期。若采用64点输出,则需要64个时钟周期。假使控制器时钟频率为64hz,则输出的正弦波频率为1hz。
2、因此,只需要控制da转换控制器的时钟频率,则就可以控制正弦波频率,正弦波频率与时钟频率的关系为1:64。
3、题目要求正弦波步进频率为100hz,则时钟频率步进应为6400hz。按“加〞键,则时钟频率增加6400hz,按“减〞减,时钟频率减小6400hz。
7、带按键控制da转换器与控制器接口电路设计
四、试验程序参考程序:
libraryieee;use;entitydac0832is
port(clk:instd_logic;
dd:outintegerrange255downto0);enddac0832;architecturebehavofdac0832issignalq:integerrange63downto0;signald:integerrange255downto0;begin
process(clk)
begin
ifclk'eventandclk='1'thenq=q+1;
endif;
endprocess;process(q)
begin
caseq
is
when00=d=254;when01=d=252;when02=d=249;when03=d=245;
when04=d=239;when05=d=233;when
06=d=225;when
07=d=217;
when08=d=207;when09=d=197;when
10=d=186;when
11=d=174;
when12=d=162;when13=d=150;when14=d=137;when
15=d=124;
when16=d=112;when17=d=99;when18=d=87;
when
19=d=75;
when20=d=64;when
21=d=53;when22=d=43;
when23=d=34;
when24=d=26;when25=d=19;when
26=d=13;
when
27=d=8;
when28=d=4;
when
29=d=1;
when30=d=0;
when
31=d=0;
when32=d=1;when33=d=4;
when34=d=8;
when35=d=13;when36=d=19;when37=d=26;
when38=d=34;
when
39=d=43;
when40=d=53;when
41=d=64;when42=d=75;
when
43=d=87;
when44=d=99;when45=d=112;when46=d=124;when
47=d=137;
when48=d=150;when49=d=162;when50=d=255;when51=d=174;
when52=d=186;when53=d=197;when54=d=207;when55=d=217;
when56=d=225;when57=d=233;when58=d=239;when
59=d=245;
when60=d=249;when61=d=252;when62=d=254;when63=d=255;whenothers=null;endcase;endprocess;
dd=d;
end;
试验十
七段显示器动态扫描电路设计(提高型)
试验目的及要求:
1、把握vhdl语言的基本结构及编程思想。
2、把握七段显示器动态扫描电路设计方法。设计要求:
1、设计一个七段数码管动态扫描电路。
2、数码管个数为8个,共阴极接法。
3、设计bcd码--七段字符码的转换电路;
4、设计一电路,控制上述电路实现“12345678〞八个数字的显示,要求显示方式为:
(1)自左至右逐个点亮数码管,最终全亮;再重复以上动作,每次变化时间间隔为1秒。
(2)自左至右点亮数码管,每次只点亮一个,最终全息灭,再重复以上动作,每次变化时间间隔为1秒。
(3)先中间两个点亮,再依次向外点亮;全亮后,再依次向中间熄灭;重复上述步骤,每次变化时间间隔为1秒。一、七段显示器动态扫描电路设计框图
二、存储器设计(8位8字节静态随机存储器sram)libraryieee;
use;entitymemo_rd_wrisport(wr,rd:instd_logic;
a:instd_logic_vector(2downto0);
b:instd_logic_vector(2downto0);
d:instd_logic_vector(7downto0);
q:outstd_logic_vector(7downto0));endmemo_rd_wr;architectureaofmemo_rd_wris
signalq0,q1,q2,q3:std_logic_vector(7downto0);
signalq4,q5,q6,q7:std_logic_vector(7downto0);beginprocess(wr,a)
begin
ifwr='1'then
case
a
is
when“000〞=q0=d;
when“001〞=q1=d;
when“010〞=q2=d;
when“011〞=q3=d;
when“100〞=q4=d;
when“101〞=q5=d;
when“110〞=q6=d;
when“111〞=q7=d;
whenothers=null;
endcase;
endif;
endprocess;process(rd,b)
begin
ifrd='1'then
case
b
is
when“000〞=q=q0;
when“001〞=q=q1;
when“010〞=q=q2;
when“011〞=q=q3;
when“100〞=q=q4;
when“101〞=q=q5;
when“110〞=q=q6;
when“111〞=q=q7;
whenothers=null;
endcase;
endif;
endprocess;enda;
四、循环取数电路设计libraryieee;
use;entityget_codeisport(clk1:instd_logic;
d:instd_logic_vector(7downto0);
rd:outstd_logic;
a:outstd_logic_vector(2downto0);
dout:outstd_logic_vector(7downto0));endget_code;architectureaofget_code
is
signalload:std_logic;
signal:std_logic_vector(7downto0);
signalnum:integerrange7downto0;begin
rd=„1‟;
load=clk1;process(clk1)
begin
ifclk1'eventandclk1='1'then
ifnum=7
then
num=num+1;
elsenum=0;
endif;
endif;endprocess;process(num)
begin
casenumis
when0=a=“000〞;
when1=a=“001〞;
when2=a=“010〞;
when3=a=“011〞;
when4=a=“100〞;
when5=a=“101〞;
when6=a=“110〞;
when7=a=“111〞;
whenothers=null;
endcase;
endprocess;process(load)
begin
ifload„eventandload=„1‟
then上升沿锁存
=d;
endif;endprocess;dout(7downto0)=(7downto0);enda;
五、扫描控制器设计libraryieee;
use;entityscan_8isport(clk2:instd_logic;
c:outstd_logic_vector(7downto0));
endscan_8;architectureaofscan_8
is
signalnum:integerrange7downto0;beginprocess(clk2)
begin
ifclk2'eventandclk2=‘1'then
ifnum=7
then
num=num+1;
elsenum=0;
endif;
endif;endprocess;process(num)
begin
case
num
is
when1=c=“11111110〞;when2=c=“11111101〞;
when3=c=“11111011〞;when4=c=“11110111〞;
when5=c=“11101111〞;when6=c=“11011111〞;
when7=c=“10111111〞;when0=c=“01111111〞;
when
others=null;
endcase;endprocess;enda;
应用实例一:显示“01234567〞八个数字
libraryieee;
use;entitydisp_dataisport(clk:instd_logic;
wr:outstd_logic;
a:outstd_logic_vector(2downto0);
q:outstd_logic_vector(7downto0));enddisp_data;architectureaofdisp_data
is
--signal:std_logic_vector(7downto0);
signalnum:integerrange7downto0;begin
wr=„1‟;process(clk)
begin
ifclk'eventandclk='1'then
ifnum=7
then
num=num+1;
elsenum=0;
endif;
endif;endprocess;process(num)
begin
casenumis
when0=q=“00111111〞;a=“000〞;
when1=q=“00000110〞;a=“001〞;
when2=q=“01011011〞;a=“010〞;
when3=q=“01001111〞;a=“011〞;
when4=q=“01100110〞;a=“100〞;
when5=q=“01101101〞;a=“101〞;
when6=q=“01111101〞;a=“110〞;
when7=q=“01111111〞;a=“111〞;
whenothers=null;
endcase;endprocess;enda;试验十一
彩灯控制器设计(提高型试验)
试验目的及要求:
1、把握vhdl语言的基本结构及编程思想。
2、把握vhdl语言的进行系统设计的方法和步骤。
3、培养学生综合应用能力。试验内容:
1、了解各类节日彩灯的显示方式(主要是动态方式)(上街观测);
2、将你所了解的状况,画出你的设计思想框图;
3、根据框图画出电路框图(用eda技术);
4、用vhdl语言编程实现;
5、完成课程设计报告(约2000字)
试验
十二、红绿交通灯控制系统
试验目的及要求:
1、把握vhdl语言的基本结构及编程思想。
2、把握vhdl语言的进行系统设计的方法和步骤。
3、培养学生综合应用能力。试验内容:
设计一个简易十字路口交通灯控制器。要求:
1、每个路口有红、绿、黄三个指示灯指示交通运行状况。红灯亮,阻止车辆通行;绿灯亮,车辆正常通行。
2、利用两位数码管显示通行到计时时间。
3、用vhdl语言编程实现;
4、完成课程设计报告试验步骤:
1、红绿黄灯秒计数选择控制电路(traffic_mux)sing_state:
00
绿灯20秒(横向路口);
01
黄灯5秒(横向路口)
绿灯20秒(直向路口)
黄灯5秒(直向路口)
recount:重新计数信号。=„1‟,发送倒计时时间数据;=„0‟,正常倒计时;libraryieee;
use;use;
use;entitytraffic_muxis
port(reset,clk_1hz,recount:instd_logic;
sign_state:instd_logic_vector(1downto0);
load:outintegerrange255downto0);end;
begin
process(reset,clk_1s)
begin
ifreset='1'then
load=“00000000〞;
elsif(clk_1hz'eventandclk_1hz='1')
then
if
recount='1‘
then
casesign_stateis
when“00〞=load=20;
when“01〞=load=5;
when“10〞=load=20;
when“01〞=load=5;
whenothers=null;
endcase;
endif;
endif;endprocess;endbehavior;
2、倒计时控制电路(count_down)libraryieee;use;use;use;entitycount_downisport(reset,clk_1hz:instd_logic;recount:instd_logic;load:inintegerrange255downto0;seg7:outstd_logic_vector(15downto0);next_state:outstd_logic);end;architecturebehaviorofcount_downissignalcnt_ff:integerrange255downto0;beginprocess(clk_1hz,reset)beginif(reset='1')thencnt_ff=“00000000〞;seg7=“***0〞;elsif(clk_1hz'eventandclk_1hz='1')thenifrecount='1‘thencnt_ff=load-1;elsecnt_ff=cnt_ff-1;endif;endif;endprocess;process(cnt_ff)begincasecnt_ffiswhen0=seg7=“***1〞;when1=seg7=“***0〞;when2=seg7=“***1〞;when3=seg7=“***1〞;when4=seg7=“***0〞;when5=seg7=“***1〞;when6=seg7=“***1〞;when7=seg7=“***1〞;when8=seg7=“***1〞;when9=seg7=“***1〞;when10=seg7=“***1〞;when11=seg7=“***0〞;when12=seg7=“***1〞;when13=seg7=“***1〞;when14=seg7=“***0〞;when15=seg7=“***1〞;when16=seg7=“***1〞;when17=seg7=“***1〞;when18=seg7=“***1〞;when19=seg7=“***1〞;when20=seg7=“***1〞;when21=seg7=“***0〞;when22=seg7=“***1〞;when23=seg7=“***1〞;when24=seg7=“***0〞;when25=seg7=“***1〞;when26=seg7=“***1〞;when27=seg7=“***1〞;when28=seg7=“***1〞;when29=seg7=“***1〞;whenothers=seg7=“***1〞;endcase;endprocess;next_state='1'whencnt_ff=1else'0';endbehavior;
3、红绿灯信号控制电路(traffic_fsm)libraryieee;use;use;use;entitytraffic_fsmisport(reset,clk,clk_1hz,flash_1hz:instd_logic;a_m:instd_logic;next_state:instd_logic;recount:outstd_logic;sign_state:outstd_logic_vector(1downto0);red:outstd_logic_vector(1downto0);green:outstd_logic_vector(1downto0);yellow:outstd_logic_vector(1downto0));end;architecturebehavioroftraffic_fsmistypesreg0_typeis(r0g1,r0y1,g0r1,y0r1,y0y1,y0g1,g0y1,r0r1);signalstate:sreg0_type;signallight:std_logic_vector(5downto0);beginif(reset='1')thenstate=r0g1;
设定当前为横向红灯亮,竖向绿灯亮sign_state=“01〞;选择20秒倒计时
recount=‘1’;装入计数初值并启动倒计时elseif(clk'eventandclk='1')thencasestateiswhenr0g1=if(a_m='1'andclk_1hz='1')thenif(next_state=‘1’)then--当前计数完毕,转入下一种计时
recount='1';state=r0y1;sign_state=“01〞;elserecount=‘0’;state=r0g1;否则,继续倒计时endif;whenr0y1=--nowstate:red0onyellow1flashif(a_m='1'andclk_1hz='1')thenif(next_state='1')thenrecount='1';state=g0r1;sign_state=“10〞;elserecount='0';state=r0y1;endif;wheng0r1=--nowstate:green0onred1onif(a_m='1'andena_1hz='1')thenif(next_state='1')thenrecount='1';state=y0r1;sign_state=“11〞;elserecount='0';state=g0r1;endif;wheny0r1=--nowstate:green0onred1onif(a_m='1'andena_1hz='1')thenif(next_state='1')thenrecount='1';state=r0g1;sign_state=“00〞;elserecount='0';state=y0r1;--red=2'b10;green=2'b00;yellow=2'b01;endif;whenothers=state=r0g1;recount='0';sign_state=“00〞;endcase;endif;endif;endprocess;--light:r(10)y(10)g(10)light=“010010〞when(state=r0g1)else“011000〞when(state=r0y1)else“100001〞when(state=g0r1)else“100100〞when(state=y0r1)else“110000〞;red=light(5downto4);yellow=light(3downto2)and(flash_1hzflash_1hz);green=light(1downto0);endbehavior;
EDA试验总结EDA试验收获与体会篇二
试验四计数器与七段译码器及显示的设计
一试验目的
1、把握七段译码器的工作原理;
2、学会用vhdl硬件描述语言进行数字系统设计;
3、学会运用波形仿真测试检验程序的正确性;
4、用quartusii完成基本组合电路的设计。
二试验仪器
pc机、quartusii6.0软件、康芯eda试验箱
三试验内容
选gw48系统的试验电路模式6,用数码8显示译码输出(pio46-pio40),键3到键8作为控制输入端。完成计数器的数码管显示设计。
四试验原理及步骤
7段数码是纯组合电路,寻常的小规模专用ic,如74或4000系列的器件只能作十进制bcd码译码,然而数字系统中的数据处理和运算都是2进制的,所以输出表达都是16进制的,为了满足16进制数的译码显示,最便利的方法就是利用译码程序在fpga/cpld中来实现。例6-18作为7段译码器,输出信号led7s的7位分别接如图6-2数码管的7个段,高位在左,低位在右。例如当led7s输出为“1101101〞时,数码管的7个段:g、f、e、d、c、b、a分别接1、1、0、1、1、0、1;接有高电平的段发亮,于是数码管显示“5〞。注意,这里没有考虑表示小数点的发光管,假使要考虑,需要增加段h,例6-18中的led7s:outstd_logic_vector(6downto0)应改为...(7downto0)。
1、根据译码器真值表写出原程序。
译码器真值表:
数
输入
输出
值a
bcdabcdefg00000111111010001011000020010110110130011111100140100011001150101101101160110101111101111110000810001111111910011111011a0101110111b10110011111c11001001110d11010111101e11101001111f11111000111
三、试验内容:
1、说明以下程序中各语句的含义,以及该例的整体功能。在quartusii6.0上对以下该例进行编辑、编译、综合、适配、仿真,给出其所有信号的时序仿真波形(提醒:用输入总线的方式给出输入信号仿真数据)。
libraryieee;use;entitydecl7sisport(a:instd_logic_vector(3downto0);led7s:outstd_logic_vector(6downto0));end;architectureoneofdecl7sisbeginprocess(a)begincasea(3downto0)iswhen“0000〞=led7s=“0111111〞;--x“3f〞0when“0001〞=led7s=“0000110〞;--x“06〞1when“0010〞=led7s=“1011011〞;--x“5b〞2when“0011〞=led7s=“1001111〞;--x“4f〞3when“0100〞=led7s=“1100110〞;--x“66〞4when“0101〞=led7s=“1101101〞;--x“6d〞5when“0110〞=led7s=“1111101〞;--x“7d〞6when“0111〞=led7s=“0000111〞;--x“07〞7when“1000〞=led7s=“1111111〞;--x“7f〞8when“1001〞=led7s=“1101111〞;--x“6f〞9when“1010〞=led7s=“1110111〞;--x“77〞10when“1011〞=led7s=“1111100〞;--x“7c〞11when“1100〞=led7s=“0111001〞;--x“39〞12when“1101〞=led7s=“1011110〞;--x“5e〞13when“1110〞=led7s=“1111001〞;--x“79〞14when“1111〞=led7s=“1110001〞;--x“71〞15whenothers=null;endcase;endprocess;end;
图3-1共阴数码管及其电路
2、引脚锁定以及硬件下载测试。建议选试验电路模式6,用数码8显示译码输出(pio46--pio40),键
8、键
7、键
6、键5四位控制输入,硬件验证译码器的工作性能。
3、用vhdl完成四位二进制加法计数器设计,命名为cnt4b.4、用vhdl例化语句(参考试验1中的1位全加vhdl文本输入设计)按图3-2的方式,完成顶层文件设计,并重复以上试验过程。注意图3-2中的tmp是4位总线,led是7位总线。对于引脚锁定和试验,建议仍选试验电路模式6,用数码8显示译码输出,用键3作为时钟输入(每按2次键为1个时钟脉冲),或直接时钟信号clock0。
图3-2计数器和译码器连接电路的顶层文件原理图
(提醒:
1、将教材p89页程序和p154页程序读懂,分别建立工程、生成各自原理图。
2、将上述两个原理图按教材p155页图6-19连接起来建立新的原理图设计文件。
3、将上述原理图文件编译、仿真、引脚绑定,下载到试验箱验证。)
四、试验报告要求
1、总结quartusii6.0vhdl中case语句应用及多层次设计方法
2、根据以上的试验内容写出试验报告,包括程序设计、软件编译、仿真分析、硬件测试和试验过程;设计程序、程序分析报告、仿真波形图及其分析报告;
3、心得体会――本次试验中你的感受;你从试验中获得了哪些收益;本次试验你的成功之处;本次试验中还有待改进的地方;下次试验应当从哪些地方进行改进;怎样提高自的试验效率和试验水平等等。
五、问题与思考:
只要求译出数字0~9和“-〞,怎样修改程序?
EDA试验总结EDA试验收获与体会篇三
数字eda试验报告薛蕾0941903207
数字eda试验试验报告
学院:计算机科学与工程学院专业:通信工程学号:0941903207姓名:薛蕾指导老师:钱强
数字eda试验报告薛蕾0941903207试验一四选一数据选择器的设计
一、试验目的
1、熟悉quartusii软件的使用。
2、了解数据选择器的工作原理。
3、熟悉eda开发的基本流程。
二、试验原理及内容
试验原理
数据选择器在实际中得到了广泛的应用,特别是在通信中为了利用多路信号中的一路,可以采用数据选择器进行选择再对该路信号加以利用。从多路输入信号中选择其中一路进行输出的电路称为数据选择器。或:在地址信号控制下,从多路输入信息中选择其中的某一路信息作为输出的电路称为数据选择器。数据选择器又叫多路选择器,简称mux。4选1数据选择器:
(1)原理框图:如右图。
d0、d1、d2、d3
:输入数据a1、a0
:地址变量
由地址码决定从4路输入中选择哪1路输出。
(2)真值表如下图:(3)规律图
数据选择器的原理比较简单,首先必需设置一个选择标志信号,目的就是为了从多路信号中选择所需要的一路信号,选择标志信号的一种状态对应着一路信号。在应用中,设置一定的选择标志信号状态即可得到相应的某一路信号。这就是数据选择器的实现原理。
三.试验内容
1、分别采用原理图和vhdl语言的形式设计4选1数据选择器
2、对所涉及的电路进行编译及正确的仿真。电路图:
四、试验程序
libraryieee;use;
entitymux4is
port(a0,a1,a2,a3:instd_logic;
s:instd_logic_vector(1downto0);
y:outstd_logic);endmux4;architecturearchmuxofmux4is
beginy=a0whens=“00〞else
--当s=00时,y=a0a1whens=“01〞else
--当s=01时,y=a1a2whens=“10〞else
--当s=10时,y=a2a3;
--当s取其它值时,y=a2endarchmux;
五、运行结果
六.试验总结
真值表分析:
当js=0时,a1,a0取00,01,10,11时,分别可取d0,d1,d2,d3.试验二血型配对器的设计
一、试验目的
1、进一步熟悉quartusii软件的使用。
2、把握简单组合规律电路的设计方法与功能仿真技巧。
3、进一步学习quartusii中基于原理图设计的流程。
二、试验原理及内容
试验原理
人类有o、a、b、ab4种基本血型,输血者与受血者的血型必需符合图示原则。设计一血型配对电路,用以检测输血者与受血者之间的血型关系是否符合,假使符合,输出为1,否则为0。
已知:ab血型是万能受血者,o血型是万能献血者!假使要输血给o型血,那么可以的血型是o型!假使要输血给a型血,那么可以的血型是a,o型!假使要输血给b型血,那么可以的血型是b,o型!
假使要输血给ab型血,那么可以的血型是a,b,ab,o型!
输血者
受血者
oa
oabab
bab
三.试验内容
1、用vhdl语言编写程序实现血型配对器的功能libraryieee;use;use;use;entityuexingisport(p,q,r,s:instd_logic;f:outstd_logic);enduexing;architectureaofuexingisbegin
f=((notp)and(notq))or(rands)or((notp)ands)or((notq)andr);enda;
2、对所编写的电路进行编译及正确的仿真。
试验分析真值表
pqrsf***************11111
p,q表示输血者的血型;r,s,表示受血者的血型。当两者符合血型协同原则时,f=1,否则为0.四、运行结果
五、试验总结
本试验给出了四种不同的血型编码,pq(1,1),rs(1,1)表示ab型血,p,q(1,0),rs(1,0)表示b型血,pq(0,1),rs(0,1)表示a型血,pq(0,0),rs(0,0)表示o型血。根据真值表,并根据试验的原理图,画出电路图并进行连接。
试验三简单数字钟的设计
一、试验目的
1、了解数字钟的工作原理。
2、进一步学习quartusii中基于vhdl设计的流程。
3、把握vhdl编写中的一些小技巧。
4、把握简单时序规律电路的设计方法与功能仿真技巧。
二、试验原理及内容
试验原理
简单数字钟应当具有显示时-分-秒的功能。首先要知道钟表的工作机理,整个钟表的工作应当是在1hz信号的作用下进行,这样每来一个时钟信号,秒增加1秒,当秒从59秒跳转到00秒时,分钟增加1分,同时当分钟从59分跳转
三.试验内容
1、用原理图的方式编写一个12/24进制的计数器,并创立为symbol文件。
2、用vhdl的方式编写一个60进制的计数器,并创立为symbol文件。
3、创立顶层文件。调用已编写的symbol文件,设计简单的数字钟电路。
2、对所编写的电路进行编译及正确的仿真。
二十四进制vhdllibraryieee;use;use;use;entitycnt24isport(cp,en,rd,ld:instd_logic;
d
:instd_logic_vector(5downto0);
co
:outstd_logic;q
:outstd_logic_vector(5downto0));endcnt24;architecturestrofcnt24is
signalqn:std_logic_vector(5downto0);
beginco='1'when(qn=“010111〞anden='1')
else'0';process(cp,rd)
beginif(rd='0')then
qn=“000000〞;elsif(cp'eventandcp='1')thenif(ld='0')thenqn=d;
elsif(en='1')thenqn=qn+1;endif;endif;endprocess;q=qn;endstr;
六十进制vhdllibraryieee;use;use;use;entityjsq60isport(en,rd,cp:instd_logic;
qh:bufferstd_logic_vector(3downto0);
ql:bufferstd_logic_vector(3downto0);
co:outstd_logic);endjsq60;architecturebofjsq60isbeginco='1'when(qh=“0101〞andql=“1001〞anden='1')else'0';process(cp,rd)
beginif(rd='0')thenqh=“0000〞;ql=“0000〞;elsif(cp'eventandcp='1')then
if(en='1')then
if(ql=9)then
ql=“0000〞;
if(qh=5)then
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 影响愈合的生物学因素
- 企业培训课件分享模板
- 婴幼儿保育职业素养考核试题及答案
- 英语阅读难句分析之定语从句
- 城市综合体餐饮区承包经营合同
- 采石场矿山环境保护与劳务合作合同
- 国际化产业园厂房租赁合作协议
- 财务公司财务软件保密及用户隐私保护协议
- 防用房建设方案
- 早餐店标准化经营承包合同
- 瓷砖加工费协议合同
- 名创优品加盟合同协议
- GB 7718-2025食品安全国家标准预包装食品标签通则
- GB/T 45403-2025数字化供应链成熟度模型
- QGDW11337-2023输变电工程工程量清单计价规范
- 生活垃圾焚烧发电厂自动监测设备运行维护技术规范
- 病区安全管理工作
- 血管加压药物在急诊休克中的应用专家共识2021解读课件
- 《超高强度钢》课件
- 《个人信息保护法》知识考试题库150题(含答案)
- 供应室职业暴露与防护知识
评论
0/150
提交评论