答疑时间:周四下午 2,30~ 5,30
地点:西主楼 4区 210室
习题 1
2-1(a),2-2(b),2-3(c),2-6(c)
3-1,3-2(a),3-3(b),3-4(c),3-5(d),3-9(a)
请用 VHDL语言描述与或非门和异或门
2-1(a) (12.062)10=(1100.00001111)2 舍入误差 <2-8
2-2(b)(101110.0101)2=25+23+22+21+2-2+2-4=(46.3125)10
2-3(c) (623.77)8=6× 82+2× 81+3× 80+7× 8-1+7× 8-2
=( 403.984375) 10
=( 110 010 011.111 111) 2-8
=( 110010011.111111) 2
=( 0001 1001 0011.1111 1100) 2-16
=( 193.FC) 16
2-6(c) ( 0011 0100 0111 0001) 2-10 =( 3471) 10
3-1 能从三处分别独立进行控制的通道灯电路
A
YB
C ?
?
三个控制开关 A,B,C,有动作为 1,
无动作为 0,通道灯的状态 Y有变
化为 1,无变化为 0
A B C Y
0 0 0 0
0 0 1 1
0 1 0 1
0 1 1 0
1 0 0 1
1 0 1 0
1 1 0 0
1 1 1 1
CBAABCCBACBACBAY ???????
Y
+
_
A B C
3-2(a) 求反函数,并化简
1
1
))(())((
))((
?
?????
??????
??????
??????????
??????????
??????
???
DBBDDCCB
DBBDADCCBA
DBBDDCADCCBCBA
DBBDDACADCCBACBA
BDCBDACADCACDBBA
DCBADACBY
DCBADACBY
3-3(b) 写成最大项和最小项的形式
))()((
))()((
))()((
15,11,10,8,7,6,4,2,0,
14,13,12,9,5,3,1,
)()()()(
),,,(
3141215913
ZYXWZYXWZYXW
ZYXWZYXWZYXW
ZYXWZYXWZYXW
kM
im
mmmmmmm
YZXWZW X YZYWXZYXWZYXWZYXWZYWX
ZYYXWZYYWXZZYWXZYXWXWXWWX
ZXWZWXYWXZYZYXWF
k
i
?????????
?????????
??????????
??
??
???????
?????????????
?????????????
??????
?
?
3-4(c) 变换成另一种形式
)5,4,2,1()7,6,3,0(),,( ?? ?? mMZYXF
3-5(d) 卡诺图化简
?? )59,57,56,55,53,52,50,49,48,46,45,44,39,35,31,29,28,27,23,19,15,14,12,7,3(),,,,,( mFEDCBAF
D EF
AB C
00 0 0 01 0 11 0 10 11 0 11 1 1 01 1 0 0
00 0 1 1
0 0 1 1 1 1
0 11 1 1 1 1
0 10 1 1
110 1 1 1 1 1 1
111 1 1 1
101 1 1 1
100 1 1
ECBA ??? EDBA ???
FDABC
EFCB ??
EFBA
FDCAB
FCDB
DEFC
DEFA
ECDBA
EBCDA
3-9(a) 用两个或非门实现
DBAABCdDCBADBACBAF ?????????
CD
AB
00 01 11 10
00 1 1 1
01
11 ? ?
10 ? 1 1 ?
)(
)(
)(
DACB
DACB
DACB
DBBACBF
????
???
???
?????
+ +A
B
C
D F
与或非门
ENTITY noand4 IS
PORT ( a,b,c,d:IN BIT;y:OUT BIT) ;
END noand4;
ARCHITECTURE noand4_behav1 OF noand4 IS
BEGIN
y<=NOT (a AND b) OR (c AND d) AFTER 5ns;
END noand4_behav1;
ARCHITECTURE noand4_behav2 OF noand4 IS
SIGNAL y1,y2,y3,BIT
BEGIN
y1<=a AND b AFTER 5ns;
y2<=c AND d AFTER 5ns;
y3<=y1 OR y2 AFTER 5ns;
y<=NOT y3 AFTER 5ns;
END noand4_behav2;
ARCHITECTURE noand4_table OF noand4 IS
BEGIN
y<=′ 1′ WHEN a =′ 1′ AND b =′ 1′ ELSE
′ 1′ WHEN c =′ 1′ AND d =′ 1′ ELSE
′ 0′ ;
END noand4_table;
异或门
ENTITY xor2 IS
PORT ( a,b:IN BIT;c:OUT BIT) ;
END xor2;
ARCHITECTURE xor2_behav OF xor2 IS
BEGIN
c<=a XOR b AFTER 5ns;
END xor2_behav;
ARCHITECTURE xor2_sch OF xor2 IS
SIGNAL y1,y2,y3,y4,BIT
BEGIN
y1<=a AND y2 AFTER 5ns;
y2<=NOT b AFTER 5ns;
y3<=NOT a AFTER 5ns;
y4<=b AND y3 AFTER 5ns;
y<=y4 OR y1 AFTER 5ns;
END xor2_sch;
ARCHITECTURE xor2_table OF xor2 IS
BEGIN
c<=′ 0′ WHEN a =′ 1′ AND b =′ 1′ ELSE
′ 0′ WHEN a =′ 0′ AND b =′ 0′ ELSE
′ 1′ ;
END xor2_table;
习题 2 4-1,5-4
CBACBACBACABBCACBAF
YZXZXYF
ZYXX Y ZZYXZYXZYXF
????????????
???
?????????
)(3
2
1
4-1
5-4
D
5
D
4
D
3
工作片号
0 0 0 1
0 0 1 2
0 1 0 3
0 1 1 4
1 0 0 5
1 0 1 6
1 1 0 7
1 1 1 8
74LS138(9)
A0 A1 A2 S1 3S2S
0 1 2 3 4 5 6 7
1D3 D4 D5
74LS138(1)
A0 A1 A2 S1 3S2S
0 1 2 3 4 5 6 7
1D0 D1 D2
0Y 7Y
74LS138(8)
A0 A1 A2 S1 3S2S
0 1 2 3 4 5 6 7
1D0 D1 D2
56Y 63Y
…………
习题 3 4-3,4-5,5-2(a),5-7
4-3乘法器
(a) 输出端共有 4个
(a) 逻辑表达式
真值表
A
1
A
0
B
1
B
0
Z
3
Z
2
Z
1
Z
0
0 0 0 0 0 0 0 0
0 0 0 1 0 0 0 0
0 0 1 0 0 0 0 0
0 0 1 1 0 0 0 0
0 1 0 0 0 0 0 0
0 1 0 1 0 0 0 1
0 1 1 0 0 0 1 0
0 1 1 1 0 0 1 1
1 0 0 0 0 0 0 0
1 0 0 1 0 0 1 0
1 0 1 0 0 1 0 0
1 0 1 1 0 1 1 0
1 1 0 0 0 0 0 0
1 1 0 1 0 0 1 1
1 1 1 0 0 1 1 0
1 1 1 1 1 0 0 1
000
110010101100
01101
11001101012
10103
)()(
BAZ
BAABAABBABBA
BABAZ
BABABAABBAZ
BBAAZ
?
????
??
???
?
4-5用与门和异或门
))((
)()(
DCBA
DCBADCBA
DCBADCBADBCADCBAF
???
????
????
=1 &AB F
=1CD
5-2(a)用译码器
610 mmm
ZXYZYXZYXZXYYXF
???
?????????
74LS138
A0 A1 A2 S1 3S2S
0 1 2 3 4 5 6 7
1XYZ
&
F
5-7用四选一多路选择器
VSSVSSSSSS
VSSVSSVSSSS
VSSVSSSZ
01010101
01010101
10001
01
1
??????
?????
???
)]()()()( 013012011010 AADAADAADAADQ ????
QA0
A1
D0 D3S D1 D2
S0
S1
V
Z
0 1V
地点:西主楼 4区 210室
习题 1
2-1(a),2-2(b),2-3(c),2-6(c)
3-1,3-2(a),3-3(b),3-4(c),3-5(d),3-9(a)
请用 VHDL语言描述与或非门和异或门
2-1(a) (12.062)10=(1100.00001111)2 舍入误差 <2-8
2-2(b)(101110.0101)2=25+23+22+21+2-2+2-4=(46.3125)10
2-3(c) (623.77)8=6× 82+2× 81+3× 80+7× 8-1+7× 8-2
=( 403.984375) 10
=( 110 010 011.111 111) 2-8
=( 110010011.111111) 2
=( 0001 1001 0011.1111 1100) 2-16
=( 193.FC) 16
2-6(c) ( 0011 0100 0111 0001) 2-10 =( 3471) 10
3-1 能从三处分别独立进行控制的通道灯电路
A
YB
C ?
?
三个控制开关 A,B,C,有动作为 1,
无动作为 0,通道灯的状态 Y有变
化为 1,无变化为 0
A B C Y
0 0 0 0
0 0 1 1
0 1 0 1
0 1 1 0
1 0 0 1
1 0 1 0
1 1 0 0
1 1 1 1
CBAABCCBACBACBAY ???????
Y
+
_
A B C
3-2(a) 求反函数,并化简
1
1
))(())((
))((
?
?????
??????
??????
??????????
??????????
??????
???
DBBDDCCB
DBBDADCCBA
DBBDDCADCCBCBA
DBBDDACADCCBACBA
BDCBDACADCACDBBA
DCBADACBY
DCBADACBY
3-3(b) 写成最大项和最小项的形式
))()((
))()((
))()((
15,11,10,8,7,6,4,2,0,
14,13,12,9,5,3,1,
)()()()(
),,,(
3141215913
ZYXWZYXWZYXW
ZYXWZYXWZYXW
ZYXWZYXWZYXW
kM
im
mmmmmmm
YZXWZW X YZYWXZYXWZYXWZYXWZYWX
ZYYXWZYYWXZZYWXZYXWXWXWWX
ZXWZWXYWXZYZYXWF
k
i
?????????
?????????
??????????
??
??
???????
?????????????
?????????????
??????
?
?
3-4(c) 变换成另一种形式
)5,4,2,1()7,6,3,0(),,( ?? ?? mMZYXF
3-5(d) 卡诺图化简
?? )59,57,56,55,53,52,50,49,48,46,45,44,39,35,31,29,28,27,23,19,15,14,12,7,3(),,,,,( mFEDCBAF
D EF
AB C
00 0 0 01 0 11 0 10 11 0 11 1 1 01 1 0 0
00 0 1 1
0 0 1 1 1 1
0 11 1 1 1 1
0 10 1 1
110 1 1 1 1 1 1
111 1 1 1
101 1 1 1
100 1 1
ECBA ??? EDBA ???
FDABC
EFCB ??
EFBA
FDCAB
FCDB
DEFC
DEFA
ECDBA
EBCDA
3-9(a) 用两个或非门实现
DBAABCdDCBADBACBAF ?????????
CD
AB
00 01 11 10
00 1 1 1
01
11 ? ?
10 ? 1 1 ?
)(
)(
)(
DACB
DACB
DACB
DBBACBF
????
???
???
?????
+ +A
B
C
D F
与或非门
ENTITY noand4 IS
PORT ( a,b,c,d:IN BIT;y:OUT BIT) ;
END noand4;
ARCHITECTURE noand4_behav1 OF noand4 IS
BEGIN
y<=NOT (a AND b) OR (c AND d) AFTER 5ns;
END noand4_behav1;
ARCHITECTURE noand4_behav2 OF noand4 IS
SIGNAL y1,y2,y3,BIT
BEGIN
y1<=a AND b AFTER 5ns;
y2<=c AND d AFTER 5ns;
y3<=y1 OR y2 AFTER 5ns;
y<=NOT y3 AFTER 5ns;
END noand4_behav2;
ARCHITECTURE noand4_table OF noand4 IS
BEGIN
y<=′ 1′ WHEN a =′ 1′ AND b =′ 1′ ELSE
′ 1′ WHEN c =′ 1′ AND d =′ 1′ ELSE
′ 0′ ;
END noand4_table;
异或门
ENTITY xor2 IS
PORT ( a,b:IN BIT;c:OUT BIT) ;
END xor2;
ARCHITECTURE xor2_behav OF xor2 IS
BEGIN
c<=a XOR b AFTER 5ns;
END xor2_behav;
ARCHITECTURE xor2_sch OF xor2 IS
SIGNAL y1,y2,y3,y4,BIT
BEGIN
y1<=a AND y2 AFTER 5ns;
y2<=NOT b AFTER 5ns;
y3<=NOT a AFTER 5ns;
y4<=b AND y3 AFTER 5ns;
y<=y4 OR y1 AFTER 5ns;
END xor2_sch;
ARCHITECTURE xor2_table OF xor2 IS
BEGIN
c<=′ 0′ WHEN a =′ 1′ AND b =′ 1′ ELSE
′ 0′ WHEN a =′ 0′ AND b =′ 0′ ELSE
′ 1′ ;
END xor2_table;
习题 2 4-1,5-4
CBACBACBACABBCACBAF
YZXZXYF
ZYXX Y ZZYXZYXZYXF
????????????
???
?????????
)(3
2
1
4-1
5-4
D
5
D
4
D
3
工作片号
0 0 0 1
0 0 1 2
0 1 0 3
0 1 1 4
1 0 0 5
1 0 1 6
1 1 0 7
1 1 1 8
74LS138(9)
A0 A1 A2 S1 3S2S
0 1 2 3 4 5 6 7
1D3 D4 D5
74LS138(1)
A0 A1 A2 S1 3S2S
0 1 2 3 4 5 6 7
1D0 D1 D2
0Y 7Y
74LS138(8)
A0 A1 A2 S1 3S2S
0 1 2 3 4 5 6 7
1D0 D1 D2
56Y 63Y
…………
习题 3 4-3,4-5,5-2(a),5-7
4-3乘法器
(a) 输出端共有 4个
(a) 逻辑表达式
真值表
A
1
A
0
B
1
B
0
Z
3
Z
2
Z
1
Z
0
0 0 0 0 0 0 0 0
0 0 0 1 0 0 0 0
0 0 1 0 0 0 0 0
0 0 1 1 0 0 0 0
0 1 0 0 0 0 0 0
0 1 0 1 0 0 0 1
0 1 1 0 0 0 1 0
0 1 1 1 0 0 1 1
1 0 0 0 0 0 0 0
1 0 0 1 0 0 1 0
1 0 1 0 0 1 0 0
1 0 1 1 0 1 1 0
1 1 0 0 0 0 0 0
1 1 0 1 0 0 1 1
1 1 1 0 0 1 1 0
1 1 1 1 1 0 0 1
000
110010101100
01101
11001101012
10103
)()(
BAZ
BAABAABBABBA
BABAZ
BABABAABBAZ
BBAAZ
?
????
??
???
?
4-5用与门和异或门
))((
)()(
DCBA
DCBADCBA
DCBADCBADBCADCBAF
???
????
????
=1 &AB F
=1CD
5-2(a)用译码器
610 mmm
ZXYZYXZYXZXYYXF
???
?????????
74LS138
A0 A1 A2 S1 3S2S
0 1 2 3 4 5 6 7
1XYZ
&
F
5-7用四选一多路选择器
VSSVSSSSSS
VSSVSSVSSSS
VSSVSSSZ
01010101
01010101
10001
01
1
??????
?????
???
)]()()()( 013012011010 AADAADAADAADQ ????
QA0
A1
D0 D3S D1 D2
S0
S1
V
Z
0 1V