EDA实验报告00121184.docx
- 文档编号:9737315
- 上传时间:2023-02-06
- 格式:DOCX
- 页数:56
- 大小:3.21MB
EDA实验报告00121184.docx
《EDA实验报告00121184.docx》由会员分享,可在线阅读,更多相关《EDA实验报告00121184.docx(56页珍藏版)》请在冰豆网上搜索。
EDA实验报告00121184
山东大学信息科学与工程学院
EDA实验报告
********
学号:
201*********
班级:
电信工一班
2016.5.31
实验14选1数据选择器的设计
一、实验目的
1.学习EDA软件的基本操作。
2.学习使用原理图进行设计输入。
3.初步掌握器件设计输入、编译、仿真和编程的过程。
4.学习实验开发系统的使用方法。
二、实验仪器与器材
1.EDA开发软件一套
2.微机一台
3.实验开发系统一台
4.打印机一台
三、实验说明
本实验通过使用基本门电路完成4选1数据选择器的设计,初步掌握EDA设计方法中的设计输入、编译、综合、仿真和编程的过程。
实验结果可通过实验开发系统验证,在实验开发系统上选择高、低电平开关作为输入,选择发光二极管显示输出电平值。
本实验使用QuartusII软件作为设计工具,要求熟悉QuartusII软件的使用环境和基本操作,如设计输入、编译和适配的过程等。
实验中的设计文件要求用原理图方法输入,实验时,注意原理图编辑器的使用方法。
例如,元件、连线、网络名的放置方法和放大、缩小、存盘、退出等命令的使用。
学会管脚锁定以及编程下载的方法等。
四、实验要求
1.完成4选1数据选择器的原理图输入并进行编译;
2.对设计的电路进行仿真验证;
3.编程下载并在实验开发系统上验证设计结果。
实验程序:
libraryieee;
useieee.std_logic_1164.all;
entitymux4is
port(input:
instd_logic_vector(3downto0);
sel:
instd_logic_vector(1downto0);
y:
outstd_logic);
endmux4;
architecturertlofmux4is
begin
process(sel,input)
begin
ifsel=“00”then
y<=input(0);
elsifsel=“01”then
y<=input
(1);
elsifsel=“10”then
y<=input
(2);
else
y<=input(3);
endif;
endprocess;
endrtl;
实验结果
4选1数据选择器的截图:
仿真波形图:
实验2四位比较器
一、实验目的
1.设计四位二进制码比较器,并在实验开发系统上验证。
2.学习层次化设计方法。
二、实验仪器与器材
1.EDA开发软件一套
2.微机一台
3.实验开发系统一台
4.打印机一台
5.其它器件与材料若干
三、实验说明
本实验实现两个4位二进制码的比较器,输入为两个4位二进制码
和
,输出为M(A=B),G(A>B)和L(A
四、实验要求
1.用硬件描述语言编写四位二进制码
比较器的源文件;
2.对设计进行仿真验证;
3.编程下载并在实验开发系统上进行硬件验证
实验程序
libraryieee;
useieee.std_logic_1164.all;
useieee.std_logic_arith.all;
useieee.std_logic_unsigned.all;
entityvhdl_cmpis
port(A:
instd_logic_vector(3downto0);
B:
instd_logic_vector(3downto0);
m,g,l:
outstd_logic);
endvhdl_cmp;
architecturebehaveofvhdl_cmpis
begin
p1:
process(A,B)
begin
if(A>B)then
G<='1';M<='0';L<='0';elsif(A
G<='0';M<='0';L<='1';elsif(A=B)then
G<='0';M<='1';L<='0';else
G<='1';M<='1';L<='1';endif;
endprocessp1;
endbehave;
实验结果
仿真波形图:
功能:
时序仿真:
管脚分配:
实验3并行加法器设计
一、试验目的
1.设计一个4位加法器。
2.体会用VHDL进行逻辑描述的优点。
3,熟悉层次化设计方法。
二、试验仪器与器材
1.EDA开发软件一套
2.微机一台
3.试验开发系统一台
4.打印机一台
5.其他器材和材料若干
三、试验说明
本试验实现一个4位二进制数加法器,其功能框图如图所示。
试验时用高低电平开关作为输入,用数码管作为输出(或用发光二极管),管脚锁定可根据试验系统自行安排。
四、实验要求
1.用硬件描述语言编写4位二进制数全加器的源文件;
2.对设计文件进行编译;
3.仿真设计文件;
4.编程下载并进行试验验证。
实验程序:
libraryieee;
useieee.std_logic_1164.all;
entityadd4is
port(a,b:
instd_logic_vector(3downto0);
cin:
instd_logic;
sum:
outstd_logic_vector(3downto0);
count:
outstd_logic);
endadd4;
architecturebehavioralofadd4is
begin
process(a,b,cin)
variablesum1:
std_logic_vector(3downto0);
variablecarry:
std_logic;
begin
carry:
=cin;
foriin0to3loop
sum1(i):
=(a(i)xorb(i))xorcarry;
carry:
=(a(i)andb(i))or(carryand(a(i)orb(i)));
endloop;
sum<=sum1;
count<=carry;
endprocess;
endbehavioral;
实验结果
仿真波形图:
管脚分配:
实验47人表决器
一.实验目的
学习表决器电路的设计方法并体会使用HDL进行设计的方法和优点。
二、实验仪器与器材
EDA开发软件一套
微机一台
实验开发系统一台
打印机一台
三、实验原理
用个开关作为表决器的7个输入变量,输入变量为‘1’时表示“赞同”;输入变量为‘0’时表示不赞同。
输出接到一二极管上,灯亮表示通过,灯不亮表示不同。
采用行为描述的设计,用一变量count表示选举通过的总人数,即7个开关中按下的总数,如果count>3,则表示通过。
实验程序:
libraryieee;
useieee.std_logic_1164.all;
useieee.std_logic_arith.all;
useieee.std_logic_unsigned.all;
entitysevenis
port(
a:
instd_logic_vector(6downto0);
y:
outstd_logic);
endseven;
architectureoneofsevenis
begin
process(a)
variablei:
std_logic_vector(2downto0);
begin
i:
="000";
forjin0to6loop
if(a(j)='1')theni:
=i+1;
elsei:
=i;
endif;
endloop;
译码程序:
libraryieee;
useieee.std_logic_1164.all;
useieee.std_logic_arith.all;
useieee.std_logic_unsigned.all;
entitymy_translateis
port(
a:
instd_logic_vector(3downto0);
rst:
std_logic;
dataout:
outstd_logic_vector(6downto0));
endmy_translate;
architectureoneofmy_translateis
begin
process(a)
begin
caseais
when"0000"=>dataout<="0000001";
when"0001"=>dataout<="1001111";
when"0010"=>dataout<="0010010";
when"0011"=>dataout<="0000110";
when"0100"=>dataout<="1001100";
when"0101"=>dataout<="0100100";
when"0110"=>dataout<="0100000";
when"0111"=>dataout<="0001111";
when"1000"=>dataout<="0000000";
when"1001"=>dataout<="0000100";
whenothers=>dataout<="1111111";
endcase;
endprocess;
endone;
ifi>3theny<='1';
elsey<='0';
endif;
endprocess;
endone;
实验结果
管脚分配:
时序仿真:
功能仿真
实验5计数器设计
一、实验目的
计数器是实际中最为常用的时序电路模块之一,本实验的主要目的是掌握使用HDL描述计数器类型模块的基本方法。
二、实验仪器与器材
1.EDA开发软件一套
2.微机一台
3.实验开发系统一台
4.打印机一台
5.其他器材与材料若干
三、实验说明
计数器是数字电路系统中最重要的功能模块之一,设计时可以采用原理图或HDL语言完成。
下载验证时的计数时钟可选连续或单脉冲,并用数码管显示计数值。
四、实验要求
1.设计一个带有计数允许输入端、复位输入端和进位输入端的十进制计数器。
2.编制仿真测试文件,并进行功能仿真。
3.下载并验证计数器功能。
4.为上述设计建立元件符号。
5.在上述基础上分别设计按8421BCD码和二进制计数的100进制同步计数器。
实验程序
十进制:
方法一:
libraryieee;
useieee.std_logic_1164.all;
useieee.std_logic_unsigned.all;
entitycnt10is
port(res:
instd_logic;
clkin:
instd_logic;
ep:
instd_logic;
cout:
outstd_logic;
sout:
outstd_logic_vector(3downto0));
endcnt10;
architecturebehaveofcnt10is
signalcount:
std_logic_vector(3downto0);
begin
process(res,clkin,ep)
begin
if(res='1')thencount<="0000";cout<='0';
elsif(ep='0'andrising_edge(clkin))
thenif(count="1001")
thencout<='1';count<="0000";
elsecount<=count+1;cout<='0';
endif;
endif;
endprocess;
sout<=count;
end;
方法二:
libraryieee;
useieee.std_logic_1164.all;
useieee.std_logic_unsigned.all;
entitycountisport(clk:
instd_logic;
clr:
instd_logic;en:
instd_logic;
q:
outstd_logic_vector(3downto0);
cin:
outstd_logic);
endcount;
architecturecountofcountissignalq0:
std_logic_vector(3downto0);
begin
q<=q0;
process(clk,clr)begin
if(clr='1')thenq0<="0000";
cin<='0';
elsif(clk'eventandclk='0')then
if(q0="1000")then
q0<=q0+1;
cin<='1';
elseq0<=q0+1;
cin<='0';
if(q0="1001")then
q0<="0000";
endif;
endif;
endif;
endprocess;
endcount;
七段译码管:
libraryieee;
useieee.std_logic_1164.all;
entityshumaguanis
port(data_in:
instd_logic_vector(3downto0);
data_out:
outstd_logic_vector(6downto0));
endshumaguan;
architecturebehaveofshumaguanis
begin
process(data_in)
begin
casedata_inis
when"0000"=>data_out<="1111111";
when"0001"=>data_out<="1111001";
when"0010"=>data_out<="0100100";
when"0011"=>data_out<="0110000";
when"0100"=>data_out<="0011001";
when"0101"=>data_out<="0010010";
when"0110"=>data_out<="1111111";
when"0111"=>data_out<="1111111";
when"1000"=>data_out<="1111111";
when"1001"=>data_out<="1111111";
when"1010"=>data_out<="1111111";
when"1011"=>data_out<="1111111";
when"1100"=>data_out<="1111111";
when"1101"=>data_out<="1111111";
when"1110"=>data_out<="1111111";
when"1111"=>data_out<="1111111";
endcase;
endprocess;
endbehave;
分频器:
LIBRARYIEEE;
USEIEEE.STD_LOGIC_1164.ALL;
USEIEEE.STD_LOGIC_UNSIGNED.ALL;
USEIEEE.STD_LOGIC_ARITH.ALL;
ENTITYcIS
GENERIC(N:
INTEGER:
=25);
PORT(
CLKIN:
INSTD_LOGIC;
CLKOUT:
OUTSTD_LOGIC
);
ENDc;
ARCHITECTUREAOFMY_EDA_fpinIS
SIGNALCNT:
STD_LOGIC_VECTOR(N-1DOWNTO0);
BEGIN
PROCESS(CLKIN)
BEGIN
IF(CLKIN'EVENTANDCLKIN='1')THEN
CNT<=CNT+1;
ENDIF;
ENDPROCESS;
CLKOUT<=CNT(N-1);
ENDA;
实验结果
十进制计数器原理图:
计数模块:
数码管模块
100进制计数器原理图:
管脚分配:
实验6巴克码发生器
一、实验目的
1.实现一个在通信领域中经常使用的巴克码发生器。
2.掌握用大规模可编程逻辑器件实现时序电路的方法。
二、实验仪器与器材
1.EDA开发软件一套
2.微机一台
3.实验开发系统一台
4.打印机一台
5.其它器件与材料若干
三、实验说明
巴克码发生器在数据通信、雷达和遥控领域有相当广泛的应用。
它能自动产生周期性的序列码。
本实验要求产生的序列码信号为(1110010),可以用寄存器或同步时序电路实现。
为了能够通过实验开发系统验证试验结果,可以使用两个输入端,其中一个输出端同时输出巴克码,另一个输出端输出节拍。
巴克码发生器的功能框图如图所示。
四、实验要求
1.写出全部设计文件。
2.编写测试向量,进行功能仿真。
3.下载到实验开发系统上进行验证。
实验程序
分频器
libraryieee;
useieee.std_logic_1164.all;
useieee.std_logic_unsigned.all;
useieee.std_logic_arith.all;
entityfre_devideris
generic(n:
integer:
=2500);
port(clkin:
instd_logic;
clkout:
outstd_logic);
endfre_devider;
architectureoneoffre_devideris
signalcounter:
integerrange0ton;
signalclk:
std_logic;
begin
process(clkin)
begin
if(rising_edge(clkin))then
if(counter=n)then
clk<=notclk;
counter<=0;
else
counter<=counter+1;
endif;
endif;
endprocess;
clkout<=clk;
endone;
巴克码发生器
libraryieee;
useieee.std_logic_1164.all;
useieee.std_logic_unsigned.all;
useieee.std_logic_arith.all;
entitybakemais
port(en,reset:
instd_logic;
clk:
instd_logic;
d:
outstd_logic;
q:
bufferstd_logic_vector(3downto0);
co,co2:
outstd_logic);
endbakema;
architectureoneofbakemais
begin
process(libraryieee;
useieee.std_logic_1164.all;
useieee.std_logic_unsigned.all;
useieee.std_logic_arith.all;
entityfre_devideris
generic(n:
integer:
=2500);
port(clkin:
instd_logic;
clkout:
outstd_logic);
endfre_devider;
architectureoneoffre_devideris
signalcounter:
integerrange0ton;
signalclk:
std_logic;
begin
process(clkin)
begin
if(rising_edge(clkin))then
if(counter=n)then
clk<=notclk;
counter<=0;
else
counter<=counter+1;
endif;
endif;
endprocess;
clkout<=clk;
endone;
2、巴克码发生器
libraryieee;
useieee.std_logic_1164.all;
useieee.std_logic_unsigned.all;
useieee.std_logic_arith.all;
entitybakemais
port(en,reset:
instd_logic;
clk:
instd_logic;
d:
outstd_logic;
q:
bufferstd_logic_vector(3downto0);
co,co2:
outstd_logic);
endbakema;
architectureoneofbakemais
begin
process(clk,en,reset)
begin
if(reset='1')thenq<="0000";
elsif(rising_edge(clk))then
if(en='1')then
if(q="0110")thenq<="0000";
elseq<=q+1;
endif;
endif;
endif;
endprocess;
co<='1'when(q="0110")else'0';
co2<=clk;
process(q)
begin
caseqis
when"0000"=>d<='1';
when"0001"=>d<='1';
when"0010"=>d<='1';
when"0011"=>d<='0';
when"0100"=>d<='0';
when"0101"=>d<='1';
when"0110"=>d<='0';
when
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- EDA 实验 报告 00121184