Professional Documents
Culture Documents
Binary Variables
The two binary values have different names:
True/False On/Off Yes/No 1/0
Logical Operations
The three basic logical operations are:
AND OR NOT
AND is denoted by a dot (). OR is denoted by a plus (+). NOT is denoted by a bar ( ) over, a single quote mark (') after, or ~ before the variable.
ECE 20B, Winter 2004
Notation Examples
Examples:
Y = A B is read Y is equal to A and B. z = x + y is read z is equal to x OR y. X = A is read X is equal to NOT A.
Operator Definitions
Operations are defined on the values "0" and "1" for each Operator: AND OR NOT
0=1 1=0
Truth Tables
Truth tables list the output value of a function for all possible input values Truth tables for basic logic operations: AND Y Z = XY 0 0 1 0 0 0 1 1 OR Z = X+Y 0 1 1 1 NOT X 0 1
X 0 0 1 1
X 0 0 1 1
Y 0 1 0 1
Z=X
1 0
For outputs:
logic 1 is light on logic 0 is light off.
Logic Gates
In the earliest computers, switches were opened and closed by energizing coils to produce magnetic fields. The switches in turn opened and closed current paths. Later, vacuum tubes that open and close current paths replaced the relays. Today, transistors are used as electronic switches that open and close current paths.
ECE 20B, Winter 2004
10
X .Y
+V
X X
X1 X2 Xn
G = X +Y
X Y
From G2 (b) NOR
(c) NAND
(d) NOT
Transistor or tube based implementations of logic functions are called logic gates or just gates
ECE 20B, Winter 2004
11
12
Logic Diagram
X
Y Z
Expression
F= X + YZ
Boolean expressions, truth tables and logic diagrams describe the same function! Truth tables are unique; expressions and logic diagrams are not. This gives flexibility in implementing functions.
ECE 20B, Winter 2004
13
14
15
Duality
The dual of an algebraic expression is obtained by interchanging + and and interchanging 0s and 1s. The identities appear in dual pairs. When there is only one identity on a line the identity is selfdual, i. e., the dual expression = the original expression. Unless it happens to be self-dual, the dual of an expression does not equal the expression itself.
16
Proof Steps Justification (identity or theorem) X + XY = X1 + XY (identity 2) = X(Y + Y) + XY (identity 7) = XY + XY + XY (identity 14) = XY + XY (identity 5, applied to XY) = X(Y + Y) (identity 14) = X1 = X (identity 5, identity 2)
ECE 20B, Winter 2004
17
Proof Steps Justification (identity or theorem) YZ = YZ(X + X) (identity 2, identity 7) = XYZ + XYZ (identity 14) XY + XZ + XYZ + XYZ = XY(1 + Z) + XZ(1 + Y) (identity 2, identity 7) = XY + XZ (identity 3, identity 2)
18
Parentheses
NOT AND OR Because AND takes precedence over OR, parentheses must be placed around the OR operator more frequently.
ECE 20B, Winter 2004
19
Useful Theorems
x y + x y = y (x + y ) (x + y ) = y x + xy = x x (x + y ) = x x + x y = x + y x (x + y ) = x y Minimization Absorption Simplification
(x + y ) (x + z ) (y + z ) = (x + y ) (x + z )
x + y = xy xy = x + y
xy + xz + yz = xy + xz
Consensus
DeMorgan' s Laws
20
21
Expression Simplification
Simplify to contain the smallest number of literals (complemented and uncomplemented variables):
A B + ACD + A BD + AC D + A BCD =
= AB + AC + ABD = AB + A(C + BD) or = AB + AC + BCD = AC + B(A + CD)
22
Complementing Functions
Use DeMorgan's Theorem to complement a function:
1. Interchange AND and OR operators 2. Complement each literal
Example: Complement
xy z + x yz
23
Canonical forms:
Sum of Minterms (SOM) or Sum of Products (SOP) Product of Maxterms (POM) or Product of Sums (POS)
ECE 20B, Winter 2004
24
Minterms
Minterms are AND terms with every variable in true or complemented form. Each binary variable may appear in uncomplemented (e.g., x) or complemented (e.g., x) form there are 2n minterms for n variables. EXAMPLE: Two variables, combined with an AND operator, X Y have 2*2 or 4 combinations:
Maxterms
Maxterms are OR terms with every variable in true or complemented form. Each binary variable may appear in uncomplemented (e.g., x) or complemented (e.g., x) form there are 2n maxterms for n variables. Two variables, combined with an OR operator, X + Y, have 2*2 or 4 combinations: X + Y (both normal) X + Y (x normal, y complemented) X + Y (x complemented, y normal) X + Y (both complemented)
ECE 20B, Winter 2004
26
27
Standard Order
Minterms and maxterms are designated with a subscript The subscript is a number, corresponding to a binary pattern The bits in the pattern represent the complemented or normal state of EVERY variable, listed in a STANDARD order. All variables will be present in a minterm or maxterm and will be listed in the same order (usually alphabetically) Example: For variables a, b, c: Maxterms: (a + b +c), (a + b + c) Minterms: a bc, a b c, ab c Terms: (b + a + c), ac b, and (c + b + a) are NOT in standard order. Terms: (a + c), b c, and (a + b) do not contain all ECE 20B, Wintervariables 2004
28
For Maxterms:
0 means the variable is Not Complemented and 1 means the variable is Complemented.
29
The Index 0 (base 10) = 000 (base 2 to three digits) so all three variables are complemented for minterm 0 ( X , Y, Z) and no variables are complemented for Maxterm 0 (X,Y,Z)
Minterm 0, called m0 is X Y Z . Maxterm 0, called M0 is (X + Y + Z).
30
Binary Minterm Maxterm Mi Pattern mi abcd a + b + c + d 0000 abcd a + b + c + d 0001 abcd a + b + c + d 0011 abcd a + b + c + d 0101 abcd a + b + c + d 0111 1010 abcd a + b + c + d 1101 abcd a + b + c + d abcd a + b + c + d 1111
31
32
Maxterms of 2 variables
x y M0 00 0 01 1 10 1 11 1 M1 1 0 1 1 M2 1 1 0 1 M3 1 1 1 0
Each column in the maxterm function table is the complement of the column in the minterm function table since Mi is the complement of mi.
ECE 20B, Winter 2004
33
Observations
In the function tables:
Each minterm has one and only one 1 present in the 2n terms (a minimum of ones). All other entries are 0. Each maxterm has one and only one 0 present in the 2n terms All other entries are 1 (a maximum of ones).
We can implement any function by "ORing" the minterms corresponding to a "1" in the function table. We can implement any function by "ANDing" the maxterms corresponding to a "0" in the function table. This gives us two canonical forms: Sum of Minterms (SOM), and Product of Maxterms (POM) for stating any Boolean function.
ECE 20B, Winter 2004
34
+ + + + + + + + +
m4 0 0 0 0 1 0 0 0
+ m7 = F1 + 0 =0 + 0 =1 + 0 =0 + 0 =0 + 0 =1 + 0 =0 + 0 =0 + 1 =1
35
36
i 0 1 2 3 4 5 6 7
M0 M2 M3 M5 M6 0 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 0 1 1 1 1 1
= F1 =0 =1 =0 =0 =1 =0 =0 =1
37
38
Example: Implement f = x + x y as a sum of minterms. First expand terms: f = x ( y + y ) + x y Then distribute terms: f = xy + x y + x y
Express as sum of minterms: f = m3+m2+m0
ECE 20B, Winter 2004
39
Collect terms (removing all but one of duplicate terms): Express as SOM:
ECE 20B, Winter 2004
40
41
vv
f ( x, y , z ) = x + x y x + x y = (x + x )(x + y ) = 1 (x + y ) = x + y
x + y + z z = ( z + y + z )(x + y + z )
42
43
This form:
is usually not a minimum literal expression, and leads to a more expensive implementation (in terms of two levels of AND and OR gates) than needed.
ECE 20B, Winter 2004
44
45
SOP
A B C
46
This form:
is usually not a minimum literal expression, and leads to a more expensive implementation (in terms of two levels of AND and OR gates) than needed.
ECE 20B, Winter 2004
47
48
A C A B
49
Cost of Implementation
Canonical SOP, POS representations can differ in literal cost
Boolean algebra: manipulate equations into simpler forms reduces the (two-level) implementation cost
Is there only one minimum-cost circuit? Is there a systematic procedure to obtain a minimum-cost circuit?
50