chapter 4 combinational logic design principles ( 组合逻辑设计原理 )
DESCRIPTION
Digital Logic Design and Application ( 数字逻辑设计及应用 ). Chapter 4 Combinational Logic Design Principles ( 组合逻辑设计原理 ). Basic Logic Algebra ( 逻辑代数基础 ) Combinational-Circuit Analysis ( 组合电路分析 ) Combinational-Circuit Synthesis ( 组合电路综合 ). - PowerPoint PPT PresentationTRANSCRIPT
1
Chapter 4 Combinational Logic
Design Principles(组合逻辑设计原理 )
Basic Logic Algebra
(逻辑代数基础 ) Combinational-Circuit Analysis
(组合电路分析 ) Combinational-Circuit Synthesis
(组合电路综合 )
Digital Logic Design and Application ( 数字逻辑设计及应用 )
2
第四章 组合逻辑设计原理开关代数
公理、定理、逻辑函数的表示组合电路分析
得到指定电路的功能(公式法化简)组合电路综合
根据命题,得到电路实现(卡诺图化简)定时冒险
Digital Logic Design and Application ( 数字逻辑设计及应用 )
3
思考:五变量如何利用卡诺图化简?
DE
BC00 01 11 10
00
01
11
10
A = 0
DE
BC00 01 11 10
00
01
11
10
A = 1
0 4 12
1 5 13 9
3 7 15
2 6 14 10
8
11
16
17
19
18
20
21
23
22
28
29
31
30
24
25
27
26
Digital Logic Design and Application ( 数字逻辑设计及应用 )
4
F = A,B,C,D,E(0,1,2,3,4,5,10,11,14,20,21,24,25,26,27,28,29,30)
DE
BC00 01 11 10
00
01
11
10
A = 0
DE
BC00 01 11 10
00
01
11
10
A = 1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
F = + + + + A’·B’·D’ A’·C’·D A·C·D’ A·B·C’ B·D·E’
Digital Logic Design and Application ( 数字逻辑设计及应用 )
5
Chapter 6 Combinational Logic Design Practices
(组合逻辑设计实践 )
Documentation Standard and Circuit Timing
(文档标准和电路定时 )
Commonly Used MSI Combinational Logic
Device (常用的中规模组合逻辑器件 )
Digital Logic Design and Application ( 数字逻辑设计及应用 )
6
第 6 章教学大纲要求 重点学习掌握:学习利用基本的逻辑门完成规定的组合逻辑电路的设计任务:如译码器、编码器、多路选择器、多路分配器、异或门、比较器、全加器。学习利用基本的逻辑门和已有的中规模集成电路( MSI)逻辑器件如译码器、编码器、多路选择器、多路分配器、异或门、比较器、全加器、三态器件等作为设计的基本元素完成更为复杂的组合逻辑电路设计的方法。
Digital Logic Design and Application ( 数字逻辑设计及应用 )
7
6.1 Documentation Standard(文档标准 )
Structure Thinking (结构化的理念 )
Specification: Description of Interface and
Function
(说明书:接口及功能描述 )
Block Diagram: System’s Major Function
Module and their Basic Interconnections
( 方框图 :主要功能模块及其互联 Figure 6-1)
Schematic Diagram [ 原理图 ( Figure 6-17) ]
Digital Logic Design and Application ( 数字逻辑设计及应用 )
8
6.1.1 Documentation Standard(文档标准 )
Timing Diagram
[ 定时图 ( Figure 6-19) ]
Structure Logic Device Description
(结构化逻辑器件描述 )
Circuit Description : Explains how the
circuit works internally.
(电路描述:解释电路内部如何工作 )
Digital Logic Design and Application ( 数字逻辑设计及应用 )
9
6.1.2 Gate Symbols (门的符号 )
&
≥1
1
Digital Logic Design and Application ( 数字逻辑设计及应用 )
10
Equivalent Gate Symbols under
the Generalized Demorgan’s Theorem [等效门符号(摩根定
理) ]
Inverter ( 反相器 )
Buffer ( 缓冲器 )
11
6.1.3 Signal Name and Active Levels
(信号名和有效电平 )
Name a Signal (信号的命名 )
An Active Level Associated with a Signal
(与信号相关的有效电平 )Active High
(高电平有效)Active Low
(低电平有效)
Digital Logic Design and Application ( 数字逻辑设计及应用 )
•Asserted ( 有效)•Deasserted (无效)•Negated (取消)
12
An Inversion Bubble to Indicate an Active-Low Pin
( 有反相圈的引脚 表示低电平有效 )
Given Logic Function as Occurring inside that symbolic outline.( 给定逻辑功能只在符号框的内部发生 )
READY
REQUESTGO
READY_L
REQUEST_LGO_L
6.1.3 Signal Name and Active Levels
(信号名和有效电平 )
Digital Logic Design and Application ( 数字逻辑设计及应用 )
Figure 6-5,6,7,8,9,10
13
6.1.5 Bubble-to-Bubble Logic Design
(“ ”圈到圈 的逻辑设计 )
AASEL
B
DATA
AASEL
B
ADATA_L
BDATA_L
DATA
Figure 6-11
Digital Logic Design and Application ( 数字逻辑设计及应用 )
14
6.2 Circuit Timing (电路定时 )
X
Z
Y
F
W
Propagation Delay ( 传播延迟 )
—— A Signal Path as the Time that it takes for a Change at the Input to Produce a Change at the Output of the Path( 信号通路输入端的变化引起输出端变化所需的时间 )
tpHL and tpLH Maybe Different
Digital Logic Design and Application ( 数字逻辑设计及应用 )
Figure 6-19
15
Propagation Delay ( 传播延迟 )
Timing Analysis: Worst-Case Delay( 定时分析:取最坏情况延迟 )
X
Z
Y
F
W
Maximum Delay
( 最大延迟 )
Typical Delay
( 典型延迟 )
Minimum Delay
( 最小延迟 )
’08
’08
’04
’32
’32’32
表 6-2
15
202222
6.2 Circuit Timing (电路定时 )
tpHL and tpLH Maybe Different
Digital Logic Design and Application ( 数字逻辑设计及应用 )
16
Timing Diagram
[ 定时图(时序图) ]
GO
READY
DAT
tDAT tDAT
GOREADY
DAT
tRDY tRDY
6.2 Circuit Timing (电路定时 )
Causality and Propagation Delay ( 因果性和传播延迟)
Digital Logic Design and Application ( 数字逻辑设计及应用 )
17
GOREADY
DAT
GO
READY
DAT
tRDYmin
tRDYmax
6.2 Circuit Timing (电路定时 )
Timing Diagram
[ 定时图(时序图) ]
Minimum and Maximum Delay ( 最小和最大延迟)
Digital Logic Design and Application ( 数字逻辑设计及应用 )
18
WRITE_L
DATAOUT
DATAIN
tOUTmax
tsetup tOUTmin
6.2 Circuit Timing (电路定时 )
Certain and Uncertain Transitions ( 确切的和不确切的转换)
Digital Logic Design and Application ( 数字逻辑设计及应用 )
19
Commonly Used MSI Combinational Logic Device
(常用中规模组合逻辑器件)
Encoders (编码器 )
Decoders (译码器 )
Multiplexers (多路复用器 )
Parity Circuits (奇偶校验 )
Comparators (比较器 )
Adders (加法器 )
Digital Logic Design and Application ( 数字逻辑设计及应用 )
20
Decoder and Encoder(译码器和编码器 )
Multiple-Input, Multiple-Output Logic Circuit( 多输入、多输出电路 )
Enable
Inputs
( 使能输入 )
( 输入编码 ) ( 输出
编码 )
Map 映射
Enable Inputs must be
Asserted to perform
Normal Mapping
Function
( 使能输入有效才能
实现正常映射功能 )
Input Cord Word Output
Cord Word
Digital Logic Design and Application ( 数字逻辑设计及应用 )
21
Most Commonly Used Case(一种最常用的情况 )
使能
输入编码 输出
编码
Map 映射
Decoder (译码器)
Encoder (编码器)
N-Bit Binary Code(n 位二进制码 )
2n 中取 1 码
使能
输入编码 输出
编码
Map 映射
2n 中取 1 码
n 位二进制码
( One-out-of 2n )
Digital Logic Design and Application ( 数字逻辑设计及应用 )
22
Decoder (译码器) Normally Output Code has More bits than its
Input Code
( 一般来说,输出编码比输入编码位数多 )
Encoder (编码器) Output Code has Fewer bits than its Input
Code called an Encoder
( 输出编码比输入编码位数少,则常称为编码器 )
Decoder and Encoder(译码器和编码器 )
Digital Logic Design and Application ( 数字逻辑设计及应用 )
23
6.4 Decoder(译码器)
Binary Decoder
(二进制译码器 )
2-to-4Decoder
Y0Y1Y2Y3
I0I1
EN
0 X X 0 0 0 0
1 0 0 0 0 0 1
1 0 1 0 0 1 0
1 1 0 0 1 0 0
1 1 1 1 0 0 0
InputsEN I1 I2
Outputs Y3 Y2 Y1 Y0
( 2-4 二进制译码器真值表 )Truth Table for a 2-to-4 Binary Decoder
Digital Logic Design and Application ( 数字逻辑设计及应用 )
Table 6-4, Figure 6-32
24
0 X X 0 0 0 0
1 0 0 0 0 0 1
1 0 1 0 0 1 0
1 1 0 0 1 0 0
1 1 1 1 0 0 0
InputsEN I1 I2
Outputs Y3 Y2 Y1 Y0
( 2-4 二进制译码器真值表 )Y0 = EN · ( I1’ · I2’ )
Y1 = EN · ( I1’ · I2 )
Y2 = EN · ( I1 · I2’ )
Y3 = EN · ( I1 · I2 )
Yi = EN · mi
6.4 Decoder(译码器)
Truth Table for a 2-to-4 Binary Decoder
Digital Logic Design and Application ( 数字逻辑设计及应用 )
25
DecodersDecoder: Popular combinational logic
building block, in addition to logic gatesConverts input binary number to one high
output2-input decoder: four possible input
binary numbersSo has four outputs, one for each possible
input binary number
2.9
i0i1
d0d1d2d3 1
11
000
i0i1
d0d1d2d3 0
01
010
i0i1
d0d1d2d3 0
10
100
i0i1
d0d1d2d3 0
00
001
26
Decoders
Internal design AND gate for each output
to detect input combination
Decoder with enable e Outputs all 0 if e=0 Regular behavior if e=1
n-input decoder: 2n outputs
2.9
i0i1
d0d1d2d3e 1
1
11
000
e
i0i1
d0d1d2d3 0
11
000
0
i0
d0
d1
d2
d3
i1
i1’i0’
i1’i0
i1i0’
i1i0
27
Decoder Example
New Year’s Eve Countdown DisplayMicroprocessor counts from 59 down to
0 in binary on 6-bit output
d0d1d2d3
i0i1i2i3i4i5
e
6x64dcd
d58d59d60d61d62d63
0 HappyNew Year
123
5859
010000
0010
00
2 2 1100000
0100
00
1000000
1000
00
0 0
Pro
cess
or
2828
Decoder Example
Want illuminate one of 60 lights for each binary number
Use 6x64 decoder4 outputs unused
d0d1d2d3
i0i1i2i3i4i5
e
6x64dcd
d58d59d60d61d62d63
0 HappyNew Year
123
5859
010000
0010
00
2 2 1100000
0100
00
1000000
1000
00
0 0
Pro
cess
or
29
0 0 0 0 0 0 0 10 0 0 0 0 0 1 00 0 0 0 0 1 0 00 0 0 0 1 0 0 00 0 0 1 0 0 0 00 0 1 0 0 0 0 00 1 0 0 0 0 0 01 0 0 0 0 0 0 0
0 0 00 0 10 1 00 1 11 0 01 0 11 1 01 1 1
I2 I1 I0 Y7 Y1Y0Y2Y3Y4Y5Y6
(3-8 二进制译码器真值表 )
3-to-8Decoder
I2
I1
I0
Y0
Y1
Y7
Yi = EN · mi
1 1 1 1 1 1 1 01 1 1 1 1 1 0 11 1 1 1 1 0 1 11 1 1 1 0 1 1 11 1 1 0 1 1 1 11 1 0 1 1 1 1 11 0 1 1 1 1 1 10 1 1 1 1 1 1 1
6.4 Decoder(译码器)Truth Table for a 3-to- 8 Binary Decoder
Digital Logic Design and Application ( 数字逻辑设计及应用 )
30
Logic Symbols for Large-Scale Element (大规模元件的逻辑符号 )
Y0Y1Y2Y3
G
AB
1/2 74x139
Y0
Y1
Y2
Y3
G
AB
1/2 74x139
Y0
Y1
Y2
Y3
G
AB
1/2 74x139
G_L
AB
Y0_LY1_LY2_LY3_L
Digital Logic Design and Application ( 数字逻辑设计及应用 )
Figure 6-36
31
The 74x139 Dual 2-to-4 Decoder(双 2-4译码器 74x139)
74x139
1 X X 1 1 1 1
0 0 0 1 1 1 0
0 0 1 1 1 0 1
0 1 0 1 0 1 1
0 1 1 0 1 1 1
Inputs
G B A
Outputs
Y3_L Y2_L Y1_L Y0_L
( 1/2 74x139 双 2-4 译码器真值表 )
Truth Table for One-half of a 74x139Dual 2-to-4 Decoder
32
The 74x138 3-to-8 Decoder(3-8译码器 74x138)
G1
G2A_L
G2B_L
Y3 = G1 · G2A · G2B · C’· B · A
Enable ( 使 能 )Select ( 选 择 )
Y3_L = Y3’
= (G1 · G2A_L’ · G2B_L’ · C’·B·A)’
= G1’ + G2A_L + G2B_L + C+B’+A’
Digital Logic Design and Application ( 数字逻辑设计及应用 )
Figure 6-34, 35
33
第六章 作业
6.9 6.106.13 6.166.17
Digital Logic Design and Application ( 数字逻辑设计及应用 )
34
Using the information given in Table 6-2 with 74HCTxx,74AHCTxx and 74LSxx, Determine the exact maximum propagation delay from IN to OUT of the following Circuit. Compare and Comment on your results.
A Class Problem ( 每课一题 )
X
Z
Y
F
W
35
Chapter 6 Combinational Logic Design Practices
(组合逻辑设计实践 )
Documentation Standard and Circuit Timing
(文档标准和电路定时 )
Commonly Used MSI Combinational Logic
Device (常用的中规模组合逻辑器件 )
Digital Logic Design and Application ( 数字逻辑设计及应用 )
36
Review of Last Class (内容回顾 )
6.1 Documentation Standard
(文档标准 )
Signal Name and Active Level
(信号名和有效电平 )
Bubble-to-Bubble Logic Design
(“ ”圈到圈 逻辑设计 )
Digital Logic Design and Application ( 数字逻辑设计及应用 )
37
6.2 Circuit Timing (电路定时 )
Propagation Delay (传播延迟 )
Timing Analysis (定时分析 )
Timing Diagram (定时图 )
Review of Last Class (内容回顾 )
Digital Logic Design and Application ( 数字逻辑设计及应用 )
38
A B F
0 0 00 1 01 0 01 1 1
A BF
开关状态: 1 -闭合、 0 -断开灯的状态: 1 -亮 、 0 -不亮
逻辑与:当且仅当所有输入条件都有效时,输出状态才有效。
开关状态: 0 -闭合、 1 -断开灯的状态: 0 -亮 、 1 -不亮
A B F
0 0 00 1 11 0 11 1 1
A
BF A
BF
F = A + B = ( A’ · B’ )’
Review of Last Class (内容回顾 )
Digital Logic Design and Application ( 数字逻辑设计及应用 )
39
开关的有效状态:闭合灯的有效状态:亮
A BF
有反相圈的引脚表示低电平有效
给定逻辑功能只在符号框的内部发生
Review of Last Class (内容回顾 )
Digital Logic Design and Application ( 数字逻辑设计及应用 )
40
Decoders (译码器 )
Encoders (编码器 )
Multiplexers
(多路复用器 )
Parity Circuits
(奇偶校验 )
Comparators (比较器 )
Adders (加法器 )
Commonly Used MSI Combinational Logic Device(常用中
规模组合逻辑器件)
Enable
Inputs
( 使能输入 )
( 输入编码 ) ( 输出
编码 )
Map 映射
Input Code Word Output
Code Word
Digital Logic Design and Application ( 数字逻辑设计及应用 )
41
6.4 Decoder(译码器)Binary Decoder (二进制译码器 )
使能
输入编码 输出
编码
映射
n 位二进制码
2n 中取 1 码
2-4 译码器Y0Y1Y2Y3
I0I1
EN
Yi = EN · mi
0 X X 0 0 0 0
1 0 0 0 0 0 1
1 0 1 0 0 1 0
1 1 0 0 1 0 0
1 1 1 1 0 0 0
输 入EN I1 I0
输 出 Y3 Y2 Y1 Y0
2-4 二进制译码器真值表
当使能端有效时Yi = mi
Truth Table for a 2-to-4 Binary Decoder
Digital Logic Design and Application ( 数字逻辑设计及应用 )
42
The 74x139 Dual 2-to-4 Decoder(双 2-4译码器 74x139)
74x139
1 X X 1 1 1 1
0 0 0 1 1 1 0
0 0 1 1 1 0 1
0 1 0 1 0 1 1
0 1 1 0 1 1 1
Inputs
G B A
Outputs
Y3_L Y2_L Y1_L Y0_L
( 1/2 74x139 双 2-4 译码器真值表 )
Truth Table for One-half of a 74x139Dual 2-to-4 Decoder
43
74x139
EN
Digital Logic Design and Application ( 数字逻辑设计及应用 )
44
低位
高位Yi = EN · mi
G1
G2A_L
G2B_L
EN
Yi_L = Yi’ = ( EN · mi )’
EN = G1 · G2A · G2B
= G1 · G2A_L’ · G2B_L’
Y0_L
Y1_L
Y7_L
Y2_L
Y3_L
Y4_L
Y5_L
Y6_L
EN
Digital Logic Design and Application ( 数字逻辑设计及应用 )
45
N0N1N2N3
EN_L
+5V
D0_L
D7_L
D8_L
D15_L
用 74x138 设计 4-16 译码器思路: 16 个输出需要 片 74x138?
Y0
Y7ABC
G1G2AG2B
Y0
Y7ABC
G1G2AG2B
U1
U2
任何时刻只有一片在工作。 4 个输入中,哪些位控制片选哪些位控制输入
Cascading Binary Decoders ( 级联二进制译码器)
46
Consider: How to make a 5-to-32 Decoder
with 3-to-8 Decoder?
( 思考:用 74x138 设计 5-32 译码器 )
How many 74x138 chips to be used
with 32 outputs?
(32 个输出需要多少片 74x138 ? )
Control that only one chip works in any time
( 控制任何时刻只有一片工作 )
—— Use the Enable Inputs ( 利用使能端 )
Digital Logic Design and Application ( 数字逻辑设计及应用 )
47
Consider: How to make a 5-to-32 Decoder with 3-to-8 Decoder?
(思考:用 74x138 设计 5-32 译码器 )
Control inputs of three low-order bits of a 5-bit code word
(5个输入的低 3位控制输入 )Control chips of two high-order bits of
a 5-bit code word
(5个输入的高 2位控制片选 ) ——Use 2-to-4 Decoder
( 利用 2-4 译码器 )
Figure 6-37
Digital Logic Design and Application ( 数字逻辑设计及应用 )
48
补充:用译码器和逻辑门实现逻辑函数
F = (X,Y,Z) (0,3,6,7)
= (X,Y,Z) (1,2,4,5)
对于二进制译码器: Yi = EN · mi
当使能端有效时, Yi = mi
对低电平有效输出: Yi_L = Yi’
当使能端有效时, Yi_L = mi’ = Mi
ABC
G1G2AG2B
Y0Y1Y2Y3Y4Y5Y6Y7
74x138
Digital Logic Design and Application ( 数字逻辑设计及应用 )
49
用译码器和逻辑门实现逻辑函数
ZYX
ABC
G1G2AG2B
Y0Y1Y2Y3Y4Y5Y6Y7
74x138
F
+5V
F = (X,Y,Z) (0,3,6,7) 当使能端有效时Yi = mi
Digital Logic Design and Application ( 数字逻辑设计及应用 )
50
用译码器和逻辑门实现逻辑函数
ZYX
ABC
G1G2AG2B
Y0Y1Y2Y3Y4Y5Y6Y7
74x138+5V
F
F = (X,Y,Z) (0,3,6,7)
Digital Logic Design and Application ( 数字逻辑设计及应用 )
51
= M1 · M2 · M4 · M5 = m1’ · m2’ · m4’ · m5’
F = (X,Y,Z) ( 1, 2, 4, 5 )
ZYX
ABC
G1G2AG2B
Y0Y1Y2Y3Y4Y5Y6Y7
74x138+5V
F
Digital Logic Design and Application ( 数字逻辑设计及应用 )
52
BCD Decoder (二-十进制译码器 )
Inputs : 4-bit BCD code
Outputs :1-out-of 10 CodeY0
Y9
I0I1I2I3
多余的 6 个状态如何处理?
输出均无效:拒绝“翻译”
作为任意项处理 —— 电路内部结构简单
Digital Logic Design and Application ( 数字逻辑设计及应用 )
53
二-十进制译码器
0 0 0 0 0 0 0 10 0 1 00 0 1 10 1 0 00 1 0 10 1 1 00 1 1 11 0 0 01 0 0 11 0 1 01 0 1 11 1 0 01 1 0 11 1 1 01 1 1 1
0 1 1 1 1 1 1 1 1 11 0 1 1 1 1 1 1 1 11 1 0 1 1 1 1 1 1 11 1 1 0 1 1 1 1 1 11 1 1 1 0 1 1 1 1 11 1 1 1 1 0 1 1 1 11 1 1 1 1 1 0 1 1 11 1 1 1 1 1 1 0 1 11 1 1 1 1 1 1 1 0 11 1 1 1 1 1 1 1 1 01 1 1 1 1 1 1 1 1 11 1 1 1 1 1 1 1 1 11 1 1 1 1 1 1 1 1 11 1 1 1 1 1 1 1 1 11 1 1 1 1 1 1 1 1 11 1 1 1 1 1 1 1 1 1
I3 I2 I1 I0
0123456789
Y0_L Y9_L
伪
码任 意 项
Digital Logic Design and Application ( 数字逻辑设计及应用 )
54
6.4.8 Seven-Segment Decoders(七段显示译码器 )
a b c d e f g dp
公共阴极
a
b
c
d
e
f g
dp
Normally use (常用的有 ) :Light-Emitting Diodes
( LED, 半导体数码管)Liquid-Crystal Display
( LCD, 液晶数码管)
a b c d e f g dp
公共阳极
Digital Logic Design and Application ( 数字逻辑设计及应用 )
5555
Multiple-Output Example: BCD to 7-Segment Converter
abcdefg111111001100001101101
afb
d
gec
wxyz
Converter
af
b
d
g ec
(b)(a)
56
Multiple-Output Example: BCD to 7-Segment Converter
a = w’x ’y ’z ’ + w’x ’yz’ + w’x ’yz + w’xy’z + w ’xyz’ + w’xyz + wx’y ’z ’ + wx’y ’zb = w’x ’y ’z ’ + w’x ’y ’z + w ’x ’yz’ + w’x ’yz + w’xy’z ’ + w’xyz + wx’y ’z ’ + wx’y ’z
af
b
d
gec
a...
57
Input code: 4-bit BCD
[ 输入信号: BCD码(用 A3A2A1A0表示) ]
Output Code: Seven-Segment Code
[ 输出:七段码(的驱动信号) a ~ g ]
1 表示亮 (On), 0 表示灭 (Off)
a
b
c
d
e
f g
1111110 1101101 0011111
6.4.8 Seven-Segment Decoders(七段显示译码器 )
Digital Logic Design and Application ( 数字逻辑设计及应用 )
58
七段显示译码器的真值表
0 0 0 0 0 0 0 10 0 1 00 0 1 10 1 0 00 1 0 10 1 1 00 1 1 11 0 0 01 0 0 1
1 0 1 01 0 1 11 1 0 01 1 0 11 1 1 01 1 1 1
1 1 1 1 1 1 00 1 1 0 0 0 01 1 0 1 1 0 11 1 1 1 0 0 10 1 1 0 0 1 11 0 1 1 0 1 10 0 1 1 1 1 11 1 1 0 0 0 01 1 1 1 1 1 11 1 1 0 0 1 1
0 0 0 1 1 0 10 0 1 1 0 0 10 1 0 0 0 1 11 0 0 1 0 1 10 0 0 1 1 1 10 0 0 0 0 0 0
A3 A2 A1 A0a b c d e f g
0123456789
101112131415
Digital Logic Design and Application ( 数字逻辑设计及应用 )
59
Karnaugh Maps for BCD-Seven-Segment Decoder (BCD - 七段显示译码器的卡诺图 )
Ya = A3A2A2A0 + A3A1 + A2A0
Yb = A3A1 + A2A1A0 + A2A1A0
Digital Logic Design and Application ( 数字逻辑设计及应用 )
60
Yc = A3A2 + A2A1A0
Yd = A2A1A0 + A2A1A0 + A2A1A0
Karnaugh Maps for BCD-Seven-Segment Decoder (BCD - 七段显示译码器的卡诺图 )
Digital Logic Design and Application ( 数字逻辑设计及应用 )
61
Ye = A2A1 + A0
Yf = A3A2A0 + A1A0 + A2A1
Karnaugh Maps for BCD-Seven-Segment Decoder (BCD - 七段显示译码器的卡诺图 )
Digital Logic Design and Application ( 数字逻辑设计及应用 )
62
Yg = A3A2A1 + A2A1A0
Karnaugh Maps for BCD-Seven-Segment Decoder (BCD - 七段显示译码器的卡诺图 )
Digital Logic Design and Application ( 数字逻辑设计及应用 )
63
回顾:组合电路的综合
要求设计一个七段显示译码器逻辑抽象,得到真值表选择器件类型
采用基本门电路实现,利用卡诺图化简采用二进制译码器实现,变换为标准和形式
电路处理,得到电路图
Digital Logic Design and Application ( 数字逻辑设计及应用 )
64
第六章 作业(四版) 6.20 (a) (c) (e) 6.31 6.32 6.33 6.41:用MSI和 SSI设计
6.43 6.38 6.47
Digital Logic Design and Application ( 数字逻辑设计及应用 )
65
第五章 作业 5.19(6.20) (a) (b) (c) 5.82(6.43) 5.85(6.41)用MSI和 SSI设计 5.31(6.31) 5.32(6.32) 5.34(6.33) 5.36( 6.38) 5.40(6.47)
Digital Logic Design and Application ( 数字逻辑设计及应用 )
66
用译码器和逻辑门实现逻辑函数
ABC
G1G2AG2B
Y0Y1Y2Y3Y4Y5Y6Y7
74x138
F = (X,Y,Z) (1,3,5,6)
Digital Logic Design and Application ( 数字逻辑设计及应用 )
A Class Problem ( 每课一题 )
6767
Chapter 6 Combinational Logic Design Practices
(组合逻辑设计实践 )
Documentation Standard and Circuit Timing
(文档标准和电路定时 )
Commonly Used MSI Combinational Logic
Device (常用的中规模组合逻辑器件 )
Digital Logic Design and Application ( 数字逻辑设计及应用 )
6868
期中考试时间: 5月 11 日 (周六 ) 19:00-21:00
范围: 第二章、第三章、第四章、第六章内容及有关补充内容
集中答疑时间: 5月 11日(周六) 8:30-11:30 14:30-17:30
地点:待定
6969
实验课答疑验收通知
本周四( 4月 25日)
下午 2:30-5:30
地点:科 A335
7070
Decoder (译码器 )
Cascading Binary
Decoders
(译码器的级联 )
Realize a Logic Circuit
by Using Decoder
(利用译码器实现逻辑电路 )
Review of Last Class ( 内容回顾 )Digital Logic Design and Application ( 数字逻辑设计及应用 )
7171
BCD Decoder
( 二-十进制译码器 )
Seven-Segment Decoders
(七段显示译码器 )
Review of Last Class ( 内容回顾 )
Digital Logic Design and Application ( 数字逻辑设计及应用 )
7272
用译码器和逻辑门实现逻辑函数
ABC
G1G2AG2B
Y0Y1Y2Y3Y4Y5Y6Y7
74x138F = (X,Y,Z) (1,3,5,6)
Digital Logic Design and Application ( 数字逻辑设计及应用 )
A Class Problem ( 每课一题 )
7373
6.5 Encoder(编码器)
Binary Encoder
A0
A1
A2
I0I1
I7
1 0 0 0 0 0 0 0 0 0 00 1 0 0 0 0 0 0 0 0 10 0 1 0 0 0 0 0 0 1 00 0 0 1 0 0 0 0 0 1 10 0 0 0 1 0 0 0 1 0 00 0 0 0 0 1 0 0 1 0 10 0 0 0 0 0 1 0 1 1 00 0 0 0 0 0 0 1 1 1 1
I0 I1 I2 I3 I4 I5 I6 I7 A2 A1 A0
(3 位二进制编码器的真值表 )
2n
InputsnOut-puts
Truth Table for a 8-to-3 Encoder
Digital Logic Design and Application ( 数字逻辑设计及应用 )
7474
Encoder
N inputs with exactly one of them being set to 1, log2(n) outputs for encoding.
74
4x24 x 2 encoder
7575
Guarantee:
The Inputs are
asserted at most
one at a time.
( 前提: 任何时刻只有一个输入端有效。 )
1 0 0 0 0 0 0 0 0 0 00 1 0 0 0 0 0 0 0 0 10 0 1 0 0 0 0 0 0 1 00 0 0 1 0 0 0 0 0 1 10 0 0 0 1 0 0 0 1 0 00 0 0 0 0 1 0 0 1 0 10 0 0 0 0 0 1 0 1 1 00 0 0 0 0 0 0 1 1 1 1
I0 I1 I2 I3 I4 I5 I6 I7 A2 A1 A0
(3 位二进制编码器的真值表 )
6.5 Encoder(编码器)
Truth Table for a 8-to-3 Encoder
Digital Logic Design and Application ( 数字逻辑设计及应用 )
7676
A0 = I1 + I3 + I5 + I7
A1 = I2 + I3 + I6 + I7
A2 = I4 + I5 + I6 + I7
Trouble:When more than One
Inputs are asserted?
( 问题:当某时刻出现多个输入有效? )
Priority (优先级)
1 0 0 0 0 0 0 0 0 0 00 1 0 0 0 0 0 0 0 0 10 0 1 0 0 0 0 0 0 1 00 0 0 1 0 0 0 0 0 1 10 0 0 0 1 0 0 0 1 0 00 0 0 0 0 1 0 0 1 0 10 0 0 0 0 0 1 0 1 1 00 0 0 0 0 0 0 1 1 1 1
I0 I1 I2 I3 I4 I5 I6 I7 A2 A1 A0
(3 位二进制编码器的真值表 )
6.5 Encoder(编码器)
Truth Table for a 8-to-3 Encoder
Digital Logic Design and Application ( 数字逻辑设计及应用 )
AB’C’D’ = A
7777
Priority Encoder
(优先编码器 )
A2
A1
A0
IDLE
I7I6I5I4I3I2I1I0
Change I0~ I7 to H0~ H7,
Make Sure the Inputs are
asserted at most one at a time.
( 将 I0~ I7 转换为 H0~ H7,
保证其中,任何时刻只有一个有效 )
Highest-Priority( 数大优先 )
6.5 Encoder (编码器)Digital Logic Design and Application ( 数字逻辑设计及应用 )
7878
Priority Encoder
(优先编码器 )
A2
A1
A0
IDLE
I7I6I5I4I3I2I1I0
H7 = I7H6 = I6 · I7’H5 = I5 · I6’ · I7’…H0 = I0 · I1’ · I2’ · … · I6’ · I7’
A2 = H4 + H5 + H6 + H7A1 = H2 + H3 + H6 + H7A0 = H1 + H3 + H5 + H7
Highest-Priority( 数大优先 )
6.5 Encoder (编码器)Digital Logic Design and Application ( 数字逻辑设计及应用 )
7979
Priority Encoder
(优先编码器 )
A2
A1
A0
IDLE
I7I6I5I4I3I2I1I0
Change I0~ I7 to H0~ H7,
Make Sure the Inputs are
asserted at most one at a time.
( 将 I0~ I7 转换为 H0~ H7,
保证其中,任何时刻只有一个有效 )
Highest-Priority( 数大优先 )
The IDLE Output is asserted if
No Inputs are asserted.
( 如果没有输入有效,则 IDLE 为 1 )
IDLE = I0’ · I1’ · … · I6’ · I7’
6.5 Encoder (编码器)Digital Logic Design and Application ( 数字逻辑设计及应用 )
8080
输
入
输出
使能输出,用于级联EO选通输出GS
EI_L 有效没有输入请求 EO_L 有效
Enable Inputs
EIEI_L 有效
有输入请求 GS_L 有效
图 6-48 表 6-27
The 74x148 Priority Encoder ( 优先级编码器 74x148)
Digital Logic Design and Application ( 数字逻辑设计及应用 )
8181
A2A1A0
GSEO
EI
I7
I0
A2A1A0
GSEO
EI
I7
I0
Q15_L
Q8_L
Q7_L
Q0_L
Y0
Y1
Y2
Y3
GS
2 个 74x148 级联为 16 - 4 优先编码器Digital Logic Design and Application ( 数字逻辑设计及应用 )
8282
输入:由 864,需8片 74x148 每片优先级不同(怎样实现?) 保证高位无输入时,次高位才工作 —— 高位芯片的 EO端接次高位芯片的EI端
用 8-3 优先编码器 74x148 级联为 64-6 优先编码器
A2A1A0
GSEO
EI
I7
I0
片间优先级的编码 —— 利用第 9 片 74x148
每片的 GS 端接到第 9 片的输入端 第 9 片的输出作为高 3 位( RA5~ RA3)
片内优先级片间优先级
输出: 6 位低 3 位高 3 位
8 片输出 A2~ A0
通过或门作为最终输出的低 3 位RA2~ RA0
Digital Logic Design and Application ( 数字逻辑设计及应用 )
8383
分析判定优先级电路:(利用 74x148 ) 8 个 ___ 电平有效输入 I0_L~ I7_L, _____ 的优先级最高 地址输出 A2~ A0, ____ 电平有效 若输出 AVALID 高电平有效,则表示 _______________
A2A1A0
GSEO
EI
74x148
I7
I0
I0_L
I7_L
A2A1A0
AVALID
低 I0_L
至少有一个输入有效低
题 6.53
Digital Logic Design and Application ( 数字逻辑设计及应用 )
8484
设计判定优先级电路:(利用 74x148 ) 8 个输入 I0~ I7 高电平有效, I7 优先级最高 地址输出 A2~ A0 ,高电平有效 如果没有输入有效,为 111 且输出 IDLE 有效
I7
I0
A2
A1
A0
IDLE
A2A1A0
GSEO
EI
I7
I0
74x148
题 6.52
Digital Logic Design and Application ( 数字逻辑设计及应用 )
8585
6.6 Three-State Devices (三态器件 )
Three-State Buffer (Three-State Driver)
[ 三态缓冲器(三态驱动器) ]
Figure 6-51
Three States: Active High(1) , Active Low (0), Hi-Z ( 三种状态:高电平,低电平,高阻态)
Digital Logic Design and Application ( 数字逻辑设计及应用 )
8686
6.6 Three-State Devices (三态器件 )
Three-State Device allow Multiple Sources to Share a Single “Party Line“
As long as Only One device “talk” on the Line at a time (三态器件允许多个信号源共享单个“同线”, 条件是每次只有一个器件工作) (Figure 6-52)
Digital Logic Design and Application ( 数字逻辑设计及应用 )
8787
6.6 Three-State Devices (三态器件 )
Typical Three-State Devices are Designed So that they go into the Hi-Z state Faster than they come out of the Hi-Z state.(对典型的三态器件,进入高阻态比离开高阻态 的时间快)
Digital Logic Design and Application ( 数字逻辑设计及应用 )
8888
6.6 Three-State Devices (三态器件 )
74x245 :双向传输数据,低电平使能 DIR 决定传输方向
74x541 :两个公共使能端,低电平使能, 施密特触发输入,输出不反相 (图 6-54 6-55 )
Standard SSI and MSI Three-State Buffer ( 标准 SSI和MSI 三态缓冲器 )
(图 6-56 6-57 )
Digital Logic Design and Application ( 数字逻辑设计及应用 )
8989
ABC
G1G2AG2B
Y0Y1Y2Y3Y4Y5Y6Y7
74x138
EN1EN2_LEN3_L
SSRC0SSRC1SSRC2
冲突( fighting)
利用使能端进行时序控制
三态器件允许信号共享单个“同线”( party line)典型的三态器件,进入高阻态比离开高阻态快
P0
P1
P7
SDATA
Digital Logic Design and Application ( 数字逻辑设计及应用 )
9090
EN1
EN2_L, EN3_L
max(tpLZmax, tpHZmax) min(tpZLmin, tpZHmin)
SSRC[2:0] 0 1 2 37
SDATA P0 P1 P2 P3P7
Dead Time( 截止时间 )
Digital Logic Design and Application ( 数字逻辑设计及应用 )
Figure 6-53
9191
A1
A8
G1G2 Y1
Y8
74x541
DB[0:7]
A1
A8
G1G2 Y1
Y8
74x541
Notation of Data Bus (数据总线的表示法)
图 6 - 55
Digital Logic Design and Application ( 数字逻辑设计及应用 )
9292
A1 B1
DIR
Transfer Data in Either Directions
By Using Three-State Transceiver
( 利用三态缓冲器实现数据双向传送 )
Bus Transceiver ( 总线收发 图 6 - 56)
DIRG_L
Digital Logic Design and Application ( 数字逻辑设计及应用 )
9393
6.7 Multiplexer(多路复用器)
Digital Switch, Multi-Switch, Data Selector
(又称数据开关、多路开关、数据选择器 )
(缩写:MUX) Under Select Controlling Signals, Select One
of the Multi-Inputs to the Output
( 在选择控制信号的作用下, 从多个输入数据中选择其中一个作为输出。 )
Digital Logic Design and Application ( 数字逻辑设计及应用 )
949494
Multiplexer (Mux)
Mux: Another popular combinational building blockRoutes one of its N data inputs to its one
output, based on binary value of select inputs
959595
Multiplexer (Mux)
4 input mux needs 2 select inputs to indicate which input to route through
8 input mux 3 select inputs N inputs log2(N) selects
Like a rail yard switch
9696
6.7 Multiplexer(多路复用器)
EN
SEL
D0
Dn-1
Y
Enable 使能Select 选择
n 个 1 位数据源 数据输出( 1位)
1
0
n
iii DmENY
EN
SEL
D0
Dn-1
Y
Enable( 使能 )
Select( 选择 )
N Data Sources(n个 b 位数据源 )
Data Output( 数据输出 )( b 位)
Digital Logic Design and Application ( 数字逻辑设计及应用 )
979797
Mux Internal Design
s0
di0
i1
2×1
i1i0
s01
d
2×1
i1
i0
s0
0
d
2× 1
i1
i0
s0
d
0
i0 (1*i0=i0)
i0 (0+i0=i0)1
0
2x1 mux
0
989898
Mux Internal Design
i041
i2
i1
i3
s1s0
d
s0
d
i0
i1
i2
i3
s1
4x1 mux
9999
EN_L C B A Y Y_L
1 X X X0 0 0 00 0 0 10 0 1 00 0 1 10 1 0 00 1 0 10 1 1 00 1 1 1
0 1D0 D0’D1 D1’D2 D2’D3 D3’D4 D4’D5 D5’D6 D6’D7 D7’
(8 输入 1 位多路复用器 )Truth Table for a 74x151
ABC
8-Input,1-bit Multiplexer
Digital Logic Design and Application ( 数字逻辑设计及应用 )
100100
输入G_L S
1 X0 0
0 1
0 0 0 0
1A 2A 3A 4A
1B 2B 3B 4B
(2 输入 4 位多路复用器 )
Truth Table for a 74x157
输出1Y 2Y 3Y 4Y
1A
2A
3A
4A
2-Input,4-bit Multiplexer
Digital Logic Design and Application ( 数字逻辑设计及应用 )
101101
1G_L 2G_L B A 1Y 2Y
1 1 X X0 0 0 00 0 0 10 0 1 00 0 1 10 1 0 00 1 0 10 1 1 00 1 1 11 0 0 01 0 0 11 0 1 01 0 1 1
0 01C0 2C01C1 2C11C2 2C21C3 2C31C0 01C1 01C2 01C3 0 0 2C0 0 2C1 0 2C2 0 2C3
(4 输入 2 位多路复用器 74x153 真值表 )
双 4 选 1
AB1G
2G
Truth Table for a 74x153 4-Input, 2-bit Multiplexer
102102
Expanding Multiplexers(扩展多路复用器 )
Expanding Bit (扩展位 )How to Realize 8-Input, 16-bit Multiplexer?
(如何实现 8输入, 16位多路复用器? )From 8-Input, 1-bit to 8-Input, 16-bit
(由 8输入 1位 8输入 16位 )
Need 16 74x151, Each Chip Process 1-bit
(需要 16片 74x151,
每片处理输入输出中的 1位 )
Digital Logic Design and Application ( 数字逻辑设计及应用 )
103103
Expanding Multiplexers(扩展多路复用器 )
Expanding Bit (扩展位 )Select-Inputs Connect
to C,B,A of Each Chip
(选择端连接到每片的 C,B,A)
Note: The Fanout Ability
of Select field
(注意:选择端的扇出能力 )
(驱动 16个负载)
EN
YY
ABCD0
D7
Digital Logic Design and Application ( 数字逻辑设计及应用 )
104104
Expanding Inputs (扩展数据输入端的数目 )How to realize 32-Input, 1-bit Multiplexer
(如何实现 32输入, 1位多路复用器? ) Inputs from 8 to 32, Need 4 chips
( 数据输入由 832,需 4片 )
How to control Select Inputs
----- By High bit plus Low bit.
( 如何控制选择输入端?
—— 分为:高位+低位 )
EN
YY
ABCD0
D7
Expanding Multiplexers(扩展多路复用器 )
105105
Expanding Inputs (扩展数据输入端的数目 )如何实现 32输入, 1位多路复用器?
High Bits plus Decoder as Select
( 高位+译码器进行片选 )
Low Bits Connect to
C,B,A of each Chip
( 低位接到每片的 C,B,A)
Output Using OR Gate
( 4片输出用或门得最终输出 )
EN
YY
ABCD0
D7
Expanding Multiplexers(扩展多路复用器 )
Figure 6-60
106106
D0D1D2D3
D4D5D6D7
A0A1A2
Y
Dual 4-to-1 Multiplexer to 8-to-1 Multiplexer( 用双 4 选 1 数据选择器构成 8 选 1 数据选择器 )
107107107
Mux Example
City mayor can set four switches up or down, representing his/her vote on each of four proposals, numbered 0, 1, 2, 3
City manager can display any such vote on large green/red LED (light) by setting two switches to represent binary 0, 1, 2, or 3
108108
Mux ExampleUse 4x1 mux
i04x1
i2i1
i3s1 s0
d
1
2
3
4
Mayor’s switches
manager'sswitches
Green/RedLED
on/off
Proposal
109109109
Muxes Commonly Together – N-bit Mux
Ex: Two 4-bit inputs A (a3 a2 a1 a0), and B (b3 b2 b1 b0)
4-bit 2x1 mux (just four 2x1 muxes sharing a select line)
can select between A or B
110110
Muxes Commonly Together – N-bit Mux
i0
s0i1
2x1d
i0
s0i1
2x1d
i0
s0i1
2x1d
i0
s0i1
2x1d
a3b3
I0
s0
s0
I1
4-bit2x1
D CA
B
a2b2
a1b1
a0b0
s0
4C
44
4
c3
c2
c1
c0
is shortfor
Simplifyingnotation:
111111111
N-bit Mux Example
Four possible display itemsTemperature (T), Average miles-per-gallon (A) Instantaneous mpg (I), and Miles remaining (M) – each is 8-bits wide
Choose which to display on D using two inputs x and yPushing button sequences to the next item
112112
N-bit Mux Example
Use 8-bit 4x1 mux
I08-bit4x1
I2
I1
I3s1 s0
D
x y
8
8 D
T
AI
M
8
8
8
button
To the above-mirror display
From the car's central computer
113113
用数据选择器设计组合逻辑电路
1
0
n
iii DmENY
当使能端有效时,
1
0
n
iii DmY
最小项之和形式
EN
ABC
D0D1D2D3D4D5D6D7
YY
74x151
实现逻辑函数 F = (A,B,C)(0,1,3,7)
CBAVCC
F
Digital Logic Design and Application ( 数字逻辑设计及应用 )
114114
设计七段显示译码器逻辑抽象,得到真值表
输入信号: BCD码( A3A2A1A0)输出:七段码(的驱动信号) a ~ g
1 表示亮, 0 表示灭选择器件类型
采用基本门电路实现,利用卡诺图化简采用二进制译码器实现,变换为标准和形式采用数据选择器实现 ,变换为标准和形式
电路处理,得到电路图
a
b
c
d
e
f g
Digital Logic Design and Application ( 数字逻辑设计及应用 )
115115
七段显示译码器的真值表
0 0 0 0 0 0 0 10 0 1 00 0 1 10 1 0 00 1 0 10 1 1 00 1 1 11 0 0 01 0 0 1
1 0 1 01 0 1 11 1 0 01 1 0 11 1 1 01 1 1 1
1 1 1 1 1 1 00 1 1 0 0 0 01 1 0 1 1 0 11 1 1 1 0 0 10 1 1 0 0 1 11 0 1 1 0 1 10 0 1 1 1 1 11 1 1 0 0 0 01 1 1 1 1 1 11 1 1 0 0 1 1
0 0 0 1 1 0 10 0 1 1 0 0 10 1 0 0 0 1 11 0 0 1 0 1 10 0 0 1 1 1 10 0 0 0 0 0 0
A3 A2 A1 A0 a b c d e f g
0123456789
101112131415
A1A0
A3A2
00 01 11 10
00
01
11
10
1
0
1
1
1
1
0
0
1
0
0
0
0
1
0
1
a
116116
第六章 作业 (四版)
6.506.516.216.22
Digital Logic Design and Application ( 数字逻辑设计及应用 )
117117
第六章 作业(三版)
5.45(6.50)5.46(6.51)5.21(6.21)5.22(6.22)
Digital Logic Design and Application ( 数字逻辑设计及应用 )
118118
用数据选择器 74x151实现逻辑函数
F = (X,Y,Z) (2,3,4,7)
Digital Logic Design and Application ( 数字逻辑设计及应用 )
A Class Problem ( 每课一题 )
EN
ABC
D0D1D2D3D4D5D6D7
YY
74x151
119
Chapter 6 Combinational Logic Design Practices
(组合逻辑设计实践 )
Documentation Standard and Circuit Timing
(文档标准和电路定时 )
Commonly Used MSI Combinational Logic
Device (常用的中规模组合逻辑器件 )
Digital Logic Design and Application ( 数字逻辑设计及应用 )
120
期中考试时间: 4月 23 日 (周六 ) 晚上范围:第二章、第三章、第四章、第六章内容及有关补充内容
集中答疑时间: 4月 23日(周六) 上午 8:
30-11: 30 地点: C237和 C437
121
Decoder
(译码器 )
Encoder
(编码器 )
三态器件
多路复用器
( 优先编码器的级联和应用 )
Review of Last Class (内容回顾 )
Cascading Priority Encoders
Digital Logic Design and Application ( 数字逻辑设计及应用 )
122
BCD Decoder
( 二-十进制译码器 )
Seven-Segment Decoders
(七段显示译码器 )
Encoder (编码器 )
Priority Encoder
(优先编码器 )
BinaryEncoder
A0
A1
A2
I0
I7
2n
个输入
n个输出
Review of Last Class (内容回顾 )
Digital Logic Design and Application ( 数字逻辑设计及应用 )
123
译码器
编码器
Three-State Device
(三态器件 )
Multiplexer
(多路复用器 )
允许多个信号驱动“同线”
实现数据双向传送数据总线的表示法
Review of Last Class (内容回顾 )
Digital Logic Design and Application ( 数字逻辑设计及应用 )
124
ABC
G1G2AG2B
Y0Y1Y2Y3Y4Y5Y6Y7
74x138
EN1EN2_LEN3_L
SSRC0SSRC1SSRC2
冲突( fighting)
利用使能端进行时序控制
三态器件允许信号共享单个“同线”( party line)典型的三态器件,进入高阻态比离开高阻态快
P0
P1
P7
SDATA
Digital Logic Design and Application ( 数字逻辑设计及应用 )
125
A1 B1
DIR
Transfer Data in Either Directions
By Using Three-State Transceiver
( 利用三态缓冲器实现数据双向传送 )
Bus Transceiver ( 总线收发 图 6 - 56)
DIRG_L
Digital Logic Design and Application ( 数字逻辑设计及应用 )
126
译码器编码器三态器件
多路复用器
EN
SEL
D0
Dn-1
Y
使能选择
n 个 b 位数据源 数据输出( b 位)
1
0
n
iii DmENY
标准 MSI 多路复用器 74x151 、 74x153 、 74x157
扩展多路复用器
Review of Last Class (内容回顾 )
Digital Logic Design and Application ( 数字逻辑设计及应用 )
127
EN_L C B A Y Y_L
1 X X X0 0 0 00 0 0 10 0 1 00 0 1 10 1 0 00 1 0 10 1 1 00 1 1 1
0 1D0 D0’D1 D1’D2 D2’D3 D3’D4 D4’D5 D5’D6 D6’D7 D7’
(8 输入 1 位多路复用器 )Truth Table for a 74x151
ABC
8-Input,1-bit Multiplexer
Digital Logic Design and Application ( 数字逻辑设计及应用 )
128
1G_L 2G_L B A 1Y 2Y
1 1 X X0 0 0 00 0 0 10 0 1 00 0 1 10 1 0 00 1 0 10 1 1 00 1 1 11 0 0 01 0 0 11 0 1 01 0 1 1
0 01C0 2C01C1 2C11C2 2C21C3 2C31C0 01C1 01C2 01C3 0 0 2C0 0 2C1 0 2C2 0 2C3
(4 输入 2 位多路复用器 74x153 真值表 )
双 4 选 1
AB1G
2G
Truth Table for a 74x153 4-Input, 2-bit Multiplexer
129
输入G_L S
1 X0 0
0 1
0 0 0 0
1A 2A 3A 4A
1B 2B 3B 4B
2 输入 4 位多路复用器Truth Table for a 74x157
输出1Y 2Y 3Y 4Y
1A
2A
3A
4A
2-Input,4-bit Multiplexer
Digital Logic Design and Application ( 数字逻辑设计及应用 )
130
D0D1D2D3
D4D5D6D7
A0A1A2
Y
Dual 4-to-1 Multiplexer to 8-to-1 Multiplexer( 用双 4 选 1 数据选择器构成 8 选 1 数据选择器 )
131
用数据选择器设计组合逻辑电路
1
0
n
iii DmENY
当使能端有效时,
1
0
n
iii DmY
最小项之和形式
EN
ABC
D0D1D2D3D4D5D6D7
YY
74x151
实现逻辑函数 F = (A,B,C)(0,1,3,7)
CBAVCC
F
Digital Logic Design and Application ( 数字逻辑设计及应用 )
132
设计七段显示译码器逻辑抽象,得到真值表
输入信号: BCD码( A3A2A1A0)输出:七段码(的驱动信号) a ~ g
1 表示亮, 0 表示灭选择器件类型
采用基本门电路实现,利用卡诺图化简采用二进制译码器实现,变换为标准和形式采用数据选择器实现 ,变换为标准和形式
电路处理,得到电路图
a
b
c
d
e
f g
Digital Logic Design and Application ( 数字逻辑设计及应用 )
133
七段显示译码器的真值表
0 0 0 0 0 0 0 10 0 1 00 0 1 10 1 0 00 1 0 10 1 1 00 1 1 11 0 0 01 0 0 1
1 0 1 01 0 1 11 1 0 01 1 0 11 1 1 01 1 1 1
1 1 1 1 1 1 00 1 1 0 0 0 01 1 0 1 1 0 11 1 1 1 0 0 10 1 1 0 0 1 11 0 1 1 0 1 10 0 1 1 1 1 11 1 1 0 0 0 01 1 1 1 1 1 11 1 1 0 0 1 1
0 0 0 1 1 0 10 0 1 1 0 0 10 1 0 0 0 1 11 0 0 1 0 1 10 0 0 1 1 1 10 0 0 0 0 0 0
A3 A2 A1 A0a b c d e f g
0123456789
101112131415
A1A0
A3A2
00 01 11 10
00
01
11
10
1
0
1
1
1
1
0
0
1
0
0
0
0
1
0
1
a
134
1
0
n
iii DmENY
当使能端有效时,
1
0
n
iii DmY
最小项之和形式
EN
ABC
D0D1D2D3D4D5D6D7
YY
74x151
实现逻辑函数 F = (A,B,C)(0,1,3,7)
CBA
VCC
F
用多路复用器设计组合逻辑电路Digital Logic Design and Application ( 数字逻辑设计及应用 )
135
思考:利用 74x151 实现逻辑函数F = (W,X,Y,Z)(0,1,3,7,9,13,14)
降维:由 4 维 3 维Shannon’s expansion theorems
( 香农展开定理 )
Digital Logic Design and Application ( 数字逻辑设计及应用 )
),,,0(),,,1(
),,,(F
2'121
21
nn
n
XXFXXXFX
XXX
136
思考:利用 74x151 实现逻辑函数F = (W,X,Y,Z)(0,1,3,7,9,13,14)
降维:由 4 维 3 维Shannon’s expansion theorems
( 香农展开定理 )1、 F(1,X2,X3,…,Xn) = F(0,X2,X3,…,Xn)=0, 填 02、 F(1,X2,X3,…,Xn) = F(0,X2,X3,…,Xn)=1 ,填 13、 F(1,X2,X3,…,Xn)=1, F(0,X2,X3,…,Xn)=0 ,填X14、 F(1,X2,X3,…,Xn)=0, F(0,X2,X3,…,Xn)=1 ,填X1’
Digital Logic Design and Application ( 数字逻辑设计及应用 )
),,,0(),,,1(
),,,(
12'1121
121
XXFXXXFX
XXXF
137
YZ
WX00 01 11 10
00
01
11
10
1
1
1
1
1
1
1Y
WX00 01 11 10
0
1
1 0 Z Z
Z Z Z’ 0
思考:利用 74x151 实现逻辑函数F = (W,X,Y,Z)(0,1,3,7,9,13,14)
降维:由 4 维 3 维
Digital Logic Design and Application ( 数字逻辑设计及应用 )
138
EN
ABC
D0D1D2D3D4D5D6D7
YY
74x151
VCC
YXW
F
Z
利用 74x151 实现
F = (W,X,Y,Z)(0,1,3,7,9,13,14)
0 2 6 4
1 3 7 5
Y
WX00 01 11 10
0
1
1 0 Z Z
Z Z Z’ 0
说明:用具有 n 位地
址输入端的多路复用器,
可以产生任何形式的输
入变量数不大于 n+1
的组合逻辑函数。
Digital Logic Design and Application ( 数字逻辑设计及应用 )
139
6.7.3 Demultiplexer(多路分配器)
Route the bus data to one of m destinations
(把输入数据送到m个目的地之一 )
多路复用器
SRCA
SRCB
SRCZ
多路分配器
BUS
DSTA
DSTB
DSTZ
SRCSEL DSTSEL
DST : destinationSRC : source SEL : select
Digital Logic Design and Application ( 数字逻辑设计及应用 )
140
DeMux
One data input being passed through one of the outputs.
140
1x2 demux1×2
s0
141
A binary decoder with an enable input can be used as a demultiplexer( 利用带使能端的二进制译码器作为多路分配器 )
ABC
G1G2AG2B
Y0Y1Y2Y3Y4Y5Y6Y7
74x138
DST0_L
DST7_L
数据输入 SRC
EN_L
利用 74x139 实现 2 位 4 输出多路分配器( Figure 6-65 )
DSTSEL0DSTSEL1DSTSEL2
地址选择
—— Enable input is connected to the data line ( 利用使能端作为数据输入端 )
数据输入 SRC
EN_L
142
6.8 Parity Circuit (奇偶校验电路 )
Odd-Parity Circuit(奇校验电路)Output is 1 if an odd number of its inputs are 1.
(如果输入有奇数个 1,则输出为 1。 )
Even-Parity Circuit(偶校验电路)Output is 1 if an even number of its inputs are 1.
(如果输入有偶数个 1,则输出为 1。 )
回顾:用什么可以判断 1的个数???
Digital Logic Design and Application ( 数字逻辑设计及应用 )
143
6.8 Parity Circuit (奇偶校验电路 )
A0 A1 … An =
1 变量为 1 的个数是奇数0 变量为 1 的个数是偶数
Output of odd-parity circuit is inverted, we Get an even-parity circuit.(奇校验电路的输出反相就得到偶校验电路 )
N XOR gates may be cascaded to form a circuit with n+1 inputs and a single output.(n 个异或门级联,形成具有 n+1 个输入和单一输出的电路 )
Figure 6-70
Digital Logic Design and Application ( 数字逻辑设计及应用 )
144
Review of XOR AND XNOR ( 回顾异或、同或运算 )
AB=(A⊙B)’ AB’=A⊙B AB=A⊙B’
Any two signals( inputs or output) of an XOR or
XNOR gate may be complemented without
changing the resulting logic function.
( 对于异或门、同或门的任何 2 个信号(输入或输出)都可以取反,而不改变结果的逻辑功能( 图 6-69 )
F=AB
A
B
F A
B
F A
B
A
B
F F
F=A’B’ F=(A’B)’ F=(AB’)’
145
I1I2I3I4
IN ODD
Daisy-Chain Connection (菊花链式连接 )
I1I2I3I4
IMIN
ODD
Tree Structure (树状连接 )
Cascading XOR Gates( 级联异或门 图 6 - 70 )
Digital Logic Design and Application ( 数字逻辑设计及应用 )
146
9-bit Odd/Even Parity Generator 74x280 (9 位奇偶校验发生器 74x280 ( 图 6 - 71 )
ABCDEFGHI
EVEN
ODD
74x280
Digital Logic Design and Application ( 数字逻辑设计及应用 )
147
Parity-Checking Applications(奇偶校验的应用 )
用于检测代码在传输和存储过程中是否出现差错
A
EVEN
ODD
74x280
HI
A
EVEN
ODD
74x280
HI
发端
收端
DB[0:7] DB[0:7]
ERROR
发端保证有偶数个 1 收端 ODD 有效表示出错奇数 EVEN
148
6.9 Comparator (比较器)Compare two Binary words and indicate whether
they are equal
(比较 2个二进制数值并指示其是否相等的电路 )
Comparator: Check if two Binary words are
equal
( 等值比较器:检验数值是否相等 )
Magnitude Comparator: Compare their
magnitude (Greater than, Equal, Less than)
(数值比较器:比较数值的大小( >,=,<) )
Digital Logic Design and Application ( 数字逻辑设计及应用 )
149
6.9 Comparator (比较器)
How to build a 1-bit Comparator?
( 如何构造 1位等值比较器?? )
—— Use XOR (XNOR)
(利用异或门(同或门) )
AB DIFF A
B EQ
DIFF : different EQ : equal
Digital Logic Design and Application ( 数字逻辑设计及应用 )
150
DIFF
A0B0
A1B1
A2B2
A3B3 给出足够的异或门和宽度足够的或门,
可以搭建任意输入位数的等值比较器。
How to Build a N-bit Comparator?
(如何构造多位等值比较器?? )
必须每位都相等 —— 并行比较—— 串行比较
4 位等值比较器
Digital Logic Design and Application ( 数字逻辑设计及应用 )
151
An Iterative Comparator(迭代比较电路 )
X YCMP
EQI EQO
X0 Y0 X1 Y1 XN-1YN-1
EQ1 EQ2 EQNEQN-1
1 X YCMP
EQI EQO
X YCMP
EQI EQO
—— 每位串行比较AB EQ
EQO
EQI
迭代的方法可能节省费用,但速度慢
用于级联的输入
Digital Logic Design and Application ( 数字逻辑设计及应用 )
Figure 6-77
152
Comparators
N-bit equality comparator: Outputs 1 if two N-bit numbers are equal4-bit equality comparator with inputs A
and Ba3 must equal b3, a2 = b2, a1 = b1, a0 = b0
Two bits are equal if both 1, or both 0eq = (a3b3 + a3’b3’) * (a2b2 + a2’b2’) * (a1b1
+ a1’b1’) * (a0b0 + a0’b0’)Note that function inside parentheses is XNOR
eq = (a3 xnor b3) * (a2 xnor b2) * (a1 xnor b1) * (a0 xnor b0)
4.4
153153
Comparators4.4
a3a2a1a0 b3
eq
b2b1b0
4-bit equality comparator
0110 = 0111 ?
a3b3 a2b2 a1b1 a0b0
eq
0 1 1 00 1 1 1
01 1 1
0
=
154
EQ_L
A
B
LT_L
GT_L
1-Bit Magnitude Comparator (一位数值比较器 )
① A>B( A=1, B=0 )则 A·B’=1 可作为输出信号
② A<B( A=0, B=1 )则 A’·B=1 可作为输出信号
③ A=B ,则 A⊙B=1,可作为输出信号输出低电平有效
EQ_L = A·B’+A’·B = AB = (A⊙B)’
LT : Less Than
EQ : Equal
GT : Greater Than
(A’·B)’
(A·B’)’
Digital Logic Design and Application ( 数字逻辑设计及应用 )
155
n-Bit Magnitude Comparator(多位数值比较器 )
A(A3A2A1A0) 和 B(B3B2B1B0) 自高而低逐位比较
EQ = (A3⊙B3)·(A2⊙B2)·(A1⊙B1)·(A0⊙B0)
GT = (A3>B3)
LT = EQ’ · GT’ = ( EQ + GT )’
或 (A3 = B3)· (A2 = B2)· (A1>B1)
或 (A3 = B3)·(A2 = B2)·(A1 = B1)· (A0>B0)
或 (A3 = B3)· (A2>B2)A3· B3’ A2· B2’
A1· B1’
A0· B0’
⊙
⊙⊙
⊙⊙ ⊙
+
+
+
Digital Logic Design and Application ( 数字逻辑设计及应用 )
156
74x85
4-Bit Comparator 74x85 ( 4位比较器 74x85)
A0
A1
A2
A3
ALTBINAEQBINAGTBIN
级联输入,用于扩展
ALTBOUT = (A<B) + (A=B)·ALTBIN
通常低位的输出接高位的输入
A=B :低位和高位都相等
A 高位 >B 高位
A 高位 =B 高位 & A 低位 >B 低位
A>B
AEQBOUT = (A=B)·AEQBIN
AGTBOUT = (A>B) + (A=B)·AGTBIN
Digital Logic Design and Application ( 数字逻辑设计及应用 )
157
Serial Expanding Comparators(比较器的串行扩展 )
XD[11:0]
YD[11:0]
[3:0] [7:4] [11:8]
X<YX=YX>Y
+5V
A<BIA=BIA>BI
A<BOA=BOA>BO
A0~A3B0~B3
74x85
A<BIA=BIA>BI
A<BOA=BOA>BO
A0~A3B0~B3
74x85
A<BIA=BIA>BI
A<BOA=BOA>BO
A0~A3B0~B3
74x85
3 片 74x85 构成 12 位比较器
低位 高位
Digital Logic Design and Application ( 数字逻辑设计及应用 )
158
P0
P1
P2
P3
P4
P5
P6
P7
8位比较器 74x682内部逻辑图:图 6-82
问题 1 :怎样表示以下输出? 高电平有效: P DIFF Q
高电平有效: P EQ Q
高电平有效: P GE Q
高电平有效: P LT Q
( 图 6-81 )
GE
LT
问题 2 :能否扩展??注意:没有级联输入端
Digital Logic Design and Application ( 数字逻辑设计及应用 )
159
3 片 74x682 构成 24 位比较器
P0~P7 P=Q
Q0~Q7 P>Q
P0~P7 P=Q
Q0~Q7 P>Q
P0~P7 P=Q
Q0~Q7 P>Q
[7:0]
[15:8]
[23:16]
P[23:0]Q[23:0]
PEQQ
PGTQ
Paralel Expanding Comparators(比较器的并行扩展 )
160160
Magnitude Comparator Example:
Minimum of Two NumbersDesign a combinational component that computes the minimum of two 8-bit numbers
Solution: Use 8-bit magnitude comparator and 8-bit 2x1 mux
If A<B, pass A through mux. Else, pass B.
a
161161
Magnitude Comparator Example:
Minimum of Two Numbers
8 8
8
C
A BMin
(b)
MIN
IgtIeqIlt
AgtBAeqBAltB
010
A
A B
B8-bit magnitude comparator
sI1 I0
2x1 mux8-bit
C
88 8 8
8
(a)
11000000 01111111
0
0
1
01111111
162
第六章 作业 (四版)
6.24
Digital Logic Design and Application ( 数字逻辑设计及应用 )
163
第六章 作业(三版)
5.24(6.24)
Digital Logic Design and Application ( 数字逻辑设计及应用 )
164
用数据选择器 74x151实现逻辑函数
F = (W,X,Y,Z) (1,3,5,8
12,15)
Digital Logic Design and Application ( 数字逻辑设计及应用 )
A Class Problem ( 每课一题 )
EN
ABC
D0D1D2D3D4D5D6D7
YY
74x151
165
Chapter 6 Combinational Logic Design Practices
(组合逻辑设计实践 )
Documentation Standard and Circuit Timing
(文档标准和电路定时 )
Commonly Used MSI Combinational Logic
Device (常用的中规模组合逻辑器件 )
Digital Logic Design and Application ( 数字逻辑设计及应用 )
166
Decoder (译码器 )
Cascading Binary
Decoders
(译码器的级联 )
Realize a Logic Circuit
by Using Decoder
(利用译码器实现逻辑电路 )
Review of Last Class (内容回顾 )
Digital Logic Design and Application ( 数字逻辑设计及应用 )
167
N0N1N2N3
EN_L
+5V
D0_L
D7_L
D8_L
D15_L
用 74x138 设计 4-16 译码器思路: 16 个输出需要 片 74x138?
Y0
Y7ABC
G1G2AG2B
Y0
Y7ABC
G1G2AG2B
U1
U2
任何时刻只有一片在工作。 4 个输入中,哪些位控制片选哪些位控制输入
Cascading Binary Decoders ( 级联二进制译码器)
168
Consider: How to make a 5-to-32 Decoder
with 3-to-8 Decoder?
( 思考:用 74x138 设计 5-32 译码器 )
How many 74x138 chips to be used
with 32 outputs?
(32 个输出需要多少片 74x138 ? )
Control that only one chip works in any time
( 控制任何时刻只有一片工作 )
—— Use the Enable Inputs ( 利用使能端 )
Digital Logic Design and Application ( 数字逻辑设计及应用 )
169
Consider: How to make a 5-to-32 Decoder with 3-to-8 Decoder?
(思考:用 74x138 设计 5-32 译码器 )
Control inputs of three low-order bits of a 5-bit code word
(5个输入的低 3位控制输入 )Control chips of two high-order bits of
a 5-bit code word
(5个输入的高 2位控制片选 ) ——Use 2-to-4 Decoder
( 利用 2-4 译码器 )
图 6 - 37
Digital Logic Design and Application ( 数字逻辑设计及应用 )
170
用译码器和逻辑门实现逻辑函数
ZYX
ABC
G1G2AG2B
Y0Y1Y2Y3Y4Y5Y6Y7
74x138
F
+5V
F = (X,Y,Z) (0,3,6,7) 当使能端有效时Yi = mi
Digital Logic Design and Application ( 数字逻辑设计及应用 )
171
用译码器和逻辑门实现逻辑函数
ZYX
ABC
G1G2AG2B
Y0Y1Y2Y3Y4Y5Y6Y7
74x138+5V
F
F = (X,Y,Z) (0,3,6,7)
Digital Logic Design and Application ( 数字逻辑设计及应用 )
172
Decoder
(译码器 )
Encoder
(编码器 )
( 优先编码器的级联和应用 )
Review of Last Class (内容回顾 )
Cascading Priority Encoders
Digital Logic Design and Application ( 数字逻辑设计及应用 )
173
A2A1A0
GSEO
EI
I7
I0
A2A1A0
GSEO
EI
I7
I0
Q15_L
Q8_L
Q7_L
Q0_L
Y0
Y1
Y2
Y3
GS
2 个 74x148 级联为 16 - 4 优先编码器
174
输入:由 864,需8片 74x148 每片优先级不同(怎样实现?) 保证高位无输入时,次高位才工作 —— 高位芯片的 EO端接次高位芯片的EI端
用 8-3 优先编码器 74x148 级联为 64-6 优先编码器
A2A1A0
GSEO
EI
I7
I0
片间优先级的编码 —— 利用第 9 片 74x148
每片的 GS 端接到第 9 片的输入端 第 9 片的输出作为高 3 位( RA5~RA3)
片内优先级片间优先级
输出: 6 位低 3 位高 3 位
8 片输出 A2~ A0
通过或门作为最终输出的低 3 位
RA2~ RA0
Digital Logic Design and Application ( 数字逻辑设计及应用 )
175
Decoders
(译码器 )
Encoders
(编码器 )
Three-State
Devices
(三态器件 )
Multiplexer
(多路复用器 )
标准 MSI 多路复用器 74x151 、 74x153 、 74x157
扩展多路复用器 利用多路复用器实现逻辑函数 多路分配器 (Demultiplexer)
—— 利用带使能端的译码器 使能端作为数据输入端
Review of Last Class (内容回顾 )
176
1
0
n
iii DmENY
当使能端有效时,
1
0
n
iii DmY
最小项之和形式
EN
ABC
D0D1D2D3D4D5D6D7
YY
74x151
实现逻辑函数 F = (A,B,C)(0,1,3,7)
CBA
VCC
F
用多路复用器设计组合逻辑电路Digital Logic Design and Application ( 数字逻辑设计及应用 )
177
思考:利用 74x151 实现逻辑函数F = (W,X,Y,Z)(0,1,3,7,9,13,14)
降维:由 4 维 3 维Shannon’s expansion theorems
( 香农展开定理 )1、 F(1,X2,X3,…,Xn) = F(0,X2,X3,…,Xn)=0, 填 02、 F(1,X2,X3,…,Xn) = F(0,X2,X3,…,Xn)=1 ,填 13、 F(1,X2,X3,…,Xn)=1, F(0,X2,X3,…,Xn)=0 ,填X14、 F(1,X2,X3,…,Xn)=0, F(0,X2,X3,…,Xn)=1 ,填X1’
Digital Logic Design and Application ( 数字逻辑设计及应用 )
),,,0(),,,1(
),,,(
12'1121
121
XXFXXXFX
XXXF
178
YZ
WX00 01 11 10
00
01
11
10
1
1
1
1
1
1
1Y
WX00 01 11 10
0
1
1 0 Z Z
Z Z Z’ 0
思考:利用 74x151 实现逻辑函数F = (W,X,Y,Z)(0,1,3,7,9,13,14)
降维:由 4 维 3 维
Digital Logic Design and Application ( 数字逻辑设计及应用 )
179
EN
ABC
D0D1D2D3D4D5D6D7
YY
74x151
VCC
YXW
F
Z
利用 74x151 实现
F = (W,X,Y,Z)(0,1,3,7,9,13,14)
0 2 6 4
1 3 7 5
Y
WX00 01 11 10
0
1
1 0 Z Z
Z Z Z’ 0
Digital Logic Design and Application ( 数字逻辑设计及应用 )
180
A binary decoder with an enable input can be used as a demultiplexer( 利用带使能端的二进制译码器作为多路分配器 )
ABC
G1G2AG2B
Y0Y1Y2Y3Y4Y5Y6Y7
74x138
DST0_L
DST7_L
数据输入 SRC
EN_L
利用 74x139 实现 2 位 4 输出多路分配器( Figure 6-65 )
DSTSEL0DSTSEL1DSTSEL2
地址选择
—— Enable input is connected to the data line ( 利用使能端作为数据输入端 )
数据输入 SRC
EN_L
181
译码器编码器三态器件多路复用器Parity Circuit
(奇偶校验器 )
Comparator
(比较器 )
奇校验:输入有奇数个 1 ,输出为 1
偶校验:输入有偶数个 1 ,输出为 1
利用异或运算实现 9 位奇偶发生器 74x280
奇偶校验的应用
—— 检测代码在传输和存储
过程中是否出现差错。
Review of Last Class (内容回顾 )
182
9-bit Odd/Even Parity Generator 74x280 (9 位奇偶校验发生器 74x280( P291 图 5 - 75 )
ABCDEFGHI
EVEN
ODD
74x280
Digital Logic Design and Application ( 数字逻辑设计及应用 )
183
Parity-Checking Applications(奇偶校验的应用 )
用于检测代码在传输和存储过程中是否出现差错
A
EVEN
ODD
74x280
HI
A
EVEN
ODD
74x280
HI
发端
收端
DB[0:7] DB[0:7]
ERROR
发端保证有偶数个 1 收端 ODD 有效表示出错奇数 EVEN
184
6.9 Comparator (比较器)Compare two Binary words and indicate whether
they are equal
(比较 2个二进制数值并指示其是否相等的电路 )
Comparator: Check if two Binary words are
equal
( 等值比较器:检验数值是否相等 )
Magnitude Comparator: Compare their
magnitude (Greater than, Equal, Less than)
(数值比较器:比较数值的大小( >,=,<) )
Digital Logic Design and Application ( 数字逻辑设计及应用 )
185
6.9 Comparator (比较器)
How to build a 1-bit Comparator?
( 如何构造 1位等值比较器?? )
—— Use XOR (XNOR)
(利用异或门(同或门) )
AB DIFF A
B EQ
DIFF : different EQ : equal
Digital Logic Design and Application ( 数字逻辑设计及应用 )
186
DIFF
A0B0
A1B1
A2B2
A3B3 给出足够的异或门和宽度足够的或门,
可以搭建任意输入位数的等值比较器。
How to Build a N-bit Comparator?
(如何构造多位等值比较器?? )
必须每位都相等 —— 并行比较—— 串行比较
4 位等值比较器
Digital Logic Design and Application ( 数字逻辑设计及应用 )
187
An Iterative Comparator(迭代比较电路 )
X YCMP
EQI EQO
X0 Y0 X1 Y1 XN-1YN-1
EQ1 EQ2 EQNEQN-1
1 X YCMP
EQI EQO
X YCMP
EQI EQO
—— 每位串行比较AB EQ
EQO
EQI
迭代的方法可能节省费用,但速度慢
用于级联的输入
Digital Logic Design and Application ( 数字逻辑设计及应用 )
Figure 6-77
188
EQ_L
A
B
LT_L
GT_L
1-Bit Magnitude Comparator (一位数值比较器 )
① A>B( A=1, B=0 )则 A·B’=1 可作为输出信号
② A<B( A=0, B=1 )则 A’·B=1 可作为输出信号
③ A=B ,则 A⊙B=1,可作为输出信号输出低电平有效
EQ_L = A·B’+A’·B = AB = (A⊙B)’
LT : Less Than
EQ : Equal
GT : Greater Than
(A’·B)’
(A·B’)’
Digital Logic Design and Application ( 数字逻辑设计及应用 )
189
n-Bit Magnitude Comparator(多位数值比较器 )
A(A3A2A1A0) 和 B(B3B2B1B0) 自高而低逐位比较
EQ = (A3⊙B3)·(A2⊙B2)·(A1⊙B1)·(A0⊙B0)
GT = (A3>B3)
LT = EQ’ · GT’ = ( EQ + GT )’
或 (A3 = B3)· (A2 = B2)· (A1>B1)
或 (A3 = B3)·(A2 = B2)·(A1 = B1)· (A0>B0)
或 (A3 = B3)· (A2>B2)A3· B3’ A2· B2’
A1· B1’
A0· B0’
⊙
⊙⊙
⊙⊙ ⊙
+
+
+
Digital Logic Design and Application ( 数字逻辑设计及应用 )
190
74x85
4-Bit Comparator 74x85 ( 4位比较器 74x85)
A0
A1
A2
A3
ALTBINAEQBINAGTBIN
级联输入,用于扩展
ALTBOUT = (A<B) + (A=B)·ALTBIN
通常低位的输出接高位的输入
A=B :低位和高位都相等
A 高位 >B 高位
A 高位 =B 高位 & A 低位 >B 低位
A>B
AEQBOUT = (A=B)·AEQBIN
AGTBOUT = (A>B) + (A=B)·AGTBIN
Digital Logic Design and Application ( 数字逻辑设计及应用 )
191
Serial Expanding Comparators(比较器的串行扩展 )
XD[11:0]
YD[11:0]
[3:0] [7:4] [11:8]
X<YX=YX>Y
+5V
A<BIA=BIA>BI
A<BOA=BOA>BO
A0~A3B0~B3
74x85
A<BIA=BIA>BI
A<BOA=BOA>BO
A0~A3B0~B3
74x85
A<BIA=BIA>BI
A<BOA=BOA>BO
A0~A3B0~B3
74x85
3 片 74x85 构成 12 位比较器
低位 高位
Digital Logic Design and Application ( 数字逻辑设计及应用 )
192
P0
P1
P2
P3
P4
P5
P6
P7
8位比较器 74x682内部逻辑图:图 6-82
问题 1 :怎样表示以下输出? 高电平有效: P DIFF Q
高电平有效: P EQ Q
高电平有效: P GE Q
高电平有效: P LT Q
( 图 6-81 )
GE
LT
问题 2 :能否扩展??注意:没有级联输入端
Digital Logic Design and Application ( 数字逻辑设计及应用 )
193
3 片 74x682 构成 24 位比较器
P0~P7 P=Q
Q0~Q7 P>Q
P0~P7 P=Q
Q0~Q7 P>Q
P0~P7 P=Q
Q0~Q7 P>Q
[7:0]
[15:8]
[23:16]
P[23:0]Q[23:0]
PEQQ
PGTQ
Paralel Expanding Comparators(比较器的并行扩展 )
194
6.10 Adder (加法器 )
Half Adder and Full Adder (半加器和全加器)
0 0 0 00 1 0 11 0 0 11 1 1 0
A B SCO
( 半加器真值表 )
Sum ( 相加的和 ): S = A’·B + A·B’ = A B
Carry ( 向高位的进位 ) : CO = A·B
0 0 0 0 00 0 1 0 10 1 0 0 10 1 1 1 01 0 0 0 11 0 1 1 01 1 0 1 01 1 1 1 1
CI X Y SCO
( 全加器真值表 )
Truth Table of Half Adder Truth Table of Full Adder
Digital Logic Design and Application ( 数字逻辑设计及应用 )
195
SCO
XYCI
S = X Y CI
X·Y
0 0 1 0
0 1 1 1
CI
XY00 01 11 10
0
1
CO
X·CICO = + +Y·CI
= X·Y + (X+Y)·CI
0 0 0 0 00 0 1 0 10 1 0 0 10 1 1 1 01 0 0 0 11 0 1 1 01 1 0 1 01 1 1 1 1
CI X Y SCO
全加器真值表
6.10 Adder (加法器 )
6.10.1 Half Adders and Full Adders (半加器和全加器)
Truth Table of Full Adder
Digital Logic Design and Application ( 数字逻辑设计及应用 )
196
6.10.2 Ripple Adders (串行进位加法器 )
( 缺点:运算速度慢,有较大的传输延迟 )
tADD = tXYCout + (n-2)*tCinCout + tCinS
X Y
CI COS
X Y
CI COS
X Y
CI COS
X Y
CI COS
C1 C2 C3C4C0
S0 S1 S2 S3
X0 Y0 X1 Y1 X2 Y2 X3 Y3
=0
回顾:串行比较器 —— Improve Speed: Parallel Adder ( 提高速度:并行加法器 )
Disadvantage: Slow, More Propagation Delay
Digital Logic Design and Application ( 数字逻辑设计及应用 )
197
X Y
CI COS
X Y
CI COS
X Y
CI COS
X Y
CI COS
C1 C2 C3C4C0
S0 S1 S2 S3
X0 Y0 X1 Y1 X2 Y2 X3 Y3
X YCMP
EQI EQO
X0 Y0 X1 Y1 XN-1YN-1
EQ1 EQ2 EQNEQN-11
X YCMP
EQI EQO
X YCMP
EQI EQO
An Iterative Comparator(串行比较器 )
Ripple Adder(串行加法器 )Primary Inputs( 主 输 入 )
Primary Outputs (主 输 出 )
BoundaryInputs(边界输入 )
BoundaryOutputs(边界输出 )
级联输出
198
An Iterative Circuit(迭代电路)
Iterative :重复的 , 反复的 , [数 ] 迭代的
PICI CO
PO
PICI CO
PO
PICI CO
PO
C0 C1 C2 Cn
PO0 PO1 POn-1
主 输 出
PI0 PI1 PIn-1
主 输 入
边界输入
边界输出
级联输出
Digital Logic Design and Application ( 数字逻辑设计及应用 )
199
6.10.3 Subtractors (减法器 ) 方法一:利用真值表化简设计减法器
二进制减法表(表 2-3 )D = X Y BI BO = X’·Y + X’·BI + Y·BI
方法二:利用加法器设计减法器( X- Y )相当于( X+ Y 补)对 Y 求补:逐位求反+ 1
1X Y
CI COS
X YCI CO
S
X YCI CO
SB_L
X0 Y0 X1 Y1 Xn Yn
D0 D1 Dn
Digital Logic Design and Application ( 数字逻辑设计及应用 )
200
一位全加器: S = X Y Ci
Ci+1 = X·Y + (X+Y)·Ci
6.10.4 Carry-Lockahead Adders (先行进位加法器 )
先行进位法:第 i 位的进位输入信号可以由该位以前的各位状态决定。
Ci+1 = (Xi·Yi) + (Xi+Yi)· Ci
= Gi + Pi · Ci
进位产生信号 进位传递信号
0 0 0 0 00 0 1 0 10 1 0 0 10 1 1 1 01 0 0 0 11 0 1 1 01 1 0 1 01 1 1 1 1
Ci X Y SCi+1
全加器真值表
Digital Logic Design and Application ( 数字逻辑设计及应用 )
201
先行进位法:第 i 位的进位输入信号可以由该位以前的各位状态决定。
C0 = 0Ci+1 = Gi + Pi · Ci
C0 = 0
C1 = G0+P0·C0
C2 = G1+P1·C1 = G1+P1·(G0+P0·C0)
= G1+P1·G0+ P1·P0·C0
… …
Cn = Gn+Pn·Cn (图 6-89 )
展开为“与 -或”式:三级延迟
MSI加法器74x283
图 6-87 6-88
Digital Logic Design and Application ( 数字逻辑设计及应用 )
6.10.4 Carry-Lockahead Adders (先行进位加法器 )
202202
Adder Example: DIP-Switch-Based Adding Calculator
Goal: Create calculator that adds two 8-bit binary numbers, specified using DIP switches
DIP switch: Dual-inline package switch, move each switch up or down
Solution: Use 8-bit adder
203
Adder Example: DIP-Switch-Based Adding Calculator
Solution: Use 8-bit adderDIP switches
10
a7……..a0
b7……..b0
s7…………s0
8-bit carry-ripple adderco
ci 0
CALC
LEDs
204204
Adder Example: DIP-Switch-Based Adding Calculator
To prevent spurious( 假的) values from appearing at output, can place register at output Actually, the light flickers from spurious values would be too fast for humans to detect —but the principle of registering outputs to avoid spurious values being read by external devices (which
normally aren’t humans) applies here.
205
Adder Example: DIP-Switch-Based Adding Calculator
DIP switches
10
a7…….a0
b7……b0
s7………s0
8-bit adder
8-bit register
coci 0
CALC
LEDs
e
clkld
206
设计减法器 方法一:利用真值表化简
二进制减法表(表 2-3 )D = X Y BI BO = X’·Y + X’·BI + Y·BI
方法二:利用加法器设计减法器( X- Y )相当于( X+ Y 补)对 Y 求补:逐位求反+ 1
1X Y
CI COS
X YCI CO
S
X YCI CO
SB_L
X0 Y0 X1 Y1 Xn Yn
D0 D1 Dn
Digital Logic Design and Application ( 数字逻辑设计及应用 )
207207
Adder/Subtractor
Adder/subtractor: control input determines whether add or subtractCan use 2x1 mux – sub input passes either
B or inverted BAlternatively, can use XOR gates – if sub
input is 0, B’s bits pass through; if sub input is 1, XOR inverts B’s bits
208208
Adder/Subtractor
b7 b6sub
adders B inputs
0 1N-bit 2x1
N-bitA
A
S
B
B
sub
Adder cin
209
Adder/Subtractor Example: Calculator
Previous calculator used separate adder and subtractor
DIP switches10
8-bit registerCALC
LEDs
e
f
clkld
8
8
80 0
8
8
8
882 x10 1
10
wiciA AB B
S Sco wo8-bit adder 8-bit subtractor
210210
Adder/Subtractor Example: Calculator
Improve by using adder/subtractor, and two’s complement numbers
DIP switches10
8-bit register
8-bit adder/subtractorsub
CALC
LEDs
e
S
A Bf
clkld
10
8 8
8
8
211211
Subtractor Example: DIP-Switch Based
Adding/Subtracting Calculator
Extend earlier calculator exampleSwitch f indicates whether want to add
(f=0) or subtract (f=1)Use subtractor and 2x1 mux
212212
Subtractor Example: DIP-Switch Based
Adding/Subtracting CalculatorDIP switches
10
8-bit register CALC
LEDs
e
f
clkld
8
8
80
08
8
8
882x10 11
0
wiciA AB B
S Sco wo8-bit adder 8-bit subtractor
213213
IncrementerAdds 1 to input A
s20001111000011110
s10110011001100110
s01010101010101010
s30000000111111110
c00000000000000001
a00101010101010101
a10011001100110011
a30000000011111111
Inputs Outputsa20000111100001111
0 0 1 10 1 1
1+
carries:
unused
0000 1
214214
Incrementer
(a)
(b)
a3 a2 a1 a0 1
s0s1s2s3co
a b
co s
HA
a b
co s
HA
a b
co s
HA
a b
co s
HA
Incr
em
en
ter
(+1
)
a3
co s3 s2
+1
s1 s0
a2 a1 a0
Could design using combinational design process, but smaller design uses carry-ripple, only need half-adders
215215
Multiplier – Array StyleCan build multiplier that mimics multiplication by hand
Notice that multiplying multiplicand by 1 is same as ANDing with 1
4.5
216216
Multiplier – Array Style
Generalized representation of multiplication by hand
217217
Multiplier – Array Style
Multiplier design – array of AND gates
A B
P*
Block symbol
+ (5-bit)
+ (6-bit)
+ (7-bit)
00
000
0
a0a1a2a3
b0
b1
b2
b3
0
p7..p0
pp1
pp2
pp3
pp4
218
6.10.6 MSI Arithmetic and Logic Units
(ALU, MSI 算术逻辑单元 )Perform any of a number of different arithmetic and logical operations on a pair of b-bit operands.( 对 2个 b 位的操作数进行若干不同的算术和逻辑运算 )
S0~S3
M
CIN
A0~A3
B0~B3
GP
F0~F3
COUT
A=B
74x181
输入数据输出数据
0算术 /1 逻辑选择特定操作 Table 6-70
Figure 6-90 6-91 6-92 6-93
Digital Logic Design and Application ( 数字逻辑设计及应用 )
219219
Arithmetic-Logic Unit: ALU
ALU: Component that can perform various arithmetic
(add, subtract, increment, etc.) and logic (AND, OR, etc.) operations, based on control inputs
4.7
220220
Arithmetic-Logic Unit: ALU4.7
221
Multifunction Calculator without an ALU
Can build using separate components for each operation, and muxesToo many wires, also wastes power computing operations
when only use one result at given time
222
Multifunction Calculator without an ALU
DIP switches10
8-bit register
8-bit 8x1
CALC
LEDs
ezyx
clkId
s0s1s2
1 001 2 3 4 5 6 7
NOTXORORAND+1+
8 8
888
8
8
8 8 8
88
A B
A lot of wires
Wastedpower
—
223223
ALUMore efficient design uses ALU
ALU design not just separate components multiplexed (same problem as previous slide)
Instead, ALU design uses single adder, plus logic in front of adder’s A and B inputsLogic in front is called an arithmetic-logic
extenderExtender modifies A and B inputs so desired
operation appears at output of the adder
224
ALU
(a)
ALU
IA IB
ISAdder
cin
A B
S
xyz
AL-extender
abext abext abext cinext
AL-extender
ia7ib7
a7 b7
ia6ib6
a6 b6
ia0ib0
a0 b0
cin
(b)
xyz
225225
Arithmetic-Logic Extender in Front of ALU
abext abext abext cinext
xyz
AL-extender
ia7 ib7
a7 b7
ia6 ib6
a6 b6
ia0 ib0
a0 b0
cin
(b)
(a)
ALU
IA IB
IS
Adder cin
A B
AL-extender
S
xyz
226226
Arithmetic-Logic Extender in Front of ALU
xyz=000 Want S=A+B : just pass a to ia, b to ib, and set cin=0
xyz=001 Want S=A-B : pass a to ia, b’ to ib and set cin=1 (two’s complement)
xyz=010 Want S=A+1 : pass a to ia, set ib=0, and set cin=1
xyz=011 Want S=A : pass a to ia, set ib=0, and set cin=0 xyz=100 Want S=A AND B : set ia=a*b, b=0, and cin=0 Others: likewise Based on above, create logic for ia(x,y,z,a,b) and
ib(x,y,z,a,b) for each abext, and create logic for cin(x,y,z), to complete design of the AL-extender component
227
ALU Example: Multifunction Calculator
DIP switches10
8-bit register
8-bit 8x1
CALC
LEDs
ezyx
clkId
s0s1s2
1 001 2 3 4 5 6 7
NOTXORORAND+1+
8 8
888
8
8
8 8 8
88
A B
A lot of wires
Wastedpower
—
228
ALU Example: Multifunction Calculator
Design using ALU is elegant and efficientNo mass of
wiresNo big
waste of power
DIP switches
10
10
8-bit register
ALUS
CALC
LEDs
e
zyx
clkld
zyx
8
8
8
8A
AB
B
229
S1 S0 Y
0 00 11 01 1
A·BA+BABA’
功能表设计函数发生器,其功能表如下:
S1 S0 A B Y
0 0 0 00 0 0 1
真值表
1 、填写真值表2 、选择器件
用基本门电路实现 利用卡诺图化简 用译码器实现 转换为最小项之和 用数据选择器实现
3 、电路处理注意有效电平
Digital Logic Design and Application ( 数字逻辑设计及应用 )
230
组合逻辑部分小结
第 4 章 组合逻辑设计原理第 6 章 组合逻辑设计实践
Digital Logic Design and Application ( 数字逻辑设计及应用 )
231
第 4 章 基本原理
开关代数基础
组合逻辑的基本分析、综合方法
冒险
开关代数的公理、定理 对偶、反演规则 逻辑函数的表示法
分析步骤,利用公式进行化简 设计方法、步骤 利用卡诺图化简,电路处理 无关项的化简、多输出函数的化简
—— 冒险的检查和消除
Digital Logic Design and Application ( 数字逻辑设计及应用 )
232
组合电路的分析分析的目的:
确定给定电路的逻辑功能分析步骤:
由输入到输出逐级写出逻辑函数表达式对输出逻辑函数表达式进行化简判断逻辑功能(列真值表或画波形图)
Digital Logic Design and Application ( 数字逻辑设计及应用 )
233
分析图示逻辑电路的功能B3
B2
B1
B0
G3
G2
G1
G0
解: 1 、写表达式2 、列真值表3 、分析功能
0 0 0 00 0 0 10 0 1 00 0 1 10 1 0 00 1 0 10 1 1 00 1 1 11 0 0 01 0 0 11 0 1 01 0 1 11 1 0 01 1 0 11 1 1 01 1 1 1
B3 B2 B1 B0 G3 G2 G1 G00 0 0 00 0 0 10 0 1 1
G3 = B3G2 = B3B2G1 = B2B1G0 = B1B0
二进制码至格雷码的转换电路
0 0 1 00 1 1 00 1 1 10 1 0 10 1 0 01 1 0 01 1 0 11 1 1 11 1 1 01 0 1 01 0 1 11 0 0 11 0 0 0
Digital Logic Design and Application ( 数字逻辑设计及应用 )
234
组合电路的综合
问题描述
逻辑抽象
选定器件类型
函数化简电路处理
将函数式变换
电路实现
真值表或
函数式
用门电路
用MSI 组合电路或
PLD
Digital Logic Design and Application ( 数字逻辑设计及应用 )
235
0 00 00 00 00 10 10 10 11 01 01 01 01 11 11 11 1
0 00 11 01 10 00 11 01 10 00 11 01 10 00 11 01 1
X1 X0 Y1 Y0
0 0 0 00 0 0 00 0 0 00 0 0 00 0 0 00 0 0 10 0 1 00 0 1 10 0 0 00 0 1 00 1 0 00 1 1 00 0 0 00 0 1 10 1 1 01 0 0 1
P3 P2 P1
P0
设计 2 位数乘法器
1、列真值表
输入: X、 Y(2
位)
输出:乘积 P(4
位)
P3 = X1·X0·Y1·Y0
Y1Y0
X1X0
00 01 11 1000
01
11
10
P2
1
11 2 、用门电路实现 利用卡诺图化简 注意:多输出函数
3 、电路处理
236
Y1Y0
X1X0
00 01 11 1000
01
11
10
0
1111
1111
1111
111
Y1Y0
X1X0
00 01 11 1000
01
11
10
1
11
1
Y1Y0
X1X0
00 01 11 1000
01
11
10
P2
1
11
P3 = X1·X0·Y1·Y0
P2 = X1·Y1 · (X1·X0·Y1·Y0)’
= X1·Y1·P3’
237
Y1Y0
X1X0
00 01 11 1000
01
11
10
P1
1
1
1
11
1
Y1Y0
X1X0
00 01 11 1000
01
11
10
P0
1
1 1
1
P3 = X1·X0·Y1·Y0
P2 = X1·Y1·P3’
P1 = X1·Y0·P3’+X0·Y1·P3’
P0 = X0·Y0
Y1Y0
X1X0
00 01 11 1000
01
11
10
P2
1
11
1
1
238
比较:按多输出化简(蓝色)按单个卡诺图化简(黑色)
P3 = X1 · X0 · Y1 · Y0
P2 = X1·X0·Y1 + X1·Y1·Y0’
P1 = X1·Y1’·Y0 + X1·X0’·Y0 + X0·Y1·Y0’ + X1’·X0·Y1
P0 = X0 · Y0
P3 = X1·X0·Y1·Y0
P2 = X1·Y1·P3’
P1 = X1·Y0·P3’+X0·Y1·P3’
P0 = X0·Y0
考虑:用译码器实现 —— 直接表示为标准和形式
Digital Logic Design and Application ( 数字逻辑设计及应用 )
239
人的血型有 A、 B、 AB、 O 四种,输血者的血型与受血者的血型必须符合下面的关系。设计逻辑电路判断输血者与受血者的血型是否符合规定。
A
B
AB
O
A
B
AB
O
输血者 受血者
解: 1 、逻辑抽象,得真值表 用 X1X0对应输血者的血型( 00~11 ) 用 Y1Y0对应受血者的血型( 00~11 ) 输出 F, 1 表示可以输血, 0 表示不行00
01
10
11
00
01
10
11
0 0 0 00 0 0 10 0 1 00 0 1 10 1 0 0
X1X0 Y1Y0 F
10100
2 、用门电路实现 卡诺图化简 (略)利用译码器利用多路复用器
240240
Subtractor Example: Color Space Converter – RGB to
CMYKColor
Often represented as weights of three colors: red, green, and blue (RGB)Perhaps 8 bits each (0-255), so specific color is 24
bitsWhite: R=11111111 (255), G=11111111,
B=11111111Black: R=00000000, G=00000000, B=00000000Other colors: values in between, e.g.,
R=00111111, G=00000000, B=00001111 would be a reddish purple
Good for computer monitors, which mix red, green, and blue lights to form colors
241241
Subtractor Example: Color Space Converter – RGB to
CMYK• Printers use opposite
color scheme– Because inks
absorb light– Use complementary
colors of RGB: – Cyan (absorbs red),
reflects green and blue,
– Magenta (absorbs green), and
– Yellow (absorbs blue)
242242
Subtractor Example: Color Space Converter – RGB to
CMYK
Printers must quickly convert RGB to CMY C=255-R, M=255-G,
Y=255-BUse subtractors as
shown
— — —
R G B
8888
88
8 8 8
255 255 255
C M Y
243243
Subtractor Example: Color Space Converter – RGB to
CMYK
Try to save colored inksExpensive Imperfect – mixing C, M, Y doesn’t yield
good-looking black
244244
Subtractor Example: Color Space Converter – RGB to
CMYK
Solution: Factor out the black or gray from the color, print that part using black inke.g., CMY of
(250,200,200)= (200,200,200) + (50,0,0).(200,200,200) is a dark
gray – use black ink
245
Subtractor Example: Color Space Converter – RGB to
CMYK Call black part K
(200,200,200): K=200 (Letter “B” already used for blue)
Compute minimum of C, M, Y values Use MIN component designed earlier, using
comparator and mux, to compute K Output resulting K value, and subtract K value
from C, M, and Y values Ex: Input of (250,200,200) yields output of
(50,0,0,200)
246
Subtractor Example: Color Space Converter – RGB to
CMYK
— — —8 8C2 M2 Y2 K
8
8
888 8
8 8
MIN
MIN
C
C M Y
R GRGB to CMY
B
M Y
K
R G B8 8 8
247
设计将 BCD码转换成余 3码的码制转换电路
方案一:利用基本门电路( SSI )实现1 、列真值表
0 0 1 10 1 0 00 1 0 10 1 1 00 1 1 11 0 0 01 0 0 11 0 1 01 0 1 11 1 0 0
0 0 0 00 0 0 10 0 1 00 0 1 10 1 0 00 1 0 10 1 1 00 1 1 11 0 0 01 0 0 11 0 1 0 … …1 1 1 1
X3~X0 F3~F0
d
2 、卡诺图化简(多输出函数)3 、电路处理,得到电路图 “与 -或”式 “与非 -与非”式 “或 -与”式 “或非 -或非”式
方案二:利用中规模集成电路 MSI 实现 —— 译码器实现多输出函数
思考:有没有更好的方法???
Digital Logic Design and Application ( 数字逻辑设计及应用 )
248
X1X0
X3X200 01 11 10
00
01
11
10
F3
1
1
1
1
1
d
d
d
d
d
d
X1X0
X3X200 01 11 10
00
01
11
10
F2
1
1
1
1
1
d
d
d
d
d
d
X1X0
X3X200 01 11 10
00
01
11
10
F1
1
11
1 1
d
d
d
d
d
d
X1X0
X3X200 01 11 10
00
01
11
10
F0
1
11
1 1
d
d
d
d
d
d
249
设计将 BCD 码转换成余 3 码的码制转换电路一个更好的方法:余 3 码 = BCD 码 + 3 —— 利用加法器( MSI )实现
A0A1A2A3
B0B1B2B3
C0
S0S1S2S3
C4
74x283
X0X1X2X3
F0F1F2F3
VCC 1100
Digital Logic Design and Application ( 数字逻辑设计及应用 )
250
实现两个 BCD码的加法运算思考:两个 BCD 码与两个 4 位二进制数相加的区别 如果 (X+Y)产生进位信号 C 或 在 1010~1111 之间 需要进行修正 —— 结果加 6
利用 F 表示是否需要修正F = C + S3·S2·S1·S0 + S3·S2·S1·S0’
+ S3·S2·S1’·S0 + S3·S2·S1’·S0’
+ S3·S2’·S1·S0 + S3·S2’·S1·S0’
X1X0
X3X200 01 11 10
00
01
11
10
1
1
1
1
1
1
F = C + S3·S2 +S3·S1
Digital Logic Design and Application ( 数字逻辑设计及应用 )
251相加 判别 修正
A0 S0A1 S1A2 S2A3 S3
B0B1B2B3
C0 C4
74x283A0 S0A1 S1A2 S2A3 S3
B0B1B2B3
C0 C4
74x283X0X1X2X3
Y0Y1Y2Y3
F0F1F2F3
C
实现两个 BCD 码的加法运算 需要 2 个加法器,分别进行加法运算和修正 判别逻辑: F = C + S3·S2 +S3·S1
电路组成
F
252
分析下面电路,写出输出与输入之间的关系 已知:输出为二进制数, X3~0 和 Y3~0 为十进制数的 BCD
码
CI
A3 A2 A1 A0 COB3 S3B2 S2B1 S1B0 S0
Y1Y0
X3X2X1X0
CI
A3 A2 A1 A0 COB3 S3B2 S2B1 S1B0 S0
Y3Y2
Z6Z5Z4Z3
Z2Z1Z0
Y1 Y0 Y1 Y0 0X3 X2 X1 X0+
C S3 S2 Z2 Z1 Z0
+ Y3 Y2 Y3 Y2 0 0 0
Z6 Z5 Z4 Z3 Z2 Z1 Z0
Z = X+Y*2+Y*8 = X+Y*10
将十进制 BCD数 YX 转换为二进制数 Z (0100 1000)BCD = (0110000)2
Y3 Y2 Y1 Y0 0X3 X2 X1 X0+
+ Y3 Y2 Y1 Y0 0 0 0
Z6 Z5 Z4 Z3 Z2 Z1 Z0
253
Example: Sprinkler Controller
Microprocessor outputs which zone to water (e.g., cba=110 means zone 6) and enables watering (e=1)
Decoder should set appropriate valve to 1
254
Example: Sprinkler Controller
d0 = a'b'c'ed1 = a'b'ced2 = a'bc'ed3 = a'bced4 = ab'c'ed5 = ab'ced6 = abc'ed7 = abce
Step 1: Capture behavior
Equations seem like a natural fit
d0d1d2d3d4d5d6d7e
c
Decoder
Micro-Proce-ssor
b
a
zone 0zone 1
2
43
56
7
255255
Example: Sprinkler ControllerStep 2b: Implement
as circuitd0d1d2d3d4d5d6d7e
c
decoder
Micro-processor
b
a
zone 0 zone 1
2
43
56
7
d0 = a'b'c'ed1 = a'b'ced2 = a'bc'ed3 = a'bced4 = ab'c'ed5 = ab'ced6 = abc'ed7 = abce
abc
e
d0
d1
d2
d3
d4
d5
d6
d7
256
第 6 章 组合逻辑设计实践常用的中规模集成电路(MSI)
编码器、译码器、多路复用器、奇偶校验、
比较器、加法器、三态器件掌握基本功能,级联的方法综合应用:利用基本MSI 器件作为基本单元设计更复杂的组合逻辑电路
文档标准和电路定时(了解)
Digital Logic Design and Application ( 数字逻辑设计及应用 )
257
第 4 章教学大纲要求 重点学习掌握逻辑代数的公理、定理,对偶关系,以及在逻辑代数化简时的作用;逻辑函数的表达形式:积之和与和之积标准型、真值表;组合电路的分析:逻辑函数表达式的产生过程及逻辑函数表达式的基本化简方法——函数化简方法;组合电路的综合过程:将功能叙述表达为组合逻辑函数的表达形式、逻辑函数表达式的化简——函数化简方法和卡诺图化简方法、使用与非门、或非门表达的逻辑函数表达式、逻辑函数的最简表达形式及综合设计的其他问题:无关项的处理、冒险问题和多输出逻辑化简的方法。(共 10学时)
Digital Logic Design and Application ( 数字逻辑设计及应用 )
258
第 6 章教学大纲要求 重点学习掌握:学习利用基本的逻辑门完成规定的组合逻辑电路的设计任务:如译码器、编码器、多路选择器、多路分配器、异或门、比较器、全加器。学习利用基本的逻辑门和已有的中规模集成电路( MSI)逻辑器件如译码器、编码器、多路选择器、多路分配器、异或门、比较器、全加器、三态器件等作为设计的基本元素完成更为复杂的组合逻辑电路设计的方法。
Digital Logic Design and Application ( 数字逻辑设计及应用 )
259
第六章 作业(四版)6.296.43
Digital Logic Design and Application ( 数字逻辑设计及应用 )
260
第五章 作业(三版)5.28 (6.29)5.82 (6.43)
Digital Logic Design and Application ( 数字逻辑设计及应用 )
261
用数据选择器 74x151实现逻辑函数
F = (W,X,Y,Z) (1,3,5,
6,8,10,12,14,15)
Digital Logic Design and Application ( 数字逻辑设计及应用 )
A Class Problem ( 每课一题 )
EN
ABC
D0D1D2D3D4D5D6D7
YY
74x151