Transcript 1 +a

논리공학
고려대학교
전기전자전파공학부
김종국
1
논리 공학
 1 or 0, yes or no, true or false …
 디지털 시스템을 위한 기초
 거의 모든 전기전자제품은 디지털 시스템
e.g., 핸드폰, 전자시계, 컴퓨터 …
 이진수
 필요성
 십진수에서 이진수 변환
 불 대수
 논리회로 설계 (combinational circuits)
 논리회로 간소화/최적화
2
논리 공학
 자동판매기(vending machine)?
output (출력)
input (입력)
?
3
이진수

a5a4a3a2a1a0.a-1a-2a-3
= anrn+an-1rn-1+...+a2r2+a1r+a0+a-1r-1+a-2r-2+...+a-mr-m
(power series)
7392 = 7 × 103 + 3 × 102 + 9 × 101 +2 × 100
(11010.11)2 =
2n
2n
210 = 1Kilo
220 = 1Mega
230 = 1Giga
4
2n
이진수
101101
101101
1011
+10011
1
-100111
×101
101010
0
000110
1011
0000
1011
110111
5
수체계 변환
 베이스 r 수에서 십진수로 변환
Power series를 이용
Term들을 더함
(11010.11)2 = 1×24+1×23+0×22+1×21+0×20+1×2-1+1×2-2
= (26.75)10
 십진수에서 베이스 r 수로 변환
정수 부분과 소수 부분을 따로함
정수 부분: 숫자를 베이스 r로 나누고 이후 몫을 다시 r 로
나누고 나머지를 읽으면 됨
소수 부분은?
 (41.6875)10 = (?)2
 (153.513)10 = (?)8
6
수체계 변환
 Ex 1-1) Convert decimal 41 to binary.
Integer
Quotient
Remainder
Coefficient
Integer
Remainder
41
41/2 =
20
+
½
a0 = 1
20
1
20/2 =
10
+
0
a1 = 0
10
0
10/2 =
5
+
0
a2 = 0
5
0
5/2 =
2
+
½
a3 = 1
2
1
2/2 =
1
+
0
a4 = 0
1/2 =
0
+
½
a5 = 1
1
0
0
1
answer : (41)10 = (a5a4a3a2a1a0)2 = (101001)2
7
answer = 101001
수체계 변환
 Ex 1-2) Convert decimal 153 to octal.
153
19 1
2 3
= (231)8
0 2
 Ex 1-3) Convert (0.6875)10 to binary.
Integer
Fraction
Coefficient
0.6875×2 =
1
+
0.3750
a-1 = 1
0.3750×2 =
0
+
0.7500
a-2 = 0
0.7500×2 =
1
+
0.5000
a-3 = 1
0.5000×2 =
1
+
0.0000
a-4 = 1
answer:(0.6875)10 = (0.a-1a-2a-3a-4)2 = (0.1011)2
8
수체계 변환
 (41.6875)10 = (101001.1011)2
 (153.513)10 = (231.406517)8
9
Binary Logic
 definition of binary logic
 logic gates
10
Theorems and Properties of Boolean Algebra
 operator precedence
1. parentheses
2. NOT
3. AND
4. OR
11
Boolean Algebra
 commutative law: the order doesn’t affect the result
X + Y = Y + X
XY = YX
 associative law: parentheses can be removed
(X + Y) + Z = X + (Y + Z )
(XY)Z = X(YZ)
 distributive law:
X(Y+Z) = XY + XZ
X + YZ = (X + Y)(X + Z)
 DeMorgan’s theorem: complement of an expression
(X + Y) = XY
(XY) = X + Y
can be extended to three or more variables
12
Boolean Functions
13
Simplification (Minimization)?
14
Boolean Functions – Algebraic Manipulation
 ex 2-1) Simplify the following Boolean functions to a minimum number of
literals.
1. x(x'+y) = xx' + xy = 0 + xy = xy.
2. x +x'y = (x+x')(x+y) = 1(x+y) = x + y.
3. (x+y)(x+y') = x + xy + xy' + yy' = x(1+y+y') = x.
4. xy + x'z + yz = xy + x'z + yz(x+x')
= xy + x'z + xyz + x'yz
= xy(1+z) + x'z(1+y)
= xy + x'z
15
Complement of a Function
 (A + B + C)'= (A+x)'
let B+C=x
= A'x'
by theorem 5(a)(DeMorgan)
= A'(B+C)'
substitute B+C=x
= A'(B'C')
by theorem 5(a)(DeMorgan)
= A'B'C'
by theorem 4(b)(associative)
=> (A+B+C+D+…+F)' = A'B'C'D'…F'
(ABCD…F)' = A' +B'+ C' + D' + … + F'
16
Complement of a Function
 ex 2-2) Find the complement of the functions
F1=x'yz'+x'y'z, F2=x(y'z'+yz).
F1' = (x'yz'+x'y'z)' = (x'yz')'(x'y'z)' = (x+y'+z)(x+y+z')
F2' = [x(y'z'+yz)]' = x'+(y'z'+yz)' = x'+(y'z')'(yz)' = x'+(y+z)(y'+z')
 ex 2-3) Find the complement of the functions F1 And F2 in Ex 2-2
by taking their duals and complementing each literal.
1. F1 = x'yz' + x'y'z.
The dual of F1 is (x'+y+z')(x'+y'+z)
Complement each literal : (x+y'+z)(x+y+z')=F1'
2. F2 = x(y'z'+yz).
The dual of F2 is x+(y'+z')(y+z)이다.
Complement each literal : x'+(y+z)(y'+z')=F2'
17
Simplification Example
 F = XYZ + XYZ + XY
= XZ(Y + Y) + XY
= XZ + XY
 circuit simplification
 less gates
 (a) 2 NOT, 3 AND, and 1
OR
 (b) 1 NOT, 2 AND, and 1
OR
 less fan-in
18
Minterm and Maxterm (1)
 minterm ( a product term) and Maxterm (a sum term)
 all variables appear exactly once, either complemented or
uncomplemented
 show exactly one combination of the binary variables
 2n distinct terms for n variables
19
Minterm and Maxterm (2)
 minterm
term: x, y, z are such values, when do they give us 1?
 maxterm
term: x, y, z are such values, when do they give us 0?
 j is the designation number for terms: Mj = mjc
m3 = (XYZ) = X + Y + Z = M3
20
Canonical and Standard Forms
f1 = x'y'z+xy'z'+xyz = m1+m4+m7
f2 = x'yz+xy'z+xyz'+xyz = m3+m5+m6+m7
f1 = (x+y+z)(x+y'+z)(x'+y+z')(x'+y'+z)
= M0M2M3M5M6
f2 = (x+y+z)(x+y+z‘)(x+y'+z)(x'+y+z)
= M0M1M2M4
21
Canonical and Standard Forms
 conversion between canonical forms
F(A, B, C) = ∑(1, 4, 5, 6, 7)
F' (A, B, C) = ∑(0, 2, 3) = m0 + m2 + m3
F = (m0+m2+m3)' = m0'm2'm3' = M0M2M3 = ∏(0, 2, 3) ,
mj' = Mj
ex) F = xy + x'z
F(x, y, z) = ∑(1, 3, 6, 7)
F(x, y, z) = ∏(0, 2, 4, 5)
22
Gray Code
 gray code of three variables
 1 bit difference between
neighbors
 convert from the lower bit order
 if the converted binary number
already exists, then try to convert
the bit that is one higher
23
Karnaugh Map (K-Map)
 simplify Boolean functions of up to four variables (5 or 6
variables can be drawn, but cumbersome to use)
 simplified expressions are in sum-of-products or product-ofsums (two-level implementations)
 diagram of squares, one indicating one minterm
24
Karnaugh Map (K-Map) Algorithm
 pick the largest 2n element group (n = 0, 1, …)
 the already-grouped element can be
regrouped for another group
 all elements in a group cannot be a
member of another group
25
Two-Variable Map
m1+m2+m3 = x'y +xy' +xy = x +y
26
Three-Variable Map
27
Three-Variable Map Examples
28
Four-Variable Map
29
Four-Variable Map Examples
Ex 3-5) Simplify the Boolean function,
F(w, x, y, z) = Σ(0, 1, 2, 4, 5, 6, 8, 9, 12, 13, 14)
30
Product-of-Sum
 from sum-of-products to product-of-sums
 complement the function (taking the dual)
combine squares marked with 0’s
change the function, which was expressed in sum-ofproducts to product-of-sums
31
Product of Sums Simplification
 ex 3-8) Simplify the Boolean function,
F(A, B, C, D) = Σ(0, 1, 2, 5, 7, 9, 10)
a) sum of products
F = B'D' + B'D' +A'C'D'
b) product of sum
F' = AB + CD + BD'
F = (A' +B')(C' +D')(B' +D)
32
Product of Sums Simplification
 F( x, y, z) = Σ(1, 3, 4, 6) = Π(0, 2, 5, 7)
F = x'z +xz'
F' = xz +x'z'
F = (x'+z)(x + z')
33
So Far…
 simplification
Boolean algebra
K-map
 group 1’s: sum-of-products (minterms)
 group 0’s: product-of-sums (maxterms)
34
Don’t care condition
 unspecified minterms of a function
 marked with a cross or a “d”
 provides further simplification of the function
 “d” can become 0 or 1
35
Don’t-Care Conditions Example
 ex 3-9) Simplify the Boolean function, F(w, x, y, z) = Σ(1,3,7,11,15)
Don’t-care conditions, d(w, x, y, z) = Σ(0, 2, 5)
F(w, x, y, z) = yz + w'x' = Σ(0, 1, ,2, 3, 7, 11, 15)
F(w, x, y, z) = yz + w'z = Σ(1, 3, 5, 7, 11, 15)
36
Digital Logic Gate
 Extension to Multiple Inputs
- The NAND and NOR operators are not associative.
(x↓y)↓z≠x↓(y↓z)
(x↓y)↓z= [(x+y)'+z]'
= (x+y)z'= xz' + yz'
x↓(y↓z)= [x+(y+z)'] '
= x'(y+z)= x'y + x'z
x↓y↓z= (x+y+z)'
x↑y↑z= (xyz)'
F = [(ABC)'(DE)']' = ABC + DE
37
NAND Implementation
 NAND Circuit
38
NAND Implementation
 F = ((AB)'(CD)')' = AB + CD
 ex 3-10) Implement the following Boolean function with NAND gates:
F(x, y, z) = Σ(1, 2, 3, 4, 5, 7) = xy' + x'y + z
39
NAND Implementation
40
NOR Implementation
 F = (AB' + A'B)(C + D')
41
Exclusive-OR Function
 x  y = xy' + x'y
(x  y)' = (xy' + x'y)' = xy + x'y'
x  0=x
x  1=x'
x  x=0
x  x'=1
x  y'=x'  y=(x  y)‘
 AB=BA
(A  B)  C = A  (B  C)
=ABC
42
Exclusive-OR Function Application
 parity generation and checking
P=xyz
C=xyzP
43