LEC4
LEC4
x y minterm
0 0 m0
0 1 m1
1 0 m2
1 1 m3
2
2-variable k-map
y x
x 0 1 y 0 1
0 1 0 2
0 m0 m1 OR 0 m0 m2
2 3 1 3
1 m2 m3 1 m1 m3
x y f x y f
0 0 0 0 0 0
0 1 0 0 1 1
1 0 0 1 0 1
1 1 1 1 1 1
4
2-variable k-map
𝑥′ 1 = 𝑚0+ 𝑚1
𝑥′ 2 = 𝑚0+ 𝑚2
Note that m0 is covered twice!
32
3-variable map
7
3-variable map: example 1
8
3-variable map: example 2
F (𝑥, 𝑦, 𝑧) = 𝑦𝑧 + 𝑥𝑧′
9
3-variable map: example 3
F 𝑥, 𝑦, 𝑧 = 𝑧′ + 𝑥𝑦′
10
3-variable map: example 4
14
4-variable map: example 1
15
4-variable map: example 1
𝐹 𝐴, 𝐵, 𝐶, 𝐷 = 𝐶′ + 𝐵′𝐷′ + 𝐴′𝐵𝐷
16
4-variable map: example 2
17
4-variable map: example 2
Simplify the Boolean expression:
𝐹 (𝑤, 𝑥, 𝑦, 𝑧) = Σ(0,1,2,4,5,6,8,9,12,13,14)
18
Choice of blocks
Implicant (I)
Any product term in the SOP form
A block of 1s in a K-map
Prime implicant (PI)
Block of 1s that cannot be further increased
Product term that cannot be further reduced
Essential prime implicant (EPI)
A prime implicant on a K-map which covers at least one 1 which is not
covered by any other prime implicant is called an Essential Prime
Implicant
21
Illustrating the terms: example 1
1 1 1
1 1 1
1 1
22
Illustrating the terms: example 1
1 1 1
1 1 1
24
Illustrating the terms: example 2
• 𝐵𝐷 𝑔𝑟𝑎𝑦 ,
• 𝐴′𝐵𝐶′ 𝑦𝑒𝑙𝑙𝑜𝑤 ,
• 𝐴𝐶′𝐷 𝑝𝑢𝑟𝑝𝑙𝑒 ,
• 𝐴𝐵𝐶 𝑔𝑟𝑒𝑒𝑛 ,
• 𝐴′𝐶𝐷 𝑟𝑜𝑠𝑒 .
26
Product of sums minimization
How to generate a POS from a K-map?
• Example: 11 0 0 0 0
• 𝐹 = ∑ (0,1,2,5,8,9,10) 10 1 1 0 1
27
Product of sums minimization
How to generate a POS from a K-map?
• 𝐹 = ∑(0,1,2,5,8,9,10) 10 0
28
Product of sums minimization
How to generate a POS from a K-map?
𝐹 = ∑(0,1,2,5,8,9,10)
𝐹′ = 𝐴𝐵 + 𝐶𝐷 + 𝐵𝐷′ CD
00 01 11 10
𝐹 = (𝐴′ + 𝐵′)(𝐶′ + 𝐷′)(𝐵′ + 𝐷)
AB
0
01 0 0 0
11 0 0 0 0
10 0
29
Gate implementation
31
Example on POS minimization
𝐹′ = AB′+AC′+A′BCD ′
𝐹 = (AB′)(AC′)(A′BCD′ )
𝐹 = (𝐴′ + 𝐵)(𝐴′ + 𝐶)(𝐴 + 𝐵′ + 𝐶′ + 𝐷)
32
Don’t care conditions
33
Minimization using don’t cares
34
Minimization example
𝐹= w ’z + y z 24
24
Example involving X
Simplify the function whose K-map is
shown at the right
25
Another example
𝐹 = 𝐴′𝐶′ + 𝐴𝐵
or
𝐹 = 𝐴′𝐶′ + 𝐵𝐷′
37
Combinational Building Blocks
• Half Adder
• Full Adder
• Binary Adder/Subtractor
• Decoder
• Multiplexer
Digital Design and Computer Architecture: ARM® Edition © 2015 Chapter 2 <38>
Half adder
x S
Half Adder
y C
39
Half adder
40
Half adder
𝐶 = 𝑥𝑦 𝑆 = 𝑥𝑦 ′ + 𝑥 ′ 𝑦
=𝑥⊕𝑦
41
Half adder
42
Full adder
x
S
y Full Adder
z C
43
Full adder
44
Full adder
𝑆 = 𝑥 ′ 𝑦 ′ 𝑧 + 𝑥 ′ 𝑦𝑧 ′ + 𝑥𝑦 ′ 𝑧 ′ + 𝑥𝑦𝑧
Remember that:
𝑥⊙𝑦 = 𝑥 ⊕ 𝑦, 𝑥 ⊕ 𝑦 = 𝑥𝑦 ′ + 𝑥 ′ 𝑦, 𝑥⊙𝑦 = 𝑥𝑦 + 𝑥 ′45
𝑦′
Full adder
Remember that:
𝑥⊙𝑦 = 𝑥 ⊕ 𝑦, 𝑥 ⊕ 𝑦 = 𝑥𝑦 ′ + 𝑥 ′ 𝑦, 𝑥⊙𝑦 = 𝑥𝑦 + 𝑥 ′46
𝑦′
Full adder
𝑆 = 𝑥 ′ 𝑦 ′ 𝑧 + 𝑥 ′ 𝑦𝑧 ′ + 𝑥𝑦 ′ 𝑧 ′ + 𝑥𝑦𝑧
= 𝑧 𝑥 ′ 𝑦 ′ + 𝑥𝑦 + 𝑧 ′ 𝑥 ′ 𝑦 + 𝑥𝑦 ′
= 𝑧(𝑥 ′ 𝑦 + 𝑥𝑦 ′ ) + 𝑧′(𝑥′𝑦 + 𝑥𝑦 ′ )
= 𝑧 𝑥 ⊕ 𝑦 + 𝑧′ 𝑥 ⊕ 𝑦
Remember that:
𝑥⊙𝑦 = 𝑥 ⊕ 𝑦, 𝑥 ⊕ 𝑦 = 𝑥𝑦 ′ + 𝑥 ′ 𝑦, 𝑥⊙𝑦 = 𝑥𝑦 + 𝑥 ′47
𝑦′
Full adder
𝑆 = 𝑥 ′ 𝑦 ′ 𝑧 + 𝑥 ′ 𝑦𝑧 ′ + 𝑥𝑦 ′ 𝑧 ′ + 𝑥𝑦𝑧
= 𝑧 𝑥 ′ 𝑦 ′ + 𝑥𝑦 + 𝑧 ′ 𝑥 ′ 𝑦 + 𝑥𝑦 ′
= 𝑧(𝑥 ′ 𝑦 + 𝑥𝑦 ′ ) + 𝑧′(𝑥′𝑦 + 𝑥𝑦 ′ )
= 𝑧 𝑥 ⊕ 𝑦 + 𝑧′ 𝑥 ⊕ 𝑦
= 𝒛⊕ 𝒙⊕𝒚
= 𝒙⊕𝒚⊕𝒛
Remember that:
𝑥⊙𝑦 = 𝑥 ⊕ 𝑦, 𝑥 ⊕ 𝑦 = 𝑥𝑦 ′ + 𝑥 ′ 𝑦, 𝑥⊙𝑦 = 𝑥𝑦 + 𝑥 ′48
𝑦′
Full adder
𝐶 = 𝑥𝑦 + 𝑥𝑧 + 𝑦𝑧
49
Full adder
𝑆 = 𝑥 ′ 𝑦 ′ 𝑧 + 𝑥 ′ 𝑦𝑧 ′ + 𝑥𝑦 ′ 𝑧 ′ + 𝑥𝑦𝑧 𝐶 = 𝑥𝑦 + 𝑥𝑧 + 𝑦𝑧
𝑆 = 𝑥⊕𝑦⊕𝑧 50
Full adder
• The logic circuit for the full adder could also be sketched using
two half adders and a single OR gate
Half adder Half adder
𝑆 =𝑥⊕𝑦⊕𝑧
𝐶 = 𝑥 ⊕ 𝑦 𝑧 + 𝑥𝑦
= 𝑥𝑦 ′ + 𝑥 ′ 𝑦 𝑧 + 𝑥𝑦
Compare the obtained Boolean expression = 𝑥𝑦 ′ 𝑧 + 𝑥 ′ 𝑦𝑧 + 𝑥𝑦
for 𝐶 here and the one obtained in slide 28 51
Full adder
• The logic circuit for the full adder could also be sketched using
two half adders and a single OR gate
Half adder Half adder
𝑆 =𝑥⊕𝑦⊕𝑧
𝐶 = 𝑥𝑦 ′ 𝑧 + 𝑥 ′ 𝑦𝑧 + 𝑥𝑦
𝐶 = 𝑥(𝑦 + 𝑦 ′ 𝑧) + 𝑥 ′ 𝑦𝑧
Compare the obtained Boolean expression 𝐶 = 𝑥(𝑦 + 𝑧) + 𝑥 ′ 𝑦𝑧
for 𝐶 here and the one obtained in slide 28 52
Full adder
• The logic circuit for the full adder could also be sketched using
two half adders and a single OR gate
Half adder Half adder
𝑆 =𝑥⊕𝑦⊕𝑧
𝐶 = 𝑥𝑦 + 𝑥𝑧 + 𝑥 ′ 𝑦𝑧
𝐶 = 𝑥𝑦 + 𝑧(𝑥 + 𝑥 ′ 𝑦)
Compare the obtained Boolean expression 𝐶 = 𝑥𝑦 + 𝑧(𝑥 + 𝑦)
for 𝐶 here and the one obtained in slide 28 31
Full adder
• The logic circuit for the full adder could also be sketched using
two half adders and a single OR gate
Half adder Half adder
𝑆 =𝑥⊕𝑦⊕𝑧
𝑪 = 𝒙𝒚 + 𝒙𝒛 + 𝒚𝒛
𝐴 = 𝐴 3𝐴 2𝐴 1𝐴 0
= 1 0 1 1
𝐵 = 𝐵3𝐵2𝐵1𝐵0
= 0 0 1 1
55
4-bit binary ripple carry adder
𝑩𝟑 = 𝟎 𝑨𝟑 = 𝟏 𝑩𝟐 = 𝟎 𝑨𝟐 = 𝟎 𝑩𝟏 = 𝟏 𝑨𝟏 = 𝟏 𝑩𝟎 = 𝟏 𝑨𝟎 = 𝟏
𝟎 𝟏 𝟏
𝑪𝟎 = 𝟎
𝑪𝟒 = 𝟎 𝑺𝟑 = 𝟏 𝑺𝟐 = 𝟏 𝑺𝟏 = 𝟏 𝑺𝟎 = 𝟎
36
Binary adder/subtractor This is equivalent
to 𝐴 plus the 2’s
complement of 𝐵
• Subtractor 𝐴
𝑆
𝐵 FA
𝐶𝑜𝑢𝑡
𝐶𝑖𝑛 = 1
• Adder/Subtractor
𝐴
𝐵 𝑆
FA
𝐶𝑜𝑢𝑡
𝐶𝑖𝑛
𝐶 𝑆 𝐶 𝑆
𝑀3 𝑀2 𝑀1 𝑀0 𝑀3 𝑀2 𝑀1 𝑀0
Binary multiplier
𝐵3 𝐵2 𝐵1 𝐵0
𝐴2 𝐴1 𝐴0 4-Bit A d d e r
4-Bit A d d e r
4-Bit A d d e r
12 AND gates