数字逻辑与部件设计实验报告Google Code.docx
- 文档编号:24419235
- 上传时间:2023-05-27
- 格式:DOCX
- 页数:70
- 大小:148.66KB
数字逻辑与部件设计实验报告Google Code.docx
《数字逻辑与部件设计实验报告Google Code.docx》由会员分享,可在线阅读,更多相关《数字逻辑与部件设计实验报告Google Code.docx(70页珍藏版)》请在冰豆网上搜索。
数字逻辑与部件设计实验报告GoogleCode
数字逻辑与部件设计实验报告
学号:
0730*******
姓名:
张璞
实验一译码器和编码器………………………………………………………………………3
实验二七段显示译码器的设计………………………………………………………..10
实验三加法器、算术逻辑单元及快速进位电路的设计……………………13
实验四触发器和寄存器………………………………………………………………......19
实验五计数器的设计………………………………………………………………………..24
实验六有限状态机……………………………………………………………………………31
实验七总线传输实验………………………………………………………………………..43
实验一译码器和编码器
实验要求
1.用与非门设计一个3-8译码器74LS138,除了下述真值表中的输入输出信号外,增加三个控制信号G1、G2A、G2B,当G1位高电平,G2A和G2B同时为低电平时,实现如表中的正常译码,否则Y0-Y7都为高电平。
输入
输出
S2
S1
S0
Y0
Y1
Y2
Y3
Y4
Y5
Y6
Y7
0
0
0
0
1
1
1
1
1
1
1
0
0
1
1
0
1
1
1
1
1
1
0
1
0
1
1
0
1
1
1
1
1
0
1
1
1
1
1
0
1
1
1
1
1
0
0
1
1
1
1
0
1
1
1
1
0
1
1
1
1
1
1
0
1
1
1
1
0
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
0
2.设计一个如下表逻辑功能的8-3普通编码器。
输入
输出
I0
I1
I2
I3
I4
I5
I6
I7
F0
F1
F2
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
1
0
0
1
0
0
0
0
0
0
1
0
0
0
0
1
0
0
0
0
0
1
1
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
0
1
0
0
1
0
1
0
0
0
0
0
0
1
0
1
1
0
0
0
0
0
0
0
0
1
1
1
1
3.设计一个8-3优先编码器
实验目的
1、熟悉实验仪的使用方法,熟悉基本的VHDL语言的语法规范,熟悉卡诺图的化简方法,熟悉德摩根定律。
2、熟悉VHDL中if语句的使用,特别注意if语句优先级的问题。
实验过程及讨论
1、在第一个实验中,输入输出地真值表都已经给出,所以首先对每个输出做化简工作。
这些函数都是三变量的,所以化简相对容易,经过化简可以得到如下布尔函数:
由于本实验要求是用与非门来实现,而上面的都是用非门和或门来实现的,所以运用德摩根定律,可以将上述的布尔函数等价转化为如下的布尔函数:
对上述的布尔函数用与非门来实现就非常容易了。
另外,本实验的要求中还要求有三个控制信号G1、G2A、G2B,当G1位高电平,G2A和G2B同时为低电平时,实现如表中的正常译码,否则Y0-Y7都为高电平。
所以可以增加一个信号check,表示三个控制信号是否满足要求,check的布尔函数如下:
,把这个控制信号与每个输出用与非门连接起来就能得到满足所有要求的输出函数。
设计完毕。
2、第二个实验由于输入是8变量的,所以无法用卡诺图手工化简,如果不使用if语句,需要用基本的与门、非门和或门把这些变量连接起来,实现真值表中所示的函数的功能。
每个输出对应的布尔函数为:
设计完毕。
3、由于要实现8-3优先编码器,VHDL语言中的if语句正好可以用在这里,if语句必须在process中使用,而在一个process中,所有语句都是顺序执行的,if的判断是顺序的,所以判断和执行的先后顺序就代表了优先级。
在我的设计中I7的优先级最高,I0的优先级最低,所以在用if语句判断的时候是从I7是否为1开始,逐个递减直到I0结束。
另外,在实验3中,需要注意的是,在引脚锁定的时候,由于I0的优先级是最低的,所以需要把I0的引脚注释掉,否则编译的时候会报错。
由于是第一次实验,所以忘记把NumberofClockBuffers的值设置为0,造成编译的时候报错,后经询问老师才得以解决。
实验代码与引脚锁定
1、3-8译码器
实验代码
libraryIEEE;
useIEEE.STD_LOGIC_1164.ALL;
useIEEE.STD_LOGIC_ARITH.ALL;
useIEEE.STD_LOGIC_UNSIGNED.ALL;
--Uncommentthefollowinglinestousethedeclarationsthatare
--providedforinstantiatingXilinxprimitivecomponents.
--libraryUNISIM;
--useUNISIM.VComponents.all;
entitydecoder_3_8is
Port(S2:
instd_logic;
S1:
instd_logic;
S0:
instd_logic;
G1:
instd_logic;
G2A:
instd_logic;
G2B:
instd_logic;
Y0:
outstd_logic;
Y1:
outstd_logic;
Y2:
outstd_logic;
Y3:
outstd_logic;
Y4:
outstd_logic;
Y5:
outstd_logic;
Y6:
outstd_logic;
Y7:
outstd_logic);
enddecoder_3_8;
architectureBehavioralofdecoder_3_8is
signalYT0,YT1,YT2,YT3,YT4,YT5,YT6,YT7,check:
std_logic;
begin
YT0<=not((notS2)nand(notS1))nand(notS0);
YT1<=not((notS2)nand(notS1))nandS0;
YT2<=not((notS2)nandS1)nand(notS0);
YT3<=not((notS2)nandS1)nandS0;
YT4<=not(S2nand(notS1))nand(notS0);
YT5<=not(S2nand(notS1))nandS0;
YT6<=not(S2nandS1)nand(notS0);
YT7<=not(S2nandS1)nandS0;
check<=not(not(G1nand(notG2A))nand(notG2B));
Y0<=(notYT0)nandcheck;
Y1<=(notYT1)nandcheck;
Y2<=(notYT2)nandcheck;
Y3<=(notYT3)nandcheck;
Y4<=(notYT4)nandcheck;
Y5<=(notYT5)nandcheck;
Y6<=(notYT6)nandcheck;
Y7<=(notYT7)nandcheck;
endBehavioral;
引脚锁定文件
#PINLOCK_BEGIN
NET"S2"LOC="P46";
NET"S1"LOC="P45";
NET"S0"LOC="P44";
NET"G2B"LOC="P43";
NET"G2A"LOC="P42";
NET"G1"LOC="P41";
NET"Y7"LOC="P90";
NET"Y6"LOC="P89";
NET"Y5"LOC="P88";
NET"Y4"LOC="P87";
NET"Y3"LOC="P86";
NET"Y2"LOC="P83";
NET"Y1"LOC="P82";
NET"Y0"LOC="P81";
#PINLOCK_END
2、8-3编码器
实验代码
libraryIEEE;
useIEEE.STD_LOGIC_1164.ALL;
useIEEE.STD_LOGIC_ARITH.ALL;
useIEEE.STD_LOGIC_UNSIGNED.ALL;
--Uncommentthefollowinglinestousethedeclarationsthatare
--providedforinstantiatingXilinxprimitivecomponents.
--libraryUNISIM;
--useUNISIM.VComponents.all;
entitycoder_8_3is
Port(I0:
instd_logic;
I1:
instd_logic;
I2:
instd_logic;
I3:
instd_logic;
I4:
instd_logic;
I5:
instd_logic;
I6:
instd_logic;
I7:
instd_logic;
F0:
outstd_logic;
F1:
outstd_logic;
F2:
outstd_logic);
endcoder_8_3;
architectureBehavioralofcoder_8_3is
begin
F0<=((notI0)and(notI1)and(notI2)and(notI3)andI4and(notI5)and(notI6)and(notI7))or((notI0)and(notI1)and(notI2)and(notI3)and(notI4)andI5and(notI6)and(notI7))or((notI0)and(notI1)and(notI2)and(notI3)and(notI4)and(notI5)andI6and(notI7))or((notI0)and(notI1)and(notI2)and(notI3)and(notI4)and(notI5)and(notI6)andI7);
F1<=((notI0)and(notI1)andI2and(notI3)and(notI4)and(notI5)and(notI6)and(notI7))or((notI0)and(notI1)and(notI2)andI3and(notI4)and(notI5)and(notI6)and(notI7))or((notI0)and(notI1)and(notI2)and(notI3)and(notI4)and(notI5)andI6and(notI7))or((notI0)and(notI1)and(notI2)and(notI3)and(notI4)and(notI5)and(notI6)andI7);
F2<=((notI0)andI1and(notI2)and(notI3)and(notI4)and(notI5)and(notI6)and(notI7))or((notI0)and(notI1)and(notI2)andI3and(notI4)and(notI5)and(notI6)and(notI7))or((notI0)and(notI1)and(notI2)and(notI3)and(notI4)andI5and(notI6)and(notI7))or((notI0)and(notI1)and(notI2)and(notI3)and(notI4)and(notI5)and(notI6)andI7);
endBehavioral;
引脚锁定文件
#PINLOCK_BEGIN
NET"I7"LOC="P48";
NET"I6"LOC="P47";
NET"I5"LOC="P46";
NET"I4"LOC="P45";
NET"I3"LOC="P44";
NET"I2"LOC="P43";
NET"I1"LOC="P42";
NET"I0"LOC="P41";
NET"F2"LOC="P83";
NET"F1"LOC="P82";
NET"F0"LOC="P81";
#PINLOCK_END
3、优先编码的8-3编码器
实验代码
libraryIEEE;
useIEEE.STD_LOGIC_1164.ALL;
useIEEE.STD_LOGIC_ARITH.ALL;
useIEEE.STD_LOGIC_UNSIGNED.ALL;
--Uncommentthefollowinglinestousethedeclarationsthatare
--providedforinstantiatingXilinxprimitivecomponents.
--libraryUNISIM;
--useUNISIM.VComponents.all;
entitycoder_8_3_2is
Port(I0:
instd_logic;
I1:
instd_logic;
I2:
instd_logic;
I3:
instd_logic;
I4:
instd_logic;
I5:
instd_logic;
I6:
instd_logic;
I7:
instd_logic;
F0:
outstd_logic;
F1:
outstd_logic;
F2:
outstd_logic);
endcoder_8_3_2;
architectureBehavioralofcoder_8_3_2is
begin
process(I0,I1,I2,I3,I4,I5,I6,I7)
begin
ifI7='1'then
F0<='1';F1<='1';F2<='1';
elsifI6='1'then
F0<='1';F1<='1';F2<='0';
elsifI5='1'then
F0<='1';F1<='0';F2<='1';
elsifI4='1'then
F0<='1';F1<='0';F2<='0';
elsifI3='1'then
F0<='0';F1<='1';F2<='1';
elsifI2='1'then
F0<='0';F1<='1';F2<='0';
elsifI1='1'then
F0<='0';F1<='0';F2<='1';
elsifI0='1'then
F0<='0';F1<='0';F2<='0';
else
F0<='0';F1<='0';F2<='0';
endif;
endprocess;
endBehavioral;
引脚锁定文件
#PINLOCK_BEGIN
NET"I7"LOC="P48";
NET"I6"LOC="P47";
NET"I5"LOC="P46";
NET"I4"LOC="P45";
NET"I3"LOC="P44";
NET"I2"LOC="P43";
NET"I1"LOC="P42";
#NET"I0"LOC="P41";
NET"F2"LOC="P83";
NET"F1"LOC="P82";
NET"F0"LOC="P81";
#PINLOCK_END
实验二七段显示译码器的设计
实验要求
1.设计一个BCD-7段显示译码器。
输入
输出
A
B
C
D
C0
C1
C2
C3
C4
C5
C6
0
0
0
0
1
1
1
1
1
1
0
0
0
0
1
0
1
1
0
0
0
0
0
0
1
0
1
1
0
1
1
0
1
0
0
1
1
1
1
1
1
0
0
1
0
1
0
0
0
1
1
0
0
1
1
0
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
0
1
1
1
1
1
0
1
1
1
1
1
1
0
0
0
0
1
0
0
0
1
1
1
1
1
1
1
1
0
0
1
1
1
1
0
0
1
1
1
0
1
X
X
X
X
X
X
X
X
1
1
X
X
X
X
X
X
X
X
X
2.把上述译码器扩展到16进制-7段译码器,即增加对A、B、C、D、E、F的显示。
实验目的
1、进一步熟悉四变量的卡诺图的化简,练习用组合逻辑设计的一般方法解决实际问题。
2、学习BCD-7段显示译码器的设计方法。
实验过程和讨论
1、由于真值表已经给出,是4变量的布尔函数,所以可以用卡诺图手工化简输出的布尔函数,化简结果如下所示:
这些函数用基本的与门、或门和非门就可以很容易实现。
2、16进制-7段译码器的真值表如下所示:
输入
输出
A
B
C
D
C0
C1
C2
C3
C4
C5
C6
0
0
0
0
1
1
1
1
1
1
0
0
0
0
1
0
1
1
0
0
0
0
0
0
1
0
1
1
0
1
1
0
1
0
0
1
1
1
1
1
1
0
0
1
0
1
0
0
0
1
1
0
0
1
1
0
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
0
1
1
1
1
1
0
1
1
1
1
1
1
0
0
0
0
1
0
0
0
1
1
1
1
1
1
1
1
0
0
1
1
1
1
0
0
1
1
1
0
1
0
1
1
1
0
1
1
1
1
0
1
1
0
0
1
1
1
1
0
1
1
0
0
1
0
0
1
1
1
0
1
1
0
1
0
1
1
1
1
0
1
1
1
1
0
1
0
0
1
1
1
1
1
1
1
1
1
0
0
0
1
1
1
有上述真值表可以得到各个输出所对应的布尔函数如下:
显然,有上述的布尔函数,通过与门、或门和非门就能得到对应的结果。
本实验中比较困难的是引脚锁定的问题,需要首先观察每个开关所对应的数字键盘上灯的位置,然后进行相应的锁定才能够得到想要的效果。
设计完毕。
实验代码和引脚锁定
1、BCD-7段译码器
实验代码
libraryieee;
useieee.std_logic_1164.all;
entitybcd_7is
port
(
A,B,C,D:
instd_logic;
C0,C1,C2,C3,C4,C5,C6:
outstd_logic
);
endbcd_7;
architecturedata_flowofbcd_7is
begin
C0<=Aor(BandD)orCor((notB)and(notD));
C1<=Aor((notC)and(notD))or(CandD)or(notB);
C2<=AorBor(notC)orD;
C3<=((notB)and(notD))or((notD)andC)or(Band(notC)andD)or(Cand(notB));
C4<=((notB)and(notD))or((notD)andC);
C5<=Aor((notC)and(notD))or((notD)andB)or((notC)andB);
C6<=Aor((notD)andC)or((notC)andB)or(Cand(notB));
enddata_flow;
引脚锁定文件
#PINLOCK_BEGIN
NET"D"LOC="P44";
NET"C"LOC="P43";
NET"B"LOC="P42";
NET"A"LOC="P41";
NET"C0"LOC="P90";
NET"C1"LOC="P89";
NET"C2"LOC="P88";
NET"C3"LOC="P87";
NET"C4"LOC="P86";
NET"C5"LOC="P83";
NET"C6"LOC="P82";
#PINLOCK_END
2、16进制-7段译码器
实验代码
libraryieee;
useieee.std_logic_1164.all;
entitybcd_7_2is
port
(
A,B,C,D:
instd_logic;
C0,C1,C2,C3,C4,C5,C6:
outstd_logic
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 数字逻辑与部件设计实验报告 Google Code 数字 逻辑 部件 设计 实验 报告
![提示](https://static.bdocx.com/images/bang_tan.gif)