 # Standart Forms of Expression

## Presentation on theme: "Standart Forms of Expression"— Presentation transcript:

Standart Forms of Expression
Boolean Algebra and Standart Forms of Expression

Overview Switching algebra Algebraic minimization Standard forms
Axioms Theorems Algebraic minimization Standard forms Sum-of-minterms Product-of-maxterms Other Logic Gates

Combinational Circuits
A combinational circuit has one or more digital inputs one or more digital outputs a functional specification that details the value of each output for every possible combination of valid input values a timing specification consisting (at minimum) of an upper bound tPD on the required time for the device to compute the specified output values from an arbitrary set of stable, valid input values

Functional Specifications
There are many ways of specifying the function of a combinational device, for example: Concise alternatives: Boolean function Truth table Schematic

Combinational Circuits
Combinational logic circuits has no memory! Outputs are only function of current input combination Nothing is known about past events Repeating a sequence of inputs always gives the same output sequence Sequential logic circuits (covered later) does have memory Repeating a sequence of inputs can result in an entirely different output sequence

Combinational Logic Example
Circuit controls the level of fluid in a tank inputs are: HI - 1 if fluid level is too high, 0 otherwise LO - 1 if fluid level is too low, 0 otherwise outputs are: Pump - 1 to pump fluid into tank, 0 for pump off Drain - 1 to open tank drain, 0 for drain closed input to output relationship is described by a truth table

Combinational Logic Example
Truth Table Representation HI 1 LO Pump x Drain Tank level is OK Low level, pump more in High level, drain some out inputs cannot occur HI LO Drain Pump Schematic Representation

Terms and Definitions Logic Expression (Boolean/Switching function) - a mathematical formula consisting of logical operators and variables f(x,y,z) = (x + y’).z + x’ Logic Operator - a function that gives a well defined output according to switching algebra Not (’), And (.), Or (+) Logic Variable - a symbol representing the two possible switching algebra values of 0 and 1 x, y, z Logic Literal - the values 0 and 1 or a logic variable or it’s complement x, y’, z, x’

Logic Expressions - Precedence
Like standard algebra, switching algebra operators have a precedence of evaluation NOT operations have the highest precedence AND operations are next OR operations are lowest Parentheses explicitly define the order of operator evaluation If in doubt, USE PARENTHESES!

Truth Tables A truth table shows all possible inputs and outputs of a function. There is one-to-one correspondence between a Boolean function and its turth table. Remember that each input variable represents either 1 or 0. Because there are only a finite number of values (1 and 0), truth tables themselves are finite. A function with n variables has 2n possible combinations of inputs. Inputs are listed in binary.

Truth Tables f(x,y,z) = (x + y’)z + x’ f(0,0,0) = (0 + 1)0 + 1 = 1

Switching Algebra Based on Boolean Algebra
Developed by George Boole in 1854 Basic laws of Boolean Algebra will be implemented as logic gates. Networks of logic gates allow us to manipulate digital signals Can perform numerical operations on digital signals such as addition, multiplication Can perform translations from one binary code to another. A switching (Boolean) variable X can take on only one of two values: X = 0, if X ≠ 1 X = 1, if X ≠ 0

Switching Algebra Operations - NOT
Unary complement/inversion operation Usually shown as overbar , other forms are ~X, X’ X X 1 X X

Switching Algebra Operations - AND
Also known as the conjunction operation; output is true only if all inputs are true Algebraic operators are ‘·’, ‘&’, ‘’ X 1 Y X·Y

Switching Algebra Operations - OR
Also known as the disjunction operation; output is true if any input is true Algebraic operators are ‘+’, ‘|’, ‘’ X 1 Y X+Y

Switching Algebra Axioms

Single-Variable Theorems

Prove X + 0 = X (a) Keep axioms handy (b) Elaborate cases:
if X = 0, have X + 0 = = 0 = X if X = 1, have X + 0 = = 1 = X

Duality Principle of Boolean Algebra
How to apply the duality principle? 1’s and 0’s are interchanged. AND or OR operators are interchanged. Variables are left unchanged. Dual theorem is still true!

Two- and Three-Variable Theorems
(T12) X + X’ . Y = X + Y (T12’) X . (X’ + Y) = X.Y

Prove (X.Y).Z=X.(Y.Z) Same output

Prove (X.Y)+(X.Z)=X.(Y+Z)
Same output

DeMorgan’s Theorem (x + y)’ = x’y’ <=> (x . y)’ = x’ + y’
General form of the DeMorgan’s theorem:

Complementing a Function Algebraically
You can use DeMorgan’s law to find out the complement of a Boolean Function f(x,y,z) = x(y’z’ + yz) f’(x,y,z) = ( x(y’z’ + yz) )’ [ complement both sides ] = x’ + (y’z’ + yz)’ [ because (xy)’ = x’ + y’ ] = x’ + (y’z’)’ (yz)’ [ because (x + y)’ = x’ y’ ] = x’ + (y + z)(y’ + z’) [ because (xy)’ = x’ + y’, twice]

Logic Expression Minimization
Goal is to find an equivalent of an original logic expression that: has fewer variables per term has fewer terms needs less logic to implement There are three main manual methods Algebraic minimization Karnaugh Map minimization Quine-McCluskey (tabular) minimization

Algebraic Minimization
Process is to apply the switching algebra postulates, laws, and theorems to transform the original expression Hard to recognize when a particular law can be applied Difficult to know if resulting expression is truly minimal Very easy to make a mistake Incorrect complementation Dropped variables

Adjacency is easy to use; very powerful Look for two terms that are identical except for one variable Application removes one term and one variable from the remaining term A.B.C.D’ + A.B.C.D = (A.B.C).D’ + (A.B.C).D = (A.B.C).(D’ + D) = A.B.C

Simplification with Axioms
x’y’ + xyz + x’y [T8; x’y’ + x’y = x’(y’ + y) ] = x’(y’ + y) + xyz [T5; y’ + y = 1 ] = x’. 1 + xyz [T1’; x’. 1 = x’ ] = x’ + xyz [T8: x’ + xyz = (x’ + x) (x’ + yz)] = (x’ + x)(x’ + yz) [T5; x’ + x = 1 ] = 1 . (x’ + yz) [T1’: 1 . (x’ + yz) = x’ + yz] = x’ + yz [Axiom 2 ] (T12) X + X’ . Y = X + Y (T12’) X . (X’ + Y) = X.Y

Proving Consensus Theorem
XY + X’Z + YZ [T1’: YZ.1 = YZ] = XY + X’Z + YZ. 1 [T5: X + X’ = 1] = XY + X’Z + YZ(X + X’) [T8: YZ(X + X’) = XYZ + X’YZ] = XY + X’Z + XYZ + X’YZ = XY.1 + XYZ + X’Z.1 + X’YZ [T1’: XY.1 = XY, X’Z.1 = X’Z] = XY(1 + Z) + X’Z(1 + Y) [T8: XY.1+ XYZ = XY(1 + Z)] = XY + X’Z (T12) X + X’ . Y = X + Y (T12’) X . (X’ + Y) = X.Y

Boolean Expressions and Circuits
Any Boolean expression can be converted into a circuit by combining basic gates. The precedences are explicit in a circuit. Make sure that the hardware does operations in the right order! (x + y’).z + x’

How Simplification Helps?
Here are two different but equivalent circuits In general the one with fewer gates is “better”: It costs less to build It requires less power But we had to do some work to find the second form x’y’ + xyz + x’y = x’(y’ + y) + xyz = x’1 + xyz = x’ + xyz = (x’ + x)(x’ + yz) = 1  (x’ + yz) = x’ + yz

Another Example F= X’YZ+ X’YZ’+XZ = X’Y(Z+Z’)+XZ = X’Y . 1 + XZ

Standard Expression Forms
Two standard expression forms: Sum-of-products Sum-of-minterms OR of AND terms Product-of-sums Product-of-maxterms AND of OR terms

Minterms A minterm is a special product of literals
Each input variable, either complemented or uncomplemented, appears exactly once Each minterm is 1 for exactly one combination of inputs, and 0 for the others A function with n variables has 2n minterms (since each variable can appear complemented or not) A three-variable function, such as f(x,y,z), has 23 = 8 minterms

Minterms

Sum of Minterms Form Every function can be written as a sum of minterms A special kind of sum of products form The sum of minterms form for any function is unique Converting a truth table to sum of minterms form: Logical sum of all the minterms that produce a 1 in the truth table

Sum of Minterms Form f = x’y’z’ + x’y’z + x’yz’ + x’yz + xyz’
= m0 + m1 + m2 + m3 + m6 = m(0,1,2,3,6) f’ = xy’z’ + xy’z + xyz = m4 + m5 + m7 = m(4,5,7) f’ contains all the minterms not in f A function that includes all the 2^n minterms is equal to logic 1 G(X,Y)= m(0,1,2,3)= 1

Sum of Products Form The sum-of-minterms form is a standard algebraic expression that is obtained from a truth table When we simplify a function in SoM form by reducing the number of product terms or reducing the number of literals in the terms the simplified expression is said to be in Sum-of-Products form

Sum of Products Form Sum of products expression can be implemented using a two-level circuit literals and their complements at the “0th” level AND gates at the first level a single OR gate at the second level F= m(0,1,2,3,4,5,7) (SoM) = Y’ + X’YZ’ + XY (SoP)

Maxterms A maxterm is a special sum of literals
Each input variable, either complemented or uncomplemented, appears exactly once Each maxterm is 0 for exactly one combination of inputs, and 1 for the others A function with n variables has 2n maxterms

Maxterms

Product of Maxterms Form
Every function can be written as a product of maxterms A special kind of product of sums form The product of sums form for any function is unique Converting a truth table to product of maxterms form: Logical product of all the maxterms that produce a 0 in the truth table

Product of Maxterms Form
f = (x’ + y + z)(x’ + y + z’)(x’ + y’ + z’) = M4 M5 M7 = ∏M(4,5,7) f’ = (x + y + z)(x + y + z’)(x + y’ + z) (x + y’ + z’)(x’ + y’ + z) = M0 M1 M2 M3 M6 = ∏ M(0,1,2,3,6) f’ contains all the maxterms not in f A function that includes all the 2^n maxterms is equal to logic 0 G(X,Y)= ∏ m(0,1,2,3)= 0

Product of Sums Form The product-of-maxterms form is a standard algebraic expression that is obtained from a truth table When we simplify a function in PoM form by reducing the number of sum terms or reducing the number of literals in the terms, the simplified expression is said to be in Product-of-Sums form

Products of Sums Form Product of sums expression can be implemented using a two-level circuit literals and their complements at the “0th” level OR gates at the first level a single AND gate at the second level F= ∏ M(0,2,3,4,5,6) (PoM) = X(Y’ + Z)(X + Y +Z’) (PoS)

Minterms and maxterms are related
Any minterm mi is the complement of the corresponding maxterm Mi For example, m4’ = M4 because (xy’z’)’ = x’ + y + z Minterm Shorthand x’y’z’ m0 x’y’z m1 x’yz’ m2 x’yz m3 xy’z’ m4 xy’z m5 xyz’ m6 xyz m7 Maxterm Shorthand x + y + z M0 x + y + z’ M1 x + y’ + z M2 x + y’ + z’ M3 x’ + y + z M4 x’ + y + z’ M5 x’ + y’ + z M6 x’ + y’ + z’ M7

Converting Between Standard Forms
We can convert a sum of minterms to a product of maxterms In general, just replace the minterms with maxterms, using maxterm numbers that don’t appear in the sum of minterms: The same thing works for converting from a product of maxterms to a sum of minterms From before f = m(0,1,2,3,6) and f’ = m(4,5,7) = m4 + m5 + m7 complementing (f’)’ = (m4 + m5 + m7)’ so f = m4’ m5’ m7’ [ DeMorgan’s law ] = M4 M5 M7 [ By the previous page ] = ∏ M(4,5,7) f = m(0,1,2,3,6) = ∏ M(4,5,7)

Other Gates NAND gate: NOR gate:

NAND and NOR Both NAND and NOR are universal gates
Universal gate: A gate that alone can be used to implement all Boolean functions It is sufficient to show that NAND (NOR) can be used to implement AND, OR, and NOT operations

NANDs are universal! NOT AND OR (xx)’ = x’ [ because xx = x ]
((xy)’ (xy)’)’ = xy [ from NOT above ] ((xx)’ (yy)’)’= (x’ y’)’ [ xx = x, and yy = y ] = x + y [ DeMorgan’s law ]

Other Gates XOR gate: XNOR gate:

More on XOR Exclusive-OR (XOR): X  Y = XY’ + X’Y X  0 = X X  1 = X’
X  Y’ = (X  Y)’ X’  Y = (X  Y)’ X  Y = Y  X (X  Y)  Z = X  (Y  Z) = X  Y  Z

More on XOR The general XOR function is true when an odd number of its arguments are true For example, we can use Boolean algebra to simplify a three-input XOR to the following expression and truth table. x  (y  z) = x  (y’z + yz’) [ Definition of XOR ] = x’(y’z + yz’) + x(y’z + yz’)’ [ Definition of XOR ] = x’y’z + x’yz’ + x(y’z + yz’)’ [ Distributive ] = x’y’z + x’yz’ + x((y’z)’ (yz’)’) [ DeMorgan’s ] = x’y’z + x’yz’ + x((y + z’)(y’ + z)) [ DeMorgan’s ] = x’y’z + x’yz’ + x(yz + y’z’) [ Distributive ] = x’y’z + x’yz’ + xyz + xy’z’ [ Distributive ]

Avoid This Configuration
The exact output voltage is about 1-2 V. After a few seconds, the chip will have internal damage

Three-State Outputs Logic outputs have two normal states, LOW and HIGH, corresponding to logic values 0 and 1. The output is strongly connected to either Vcc or Gnd Some outputs have a third electrical state: High-Impedance, Hi-Z, or floating state In Hi-Z state: The output behaves as an open-circuit, i.e., it appears to be disconnected from the circuit There is a leakage current of up to 10 μA. An output with three possible states is called a three-state output or tri-state output.

Three-State Outputs When EN = 1, NAND and NOR both act like inverters
==> A appears on output When EN = 0, NAND output is 1 regardless of A - NOR output is 0 regardless of A ==> both output transistors are off ==> output is isolated from both ground and power

Tri-State Bus Control circuit

Summary So far: A bunch of Boolean algebra trickery for simplifying expressions and circuits The algebra guarantees us that the simplified circuit is equivalent to the original one Introducing some standard forms and terminology Next: An alternative simplification method We’ll start using all this stuff to build and analyze bigger, more useful, circuits