西华大学EDA实验报告.docx
- 文档编号:23918991
- 上传时间:2023-05-22
- 格式:DOCX
- 页数:47
- 大小:183.33KB
西华大学EDA实验报告.docx
《西华大学EDA实验报告.docx》由会员分享,可在线阅读,更多相关《西华大学EDA实验报告.docx(47页珍藏版)》请在冰豆网上搜索。
西华大学EDA实验报告
第组
西华大学实验报告(计算机类)
开课学院及实验室:
实验时间:
年月日
学生姓名
学号
成绩
学生所在学院
年级/专业/班
课程名称
课程代码
实验项目名称
用状态机方法设计十三进制计数器
项目代码
指导教师
项目学分
一、实验目的
通过VHDL语言用状态机方法设计十三进制计数器,并进行仿真。
二、内容与设计思想
三、使用环境
Windows8、QuartusII
四、核心代码及调试过程
libraryieee;
useieee.std_logic_1164.all;
useieee.std_logic_arith.all;
useieee.std_logic_unsigned.all;
entityh31is
port(cp:
instd_logic;
q:
outstd_logic_vector(3downto0);
op:
outstd_logic);
endh31;
architecturertlofh31is
typestateis
(s0,s1,s2,s3,s4,s5,s6,s7,s8,s9,s10,s11,s12);
signalpresentstate:
state;
signalnextstate:
state;
signalqn:
std_logic_vector(3downto0);
begin
switchtonenextstate:
process(cp)
begin
ifcp'eventandcp='1'then
presentstate<=nextstate;
endif;
endprocessswitchtonenextstate;
changestatemode:
process(presentstate)
begin
casepresentstateis
whens0=>nextstate<=s1;
qn<="0001";
op<='0';
whens1=>nextstate<=s2;
qn<="0010";
op<='0';
whens2=>nextstate<=s3;
qn<="0011";
op<='0';
whens3=>nextstate<=s4;
qn<="0100";
op<='0';
whens4=>nextstate<=s5;
qn<="0101";
op<='0';
whens5=>nextstate<=s6;
qn<="0110";
op<='0';
whens6=>nextstate<=s7;
qn<="0111";
op<='0';
whens7=>nextstate<=s8;
qn<="1000";
op<='0';
whens8=>nextstate<=s9;
qn<="1001";
op<='0';
whens9=>nextstate<=s10;
qn<="1010";
op<='0';
whens10=>nextstate<=s11;
qn<="1011";
op<='0';
whens11=>nextstate<=s12;
qn<="1100";
op<='0';
whens12=>nextstate<=s0;
qn<="0000";
op<='1';
whenothers=>nextstate<=s0;
op<='0';
endcase;
endprocesschangestatemode;
q<=qn;
endrtl;
五、总结
仿真结果:
六、附录
第组
西华大学实验报告(计算机类)
开课学院及实验室:
实验时间:
年月日
学生姓名
学号
成绩
学生所在学院
年级/专业/班
课程名称
课程代码
实验项目名称
能自启动的七进制计数器
项目代码
指导教师
项目学分
一、实验目的
用VHDL语言设计能自启动的七进制计数器,并进行仿真。
二、内容与设计思想
三、使用环境
Windows8、QuartusII
四、核心代码及调试过程
libraryieee;
useieee.std_logic_1164.all;
useieee.std_logic_arith.all;
useieee.std_logic_unsigned.all;
entityh34is
port(cp:
instd_logic;
q:
outstd_logic_vector(2downto0);
y:
outstd_logic);
endh34;
architecturewofh34is
typestateisarray(2downto0)ofstd_logic;
constants0:
state:
="001";
constants1:
state:
="100";
constants2:
state:
="010";
constants3:
state:
="101";
constants4:
state:
="110";
constants5:
state:
="111";
constants6:
state:
="011";
signalp:
state;
signaln:
state;
begin
s:
process(cp)
begin
ifcp'eventandcp='1'then
p<=n;
endif;
endprocesss;
m:
process(p)
begin
casepis
whens0=>n<=s1;y<='0';q<="100";
whens1=>n<=s2;y<='0';q<="010";
whens2=>n<=s3;y<='0';q<="101";
whens3=>n<=s4;y<='0';q<="110";
whens4=>n<=s5;y<='0';q<="111";
whens5=>n<=s6;y<='0';q<="011";
whens6=>n<=s0;y<='1';q<="001";
whenothers=>n<=s0;y<='0';
endcase;
endprocessm;
endw;
五、总结
仿真结果:
六、附录
第组
西华大学实验报告(计算机类)
开课学院及实验室:
实验时间:
年月日
学生姓名
学号
成绩
学生所在学院
年级/专业/班
课程名称
课程代码
实验项目名称
数字信号的发送和接收电路
项目代码
指导教师
项目学分
一、实验目的
用VHDL语言设计数字信号的发送和接收电路,并进行仿真。
二、内容与设计思想
三、使用环境
Windows8、QuartusII
四、核心代码及调试过程
数据发送:
libraryieee;
useieee.std_logic_1164.all;
useieee.std_logic_unsigned.all;
entityfais
port(start:
instd_logic;
a:
std_logic_vector(4downto0);
clk:
instd_logic;
b:
outstd_logic);
endfa;
architecturert1offais
begin
process(clk,a)
variabletemp:
std_logic_vector(6downto0);
variabletmp,m:
std_logic;
variabletmp1:
integerrange0to7;
begin
if(clk'eventandclk='1')then
if(m='0')then
tmp:
='1';
endif;
if(start='0')then
m:
='1';
temp(5downto1):
=a(4downto0);
temp(6):
=a(4)xora(3)xora
(2)xora
(1)xora(0);
temp(0):
='0';
elsif(m='1')then
tmp:
=temp(0);
temp:
='1'&temp(6downto1);
if(tmp1<7)then
tmp1:
=tmp1+1;
else
m:
='0';
temp:
="0000000";
tmp1:
=0;
endif;
endif;
endif;
b<=tmp;
endprocess;
endrt1;
数据接收:
libraryieee;
useieee.std_logic_1164.all;
entityrcvis
port(clk,re:
instd_logic;
lmp:
outstd_logic_vector(4downto0);
alm:
outstd_logic);
endrcv;
architecturercv_arcofrcvis
begin
process(clk)
variablea:
std_logic;
variablecnt:
integerrange0to6;
variableshift:
std_logic_vector(5downto0);
begin
ifclk'eventandclk='1'then
ifa='0'then
ifre='0'then
a:
='1';
alm<='0';
endif;
else
ifcnt<6then
shift:
=re&shift(5downto1);
cnt:
=cnt+1;
else
cnt:
=0;
a:
='0';
if(shift(0)xorshift
(1)xorshift
(2)xorshift(3)xorshift(4)xorshift(5))='0'then
lmp<=shift(4downto0);
else
alm<='1';
endif;
endif;
endif;
endif;
endprocess;
endrcv_arc
五、总结
仿真结果:
数据发送:
数据接收:
六、附录
第组
西华大学实验报告(计算机类)
开课学院及实验室:
实验时间:
年月日
学生姓名
学号
成绩
学生所在学院
年级/专业/班
课程名称
课程代码
实验项目名称
序列计数器
项目代码
指导教师
项目学分
一、实验目的
用VHDL语言设计序列计数器,并进行仿真。
二、内容与设计思想
三、使用环境
Windows8、QuartusII
四、核心代码及调试过程
Libraryieee;
useieee.std_logic_1164.all;
useieee.std_logic_unsigned.all;
entityzerois
port(d:
instd_logic_vector(7downto0);
clk,clr:
instd_logic;
ge:
outstd_logic_vector(3downto0);
alm:
outstd_logic);
endzero;
architectureze_arcofzerois
begin
process(clk,clr)
variables:
std_logic_vector(6downto0);
variablesd,ss:
std_logic_vector(3downto0);
begin
ifclr='0'then
alm<='0';
elsifclk'eventandclk='1'then
s(0):
=d(0)xord
(1);
ifs(0)='1'then
ss:
=ss+1;
endif;
s
(1):
=d
(1)xord
(2);
ifs
(1)='1'then
ss:
=ss+1;
endif;
s
(2):
=d
(2)xord(3);
ifs
(2)='1'then
ss:
=ss+1;
endif;
s(3):
=d(3)xord(4);
ifs(3)='1'then
ss:
=ss+1;
endif;
s(4):
=d(4)xord(5);
ifs(4)='1'then
ss:
=ss+1;
endif;
s(5):
=d(5)xord(6);
ifs(5)='1'then
ss:
=ss+1;
endif;
s(6):
=d(6)xord(7);
ifs(6)='1'then
ss:
=ss+1;
endif;
ifd(0)='1'then
sd:
=sd+1;
endif;
ifd
(1)='1'then
sd:
=sd+1;
endif;
ifd
(2)='1'then
sd:
=sd+1;
endif;
ifd(3)='1'then
sd:
=sd+1;
endif;
ifd(4)='1'then
sd:
=sd+1;
endif;
ifd(5)='1'then
sd:
=sd+1;
endif;
ifd(6)='1'then
sd:
=sd+1;
endif;
ifd(7)='1'then
sd:
=sd+1;
endif;
ifd(0)='0'then
ifss>1then
alm<='1';
ge<="0000";
else
ge<=8-sd;
endif;
else
ifss>2then
alm<='1';
ge<="0000";
else
ge<=8-sd;
endif;
endif;
endif;
sd:
="0000";
sd:
="0000";
endprocess;
endze_arc;
五、总结
仿真结果:
六、附录
第组
西华大学实验报告(计算机类)
开课学院及实验室:
实验时间:
年月日
学生姓名
学号
成绩
学生所在学院
年级/专业/班
课程名称
课程代码
实验项目名称
设计一个自动售邮票的控制电路
项目代码
指导教师
项目学分
一、实验目的
用VHDL语言设计一个自动售邮票的控制电路,并进行仿真。
二、内容与设计思想
三、使用环境
Windows8、QuartusII
四、核心代码及调试过程
libraryieee;
useieee.std_logic_1164.all;
useieee.std_logic_unsigned.all;
entitysoldais
port(m1,m5,m10,b:
instd_logic;
t6,t8:
instd_logic;
reset:
instd_logic;
clk:
instd_logic;
s6,s8:
outstd_logic;
ch:
outstd_logic_vector(4downto0));
endsolda;
architecturesold_arcofsoldais
begin
process(clk,m1,m5,m10,t6,t8,reset)
variablemoney:
std_logic_vector(4downto0);
--variablea:
std_logic;
variablecnt:
integerrange0to60;
begin
ifclk'eventandclk='1'then
ifb='1'then
ifm1='0'then
money:
=money+1;
elsifm5='0'then
money:
=money+5;
elsifm10='0'then
money:
=money+10;
elsifreset='0'then
ch<=money;
--a:
='0';
elsift6='0'andmoney>5then
ch<=money-6;
s6<='1';
--a:
='0';
elsift8='0'andmoney>7then
ch<=money-8;
s8<='1';
--a:
='0';
endif;
else
ifcnt<60then
cnt:
=cnt+1;
else
cnt:
=0;
money:
="00000";
s6<='0';
s8<='0';
ch<="00000";
--a:
='1';
endif;
endif;
endif;
endprocess;
endsold_arc;
五、总结
仿真结果:
六、附录
第组
西华大学实验报告(计算机类)
开课学院及实验室:
实验时间:
年月日
学生姓名
学号
成绩
学生所在学院
年级/专业/班
课程名称
课程代码
实验项目名称
数字锁
项目代码
指导教师
项目学分
一、实验目的
用VHDL语言设计数字锁,并进行仿真。
二、内容与设计思想
三、使用环境
Windows8、QuartusII
四、核心代码及调试过程
libraryieee;
useieee.std_logic_1164.all;
entitycornaais
port(clk,k1,k0,clr,load:
instd_logic;
lt:
inoutstd_logic;
lamp,ss:
outstd_logic_vector(7downto0);
lf,alm:
outstd_logic);
endcornaa;
architecturecorn_arcofcornaais
signalshift,lock:
std_logic_vector(7downto0);
signallam:
std_logic_vector(7downto0);
signalla:
std_logic;
begin
process(clk,clr)
begin
ifclr='0'then
la<='0';
elsifclk'eventandclk='1'then
ifload='0'then
la<='1';
endif;
endif;
endprocess;
process(clk,clr)
variableb:
integerrange0to8;
variablea:
integerrange0to8;
begin
ifclr='0'then
lam<="00000000";
shift<="00000000";
a:
=0;
lt<='0';
lf<='0';
alm<='0';
b:
=0;
elsifclk'eventandclk='1'then
ifla='0'then
ifa<8then
ifk1='1'then
shift<='1'&shift(7downto1);
lam<='1'&lam(7downto1);
a:
=a+1;
elsifk0='1'then
shift<='0'&shift(7downto1);
lam<='1'&lam(7downto1);
a:
=a+1;
endif;
else
a:
=0;
ifshift=lockthen
lt<='1';
else
lf<='1';
alm<='1';
endif;
endif;
elsifla='1'then
ifb/=8then
ifk1='1'then
lock<='1'&lock(7downto1);
lam<='0'&lam(7downto1);
b:
=b+1;
elsifk0='1'then
lock<='0'&lock(7downto1);
lam<='0'&lam(7downto1);
b:
=b+1;
endif;
endif;
endif;
endif;
endprocess;
lamp<=lock;
ss<=shift;
endcorn_arc;
五、总结
仿真结果:
六、附录
第组
西华大学实验报告(计算机类)
开课学院及实验室:
实验时间:
年月日
学生姓名
学号
成绩
学生所在学院
年级/专业/班
课程名称
课程代码
实验项目名称
设计一个汽车尾灯的控制电路
项目代码
指导教师
项目学分
一、实验目的
用VHDL语言设计一个汽车尾灯的控制电路,并进行仿真。
二、内容与设计思想
三、使用环境
Windows8、QuartusII
四、核心代码及调试过程
模块KONG
libraryieee;
useieee.std_logic_1164.all;
entitykongis
port(left,right:
instd_logic;
lft,rit,lr:
outstd_
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 西华 大学 EDA 实验 报告