application of boolean algebra / minterm and …ocw.nthu.edu.tw/ocw/upload/230/2462...unit 4 2...
TRANSCRIPT
Unit 4 1
Unit 4
Application of Boolean Algebra / Minterm and Maxterm Expansion
Unit 4 2
Outline
․Conversion of sentences to Boolean equations ․Truth table-based logic design ․Minterm and maxterm expansions ․Incompletely specified functions ․Binary adders and subtracters ․Speeding up integer additions ․Binary multiplication
Unit 4 3
..6
:
'
'
A
D
CB
Z
closednotiswindowthe
andmpafterisitorclosednotisdoorthe
andonisalarmofpowertheiffringwillalarmTheEx
'' CDABZ
Conversion of Sentences to Boolean Equations
Unit 4 4
By “1's” function
BCA ABCA'
ABAB'BCA' ' ' ' ' '
ABCABCCABCABBCAf
B
C
AF
Truth Table-based Logic Design (1/2)
0111101011011010100101110100101010010000
'ffCBA
ABC
f
ABC
f
Unit 4 5
By “0's” function
1 , 0 1 , 0
0 ,
' )'()( ' '
BCACBA
CBAifisf
BCACBBACBABACBACBACBAf
“0”
By 'f
CBACBACBAf
BCACBACBAf
''
''''''''
Truth Table-based Logic Design (2/2)
0111101011011010100101110100101010010000
'ffCBA
Unit 4 6
',,', : Literals,,,,:Variables
YYXXCBAZYX
'''' BCBAABCF
Example3 variables 7 literals
Minterm & Maxterm Expansions (1/10)
01M' C' B'A mABC111701MC' B'A m' ABC011601M' CB'A mC' AB101501MCB'A m' C' AB001401M' C' BAmBCA'110310MC' BAm' BCA'010210M' CBAmC' BA'100110MCBAm' C' B'A 0000
' MaxtermsMintemsCBANo. Row
77
66
55
44
33
22
11
00
ff
Unit 4 7
Minterm & Maxterm Expansions (2/10)
00maxterm
)2,1,0(),,()'()'()( 210
f
MCBAfMMMCBACBACBAf
1 1termmin)7,6,5,4,3(),,(
'''''76543
f
mCBAformmmmm
ABCABCCABCABBCAf
Unit 4 8
Minterm & Maxterm Expansions (3/10)
)7,6,5,4,3(''''')'('
)2,1,0(''')'()''(
),,(')7,6,5,4,3(),,(
76543
210
7654376543
210210
210
MMMMMMmmmmmmmmmmf
MMMMmmmmmmff
mmmCBAfmCBAf
Unit 4 9
Minterm & Maxterm Expansions (4/10)
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
101111010111101011100011011101010101101001100001011110010110101010010010011100010100101000100000
'
mmmmmmmmmmmmmmmm
ggDCBAExample Another
)15,13,12,9,8,5,1,0(
)15,13,12,9,8,5,1,0('
]')15,13,12,9,8,5,1,0([
)15,13,12,9,8,5,1,0('
)15,13,12,9,8,5,1,0(
)14,11,10,7,6,4,3,2(
M
m
mg
mg
Mor
mg
Unit 4 10
Minterm & Maxterm Expansions (5/10)
0000 0001 0010 0011
f a 'b ' a 'd acd ' a 'b ' c c ' d d ' a 'd b b ' c c ' acd ' b b '
a 'b 'c 'd ' a 'b 'c 'd a 'b 'cd ' a 'b 'cd a 'b 'c 'd a 'b 'cd a 'bc 'd a 'bcd abcd ' ab 'cd '
0101 0111 1110 10100 1 2 3 5 7 1 0 14
4 6 8 9 11 12 13 15
m , , , , , , ,
Find Maxterm Expansion f M , , , , , , ,
Unit 4 11
Minterm & Maxterm Expansions (6/10)
)7,6,4,3,1,0(
)'(')'()'(''
)7,6,4,3,1,0(
)'(c'b')a'(a)b'(bca'
463701
670413
mmmmmmm
bbacbcaaccbaRHS
mmmmmmm
ccabLHS
Unit 4 12
Minterm & Maxterm Expansions (7/10)
7
0 0 1 1 2 2 7 7 0
0 0 1 1 2 2 7 77
0
F ... (a)
If term exists 1
OR......
( )
If term does not exist 1
1 1
i ii
th i
i ii
th i
i
a m a m a m a m a m
i a
F (a M )(a M )(a M ) (a M )
(a M ) b
i a
( M )
7
6
5
4
3
2
1
0
111011101001110010100000
aaaaaaaaFCBA
Unit 4 13
Minterm & Maxterm Expansions (8/10)
77
66
55
44
33
22
11
00
11111011010100010110101011000000
MmMmMmMmMmMmMmMm
FCBA
Unit 4 14
Minterm & Maxterm Expansions (9/10)
)'(
)''(]')([')(
)'()''(
')(]')([')(
ii
iiii
iiii
iiii
Ma
mamaFaFrom
maMa
MaMaFbFrom
Unit 4 15
2 1 2 1
0 0
2 1 2 1
0 0
2 1
1 20
General Form : F ( )
F' ' ( ' )
: 0 i j Ex:(ABCD)(ABCD) 0
So: f f
n n
n n
n
i i i ii i
i i i ii i
i j
i ii
a m a M
a m a M
property m m if
a m
2 1
0
2 1 2 1 2 1 2 1
1 2 0 0 0 0
1 2
f f ( )( )
( terms 0) Ex: f (0,2,3,5,9,11) f (0,3,9,11,13,14
n
n n n n
j jj
i i j j i j i ji j i j
i i i
b m
a m b m a b m m
a b m i jm m
1 2
) f f (0,3,9,11)m
Minterm & Maxterm Expansions (10/10)
Unit 4 16
Incompletely Specified Functions (1/2)
ABC
FN2N1xyz
Unit 4 17
1111011
0101000111100010
caret don' 1001000
2
X
X
FCBA
N
1111011
0101000111100010
caret don' 1001000
2
X
X
FCBA
N
Ⅰ.X , X = 0 , 0
Ⅱ. X , X = 1 , 0
Ⅲ. X , X = 1 , 1
BC' C' B' AABCBC' A' C' B' AF
BCB'' AABCBC' AC' B' A' C' B' AF
ABBC' B' AABC' ABCBC' AC' B' A' C' B' AF
1,6D 5,4,2Mor
6,1d7,3,0mF
Incompletely Specified Functions (2/2)
Unit 4 18
Binary Adders & Subtracters (1/9)
․Half Adder:
011101110000
SumYX
SumHalfAdder
X
Y
Unit 4 19
Binary Adders & Subtracters (2/9)
․Full Adder:
SumFullAdder
XY
Cout
Cin
1111101011011011000101110100101010000000
SumCCYX outin
Unit 4 20
․ The logic equation for the full adder:
Binary Adders & Subtracters (3/9)
XYXCYCXYCXYCXYCCXYXYCYCX
XYCXYCCXYYCXCCYXCYXCYX
YCCYXYCCYXXYCCXYYCXCYXSum
inin
inininininin
ininininout
ininin
inininin
inininin
)'()'()'('''
)'()(')''()''('
''''''
Unit 4 21
․The logic circuit of full adder:
Binary Adders & Subtracters (4/9)
xyCin
Sum
xy
x
y
Cin
Cin
Cout
Unit 4 22
Binary Adders & Subtracters (5/9)
․ 4-Bit Parallel Adder (Ripple Carry Adder)Adds two 4-bit unsigned binary numbers
4-bit parallel adder
Unit 4 23
Binary Adders & Subtracters (6/9)
․ 4-Bit Parallel Adder (carries)
1 1 0 0 1 1 1 1A3 B3 A2 B2 A1 B1 A0 B0
1 0 1 1 0
C4 C3 C2 C1 C0
0 1 1 0S3 S2 S1 S0
FullAdder
FullAdder
FullAdder
FullAdder
End-around carry for 1’s complement
Parallel Adder Composed of Four Full Adders
Unit 4 24
Binary Adders & Subtracters (7/9)
․Binary Subtracter Using Full Adders:Subtraction of binary numbers is most easily accomplished by adding the complement of the number to be subtracted
FullAdder
FullAdder
FullAdder
FullAdder
A3 B3 A2 B2 A1 B1A4 B4
Binary Subtracter Using Full Adder
S4 S3 S2 S1
C4 C3 C2C1=1C5
B’1B’2B’3B’4
Unit 4 25
Binary Adders & Subtracters (8/9)
․Full Subtracter
xi=0 ,yi=1,bi=1
1111100011001011000101110110101110000000
1 iiiii dbbyx
Truth Table for Binary Full subtracter
)1(01111
100
1
ii
i
i
i
BorrowAfteriColumnBorrowBeforeiColumn
bdyb
x
Unit 4 26
Binary Adders & Subtracters (9/9)
․Parallel Subtracter : Direct subtraction can be accomplished by employing a subtracter.
FullSubtracter
FullSubtracter
FullSubtracter
FullSubtracter
Cell i
xi yi x2 y2 x1 y1xn yn
dn di d2 d1
b1=0bn+1 bn bi+1 bi b3 b2
Unit 4 27
Speeding Up Integer Additions
․Ripple carry adder Simple, regular Long delay
Last carry out needs 2n delay for n-bit adder
․Carry Lookahead Adder (CLA)
․Carry Select Adder
Unit 4 28
Carry Lookahead Adder (1/4)
A3 B3 A2 B2 A1 B1 A0 B0
C4 C3 C2 C1 C0
S3 S2 S1 S0
FullAdder
FullAdder
FullAdder
FullAdder
( )in
out in
Sum A B CC AB A B C
1( )i iC AB A B C
1 1 1 1 1( )i i i i i iC A B A B C
Unit 4 29
Carry Lookahead Adder (2/4)
1 1 1 1 1( )i i i i i iC A B A B C
1 0 0 0C g p C
1 1 1
1 1 1
;;
i i i
i i i
g A Bp A B
generate function
propagate function
2 1 1 1 1 1 0 0 0
1 1 0 1 0 0
( )C g p C g p g p Cg p g p p C
1 1 1i i i iC g p C
Unit 4 30
3 2 2 2 2 2 1 1 0 1 0 0
2 2 1 2 1 0 2 1 0 0
( )C g p C g p g p g p p Cg p g p p g p p p C
Carry Lookahead Adder (3/4)
1 1 2 1 2 3
1 2 1 0 1 2 0 0
n n n n n n n
n n n n
C g p g p p gp p p g p p p C
Delay of 4-bit adder: 2+23 =8 (ripple carry adder)2+3=5 (CLA)
Unit 4 31
Carry Lookahead Adder (4/4)
gn-1
cn
gn-2pn-1 pn-2 gn-3
p1 p0g0 c0
……
Unit 4 32
Carry Select Adder (1/2)
․Two additions are performed in parallel One assumes the carry-in is 0; the other assumes 1
․When the carry-in is finally known, the correct sum is selected (has been precomputed)
s7 s6 s5 s4
s3 s2 s1 s0
c0
a3 b3 a2 b2 a1 b1 a0 b0
a4b4
a4b4a7b7
0
1
c4
Unit 4 33
Carry Select Adder (2/2)
0 0 0
111
Unit 4 34
Binary Multiplication ․Performed in the same way as with decimal numbers
Multiplicand B, multiplier A Partial product Shift one bit left Sum of partial products B
0123
0111
0010
01
01
CCCCBABA
BABAAABB
HA HA
A0
A1
B0
B0B1
B1
C0C1C2C3