You are on page 1of 66

4 BOOLEAN ALGEBRA AND LOGIC SIMPLIFICATION

BOOLEAN OPERATIONS AND EXPRESSIONS


Variable, complement, and literal are terms used in Boolean algebra. A variable is a symbol used to represent a logical quantity. Any single variable can have a 1 or a 0 value. The complement is the inverse of a variable and is indicated by a bar over variable (overbar . !or e"ample, the complement of the variable A is A. #f A $ 1, then A $ 0. #f A $ 0, then A $ 1. The complement of the variable A is read as %not A% or %A bar.% &ometimes a prime symbol rather than an overbar is used to denote the complement of a variable' for e"ample, B( indicates the complement of B. A literal is a variable or the complement of a variable. Boolean Addition )ecall from part * that Boolean addition is equivalent to the +) operation. #n Boolean algebra, a sum term is a sum of literals. #n logic circuits, a sum term is produced by an +) operation ,ith no A-. operations involved. &ome e"amples of sum terms are A / B, A / B, A / B / 0, and A / B / 0 / .. A sum term is equal to 1 ,hen one or more of the literals in the term are 1. A sum term is equal to 0 only if each of the literals is 0. 1"ample .etermine the values of A, B, 0, and . that ma2e the sum term A/B/0/. equal to 0.

Boolean Multiplication Also recall from part * that Boolean multiplication is equivalent to the A-. operation. #n Boolean algebra, a product term is the product of literals. #n logic circuits, a product term is produced by an A-. operation ,ith no +) operations involved. &ome e"amples of product terms are AB, AB, AB0, and AB0.. A product term is equal to 1 only if each of the literals in the term is 1. A product term is equal to 0 ,hen one or more of the literals are 0. 1"ample .etermine the values of A, B, 0, and . that ma2e the product term AB0. equal to 1. LAWS AND RULES OF BOOLEAN ALGEBRA 3 Laws of Boolean Algeb a The basic la,s of Boolean algebra4the commutative la,s for addition and multiplication, the associative la,s for addition and multiplication, and the distributive la,4are the same as in ordinary algebra. Commutative Laws 5The commutative la, of addition for t,o variables is ,ritten as A/B $ B/A This la, states that the order in ,hich the variables are +)ed ma2es no difference. )emember, in Boolean algebra as applied to logic circuits, addition and the +) operation are the same. !ig.(641 illustrates the commutative la, as applied to the +) gate and sho,s that it doesn(t matter to ,hich input each variable is applied. (The symbol 7 means %equivalent to.% .

!ig.(641 Application of commutative la, of addition. 5The commutative la, of multiplication for t,o variables is A.B $ B.A This la, states that the order in ,hich the variables are A-.ed ma2es no difference. !ig.(648 , il1ustrates this la, as applied to the A-. gate.

!ig.(648 Application of commutative la, of multiplication. Associative Laws 9 5The associative la, of addition is ,ritten as follo,s for three variables9 A / (B / 0 $ (A / B / 0 This la, states that ,hen +)ing more than t,o variables, the result is the same regardless of the grouping of the variables. !ig.(64* , illustrates this la, as applied to 84input +) gates.

!ig.(64* Application of associative la, of addition. 5The associative la, of multiplication is ,ritten as follo,s for three variables9 A(B0 $ (AB 0

This la, states that it ma2es no difference in ,hat order the variables are grouped ,hen A-.ing more than t,o variables. !ig.(646 illustrates this la, as applied to 84input A-. gates.

!ig.(646 Application of associative la, of multiplication. Distributive Law9 5The distributive la, is ,ritten for three variables as follo,s9 A(B / 0 $ AB / A0 This la, states that +)ing t,o or more variables and then A-.ing the result ,ith a single variable is equivalent to A-.ing the single variable ,ith each of the t,o or more variables and then +)ing the products. The distributive la, also e"presses the process of factoring in ,hich the common variable A is factored out of the product terms, for e"ample, AB / A0 $ A(B / 0 . !ig.(64: implementation. illustrates the distributive la, in terms of gate

!ig.(64: Application of distributive la,.

3 Rules of Boolean Algeb a Table 641 lists 18 basic rules that are useful in manipulating and simplifying Boolean e"pressions. )ules 1 through ; ,ill be vie,ed in terms of their application to logic gates. )ules 10 through 18 ,ill be derived in terms of the simpler rules and the la,s previously discussed. Table 641 Basic rules of Boolean algebra.

)ule 1.

A/0$A

A variable +)ed ,ith 0 is al,ays equal to the variable. #f the input variable A is 1, the output variable < is 1, ,hich is equal to A. #f A is 0, the output is 0, ,hich is also equal to A. This rule is illustrated in !ig.(64= , ,here the lo,er input is fi"ed at 0.

!ig.(64=

)ule 8.

A/1$1

A variable +)ed ,ith 1 is al,ays equal to 1. A 1 on an input to an +) gate produces a 1 on the output, regardless of the value of the variable on the other input. This rule is illustrated in !ig.(64> , ,here the lo,er input is fi"ed at 1.

!ig.(64> )ule *. A.0$0 A variable A-.ed ,ith 0 is al,ays equal to 0. Any time one input to an A-. gate is 0, the output is 0, regardless of the value of the variable on the other input. This rule is illustrated in !ig.(64? , ,here the lo,er input is fi"ed at 0.

!ig.(64? )ule 6. A.1$A

A variable A-.ed ,ith 1 is al,ays equal to the variable. #f A is 0 the output of the A-. gate is 0. #f A is 1, the output of the A-. gate is 1 because both inputs are no, 1s. This rule is sho,n in !ig.(64; , ,here the lo,er input is fi"ed at 1.

!ig.(64;

)ule :.

A/A$A

A variable +)ed ,ith itself is al,ays equal to the variable. #f A is 0, then 0 / 0 $ 0' and if A is 1, then 1 / 1 $ 1. This is sho,n in !ig.(6410 , ,here both inputs are the same variable.

!ig.(6410 )ule =. A/A$ 1

A variable +)ed ,ith its complement is al,ays equal to 1. #f A is 0, then 0 / 0 $ 0 / 1 $ 1. #f A is l, then 1 / 1 $ 1/ 0 $ 1. &ee !ig.(6411 , ,here one input is the complement of the other.

!ig.(6411 )ule >. A.A$A

A variable A-.ed ,ith itself is al,ays equal to the variable. #f A $ 0, then 0.0 $ 0' and if A $ 1. then 1.1 $ 1. !ig.(6418 illustrates this rule.

!ig.(6418

)ule ?.

A.A$ 0

A variable A-.ed ,ith its complement is al,ays equal to 0. 1ither A or A ,ill al,ays be 09 and ,hen a 0 is applied to the input of an A-. gate. the output ,ill be 0 also. !ig.(641* illustrates this rule.

!ig.(641* )ule ; A$A

The double complement of a variable is al,ays equal to the variable. #f you start ,ith the variable A and complement (invert it once, you get A. #f you then ta2e A and complement (invert it, you get A, ,hich is the original variable. This rule is sho,n in !ig.(6416 using inverters.

!ig.(6416 )ule 10. follo,s9 A / AB $ A( 1 / B $A.l $A !actoring (distributive la, )ule 89 (1 / B $ 1 )ule 69 A . 1 $ A A / AB $ A

This rule can be proved by applying the distributive la,, rule 8, and rule 6 as

The proof is sho,n in Table 648, ,hich sho,s the truth table and the resulting logic circuit simplification.

Table 648

)ule 11.

A / AB $ A / B )ule 109 A $ A / AB )ule >9 A $ AA )ule ?9 adding AA $ 0 !actoring )ule =9 A / A $ 1 )ule 69 drop the 1

This rule can be proved as follo,s9 A / AB $ (A / AB / AB $ (AA / AB / AB $AA /AB /AA /AB $ (A / A (A / B $ 1. (A / B $A / B resulting logic circuit simplification. Table 64*

The proof is sho,n in Table 64*, ,hich sho,s the truth table and the

)ule 18.

(A / B (A / 0 $ A / B0 .istributive la, )ule >9 AA $ A )ule 89 1 / 0 $ 1 !actoring (distributive la, )ule 89 1 / B $ 1 )ule 69 A . 1 $ A

This rule can be proved as follo,s9 (A / B (A / 0 $ AA / A0 / AB / B0 $ A / A0 / AB / B0 $ A( 1 / 0 / AB / B0 $ A. 1 / AB / B0 $ A(1 / B / B0 $ A. 1 / B0 $ A / B0 The proof is sho,n in Table 646, ,hich sho,s the truth table and the resulting logic circuit simplification. Table 646

DEMORGAN'S THEOREMS
.e@organ, a mathematician ,ho 2ne, Boole, proposed t,o theorems that are an important part of Boolean algebra. #n practical terms. .e@organ(s theorems provide mathematical verification of the equivalency of the -A-. and negative4+) gates and the equivalency of the -+) and negative4A-. gates, ,hich ,ere discussed in part *. +ne of .e@organ(s theorems is stated as follo,s9 !"e co#ple#ent of a p oduct of $a iables is e%ual to t"e su# of t"e co#ple#ents of t"e $a iables& &tated another ,ay, !"e co#ple#ent of two o #o e ANDed $a iables is e%ui$alent to t"e OR of t"e co#ple#ents of t"e indi$idual $a iables' The formula for e"pressing this theorem for t,o variables is <A $ < / A .e@organ(s second theorem is stated as follo,s9 !"e co#ple#ent of a su# of $a iables is e%ual to t"e p oduct of t"e co#ple#ents of t"e $a iables' &tated another ,ay, !"e co#ple#ent of two o #o e ORed $a iables is e%ui$alent to t"e AND of t"e co#ple#ents of t"e indi$idual $a iables& The formula for e"pressing this theorem for t,o variables is </A$<A !ig.(641: sho,s the gate equivalencies and truth tables for the t,o equations above.

!ig.(641: Bate equivalencies and the corresponding truth tables that illustrate .e@organ(s theorems. As stated, .e@organ(s theorems also apply to e"pressions in ,hich there are more than t,o variables. The follo,ing e"amples illustrate the application of .e@organ(s theorems to *4variable and 64variable e"pressions. Example Apply .e@organ(s theorems to the e"pressions <AC and < / A / D. <AC $ < / A / C </y/C$<AC 1"ample Apply .e@organ(s theorems to the e"pressions E<AC and E / < / y / D. E<AC $ E / < / y / C E/</y/C$E<AC

Applying DeMorgan's Theorems The follo,ing procedure illustrates the application of .e@organ(s theorems and Boolean algebra to the specific e"pression

&tep l. #dentify the terms to ,hich you can apply .e@organ(s theorems, and thin2 of each term as a single variable. Fet A / B0 $ < and .(1 / ! $ A. &tep 8. &ince < / A $ < A,

$ (A / B0 (.(1 / ! &tep *. Gse rule ; (A $ A to cancel the double bars over the left term (this is not part of .e@organ(s theorem . (A / B0 (.(1 / ! $ (A / B0 (.(1 / ! &tep 6. Applying .e@organ(s theorem to the second term, (A / B0 (.(1 / ! $ (A / B0 (. / (1 / ! &tep :. Gse rule ; (A $ A to cancel the double bars over the 1 / ! part of the term. (A / B0 (. / 1 / ! $ (A / B0 (. / 1 / ! 1"ample Apply .e@organ(s theorems to each of the follo,ing e"pressions9 (a (A / B / 0 . (b AB0 / .1! (c AB / 0. / 1!

1"ample The Boolean e"pression for an e"clusive4+) gate is AB / AB. Eith this as a starting point, use .e@organ(s theorems and any other rules or la,s that are applicable to develop an e"pression for the e"clusive4-+) gate.

BOOLEAN ANALYSIS OF LOGIC CIRCUITS


Boolean algebra provides a concise ,ay to e"press the operation of a logic circuit formed by a combination of logic gates so that the output can be determined for various combinations of input values.

Boolean E(p ession fo a Logic )i cuit To derive the Boolean e"pression for a given logic circuit, begin at the left4 most inputs and ,or2 to,ard the final output, ,riting the e"pression for each gate. !or the e"ample circuit in !ig.(641= , the Boolean e"pression is determined as follo,s9 The e"pression for the left4most A-. gate ,ith inputs 0 and . is 0.. The output of the left4most A-. gate is one of the inputs to the +) gate and B is the other input. Therefore, the e"pression for the +) gate is B / 0.. The output of the +) gate is one of the inputs to the right4most A-. gate and A is the other input. Therefore, the e"pression for this A-. gate is A(B / 0. , ,hich is the final output e"pression for the entire circuit.

!ig.(641= A logic circuit sho,ing the development of the Boolean e"pression for the output.

)onst ucting a ! ut" !able fo a Logic )i cuit +nce the Boolean e"pression for a given logic circuit has been determined, a truth table that sho,s the output for all possible values of the input variables can be developed. The procedure requires that you evaluate the Boolean e"pression for all possible combinations of values for the input variables. #n the case of the circuit in !ig.(641= , there are four input variables (A, B, 0, and . and therefore si"teen (8 values are possible.
6

$ 1= combinations of

Putting the Results in Truth Table format The first step is to list the si"teen input variable combinations of 1s and 0s in a binary sequence as sho,n in Table 64:. -e"t, place a 1 in the output column for each combination of input variables that ,as determined in the evaluation. !inally, place a 0 in the output column for all other combinations of input variables. These results are sho,n in the truth table in Table 64:.

Table 4-

SIMPLIFICATION USING BOOLEAN ALGEBRA A simplified Boolean e"pression uses the fe,est gates possible to implement a given e"pression. 1"ample Gsing Boolean algebra techniques, simplify this e"pression9 AB / A(B / 0 / B(B / 0 &olution &tep 19 Apply the distributive la, to the second and third terms in the e"pression, as follo,s9 AB / AB / A0 / BB / B0 &tep 89 Apply rule > (BB $ B to the fourth term. AB / AB / A0 / B / B0 &tep *9 Apply rule : (AB / AB $ AB to the first t,o terms. AB / A0 / B / B0 &tep 69 Apply rule 10 (B / B0 $ B to the last t,o terms.

AB / A0 / B &tep :9 Apply rule 10 (AB / B $ B to the first and third terms. B/A0 At this point the e"pression is simplified as much as possible.

!ig.(641> Bate circuits for e"ample above. 1"ample &implify the Boolean e"pressions9 14 AB / A(B / 0 / B(B / 0 . 84 HAB( 0 / B. / A BI0 *4 AB0 / AB0 / A B 0 / AB0 / AB0

&tandard and 0anonical !orms


S!ANDARD FORMS OF BOOLEAN E*+RESS,ONS All Boolean e"pressions, regardless of their form, can be converted into either of t,o standard forms9 the sum4of4products form or the product4of4 sums form. &tandardiDation ma2es the evaluation, simplification, and implementation of Boolean e"pressions much more systematic and easier. The Sum of Pro!ucts "S#P$ %orm Ehen t,o or more product terms are summed by Boolean addition, the resulting e"pression is a sum4of4products (&+J . &ome e"amples are9 AB / AB0 AB0 / 0.1 / B0. AB / B0. / A0 Also, an &+J e"pression can contain a single4variable term, as in A / AB0 / B0.. I! a! SOP exp"e##$%! a #$!&le %'e"ba" (a!!%) ex)e!* %'e" m%"e )+a! %!e 'a"$able, 1"ample 0onvert each of the follo,ing Boolean e"pressions to &+J form9 (a AB / B(0. / 1! (b (A / B (B / 0 / . (c (A / B / 0

!ig.(641? #mplementation of the &+J e"pression AB / B0. / A0.

!ig.(641; This -A-.K-A-. implementation is equivalent to the A-.K+) in figure above. The Stan!ar! S#P %orm &o far, you have seen &+J e"pressions in ,hich some of the product terms do not contain all of the variables in the domain of the e"pression. !or e"ample, the e"pression AB0 / AB. / AB0. has a domain made up of the variables A, B, 0. and .. Lo,ever, notice that the complete set of variables in the domain is not represented in the first t,o terms of the e"pression' that is, . or . is missing from the first term and 0 or 0 is missing from the second term. A standard &+J e"pression is one in ,hich all the variables in the domain appear in each product term in the e"pression. !or e"ample, AB0. / AB0. / AB0. is a standard &+J e"pression.

Converting Pro!uct Terms to Stan!ar! S#P9 1ach product term in an &+J e"pression that does not contain all the variables in the domain can be e"panded to standard &+J to include all variables in the domain and their complements. As stated in the follo,ing steps, a nonstandard &+J e"pression is converted into standard form using Boolean algebra rule = (A / A $ 1 from Table 6419 A variable added to its complement equals 1. &tep 1. @ultiply each nonstandard product term by a term made up of the sum of a missing variable and its complement. This results in t,o product terms. As you 2no,, you can multiply anything by 1 ,ithout changing its value. &tep 8. )epeat &tep 1 until all resulting product terms contain all variables in the domain in either complemented or uncomplemented form. #n converting a product term to standard form, the number of product terms is doubled for each missing variable. 1"ample 0onvert the follo,ing Boolean e"pression into standard &+J form9 AB0 / AB / AB0. &olution The domain of this &+J e"pression A, B, 0, .. Ta2e one term at a time. The first term, AB0, is missing variable . or ., so multiply the first term by (. / . as follo,s9 AB0 $ AB0(. / . $ AB0. / AB0. #n this case, t,o standard product terms are the result. The second term, AB, is missing variables 0 or 0 and . or ., so first multiply the second term by 0 / 0 as follo,s9 AB $ AB(0 / 0 $ AB0 / AB0

The t,o resulting terms are missing variable . or ., so multiply both terms by (. / . as follo,s9 AB0(. / . / AB0(. / . $ A B0. / AB0. / AB0. / AB0. #n this case, four standard product terms are the result. The third term, AB0., is already in standard form. The complete standard &+J form of the original e"pression is as follo,s9 AB0 / AB / AB0. $ AB0. / AB0. / A B0. / AB0. / AB0. / AB0. / AB0. The Pro!uct of Sums "P#S$ %orm A sum term ,as defined before as a term consisting of the sum (Boolean addition of literals (variables or their complements . Ehen t,o or more sum terms are multiplied, the resulting e"pression is a product4of4sums (J+& . &ome e"amples are (A / B (A / B / 0 (A / B / 0 ( 0 / . / 1 (B / 0 / . (A / B (A / B / 0 (A / 0 A J+& e"pression can contain a single4variable term, as in A(A / B / 0 (B / 0 / . . #n a J+& e"pression, a single overbar cannot e"tend over more than one variable' ho,ever, more than one variable in a term can have an overbar. !or e"ample, a J+& e"pression can have the term A / B / 0 but not A / B / 0. #mplementation of a J+& 1"pression simply requires A-.ing the outputs of t,o or more +) gates. A sum term is produced by an +) operation and the product of t,o or more sum terms is produced by an A-. operation. !ig.(64

80 sho,s for the e"pression (A / B (B / 0 / . (A / 0 . The output < of the A-. gate equals the J+& e"pression.

!ig.(6480 The Stan!ar! P#S %orm &o far, you have seen J+& e"pressions in ,hich some of the sum terms do not contain all of the variables in the domain of the e"pression. !or e"ample, the e"pression (A / B / 0 (A / B / . (A / B / 0 / . has a domain made up of the variables A, B, 0, and .. -otice that the complete set of variables in the domain is not represented in e first t,o terms of the e"pression' that is, . or . is missing from the first term and 0 or 0 is missing from the second term. A standard J+& e"pression is one in ,hich all the variables in the domain appear in each sum term in the e"pression. !or e"ample, (A / B / 0 / . (A / B / 0 / . (A / B / 0 / . is a standard J+& e"pression. Any nonstandard J+& e"pression (referred to simply as J+& can be converted to the standard form using Boolean algebra. Converting a Sum Term to Stan!ar! P#S 1ach sum term in a J+& e"pression that does not contain all the variables in the domain can be e"panded to standard form to include all variables in the domain and their complements. As stated in the follo,ing steps, a

nonstandard J+& e"pression is converted into standard form using Boolean algebra rule ? (A A $ 0 from Table 6419 &tep 1. Add to each nonstandard product term a term made up of the product of the missing variable and its complement. This results in t,o sum terms. As you 2no,, you can add 0 to anything ,ithout changing its value. &tep 8. Apply rule 18 from Table 6419 A / B0 $ (A / B (A / 0 &tep *. )epeat &tep 1 until all resulting sum terms contain all variables in the domain in either complemented or noncomplemented form. 1"ample 0onvert the follo,ing Boolean e"pression into standard J+& form9 (A / B / 0 (B / 0 / . (A / B / 0 / . &olution The domain of this J+& e"pression is A, B, 0, .. Ta2e one term at a time. The first term, A / B / 0, is missing variable . or ., so add .. and apply rule 18 as follo,s9 A / B / 0 $ A / B / 0 / .. $ (A / B / 0 / . (A / B / 0 / . The second term, B / 0 / ., is missing variable A or A, so add AA and apply rule 18 as follo,s9 B / 0 / . $ B / 0 / . / AA $ (A / B / 0 / . (A / B / 0 / . The third term, A / B / 0 / ., is already in standard form. The standard J+& form of the original e"pression is as follo,s9 (A / B / 0 (B / 0 / . (A / B / 0 / . $ (A / B / 0 / . (A / B / 0 / . (A / B / 0 / . (A / B / 0 / . (A / B / 0 / .

1"amples94

)ANON,)AL FORMS OF BOOLEAN E*+RESS,ONS Eith one variable Eith t,o variables Eith three variables " M ". " y, " y, " y and " y. " y D, " y D, " y D, " y D, " y D, " y D, " y D M " y D.

These eight A-. terms are called minterms. n variables can be combined to form 8 nminterms. " 0 0 0 0 1 1 1 1 y 0 0 1 1 0 0 1 1 D 0 1 0 1 0 1 0 1 minterm "yD "yD "yD "yD "yD "yD "yD "yD (A-. terms m$!)e"m a!* '$(e 'e"#a, designation m0 m1 m8 m* m6 m: m= m> ma"term "/y/D "/y/D "/y/D "/y/D "/y/D "/y/D "/y/D "/y/D (+) terms designation @0 @1 @8 @* @6 @: @= @>

N%)e )+a) ea(+ max)e"m $# )+e (%mpleme!) %- $)# (%""e#p%!*$!&

!or e"ample the function ! " 0 0 0 0 1 1 1 1 y 0 0 1 1 0 0 1 1 D 0 1 0 1 0 1 0 1 ! 0 1 0 0 1 0 0 1

!$"yD/"yD/"yD ! $ m1 / m6 / m>

Any Boolean function can be e"pressed as a sum of minterms (sum of products SOP or product of ma"terms (product of sums POS . !$"yD/"yD/"yD/"yD/"yD The complement of ! $ ! $ ! ! $ (" / y / D (" / y / D (" / y / D (" / y / D (" / y / D ! $ @0@ 8 @@ * @ : 1"ample 1"press the Boolean function ! $ A / B0 in a sum of minterms (&+J . &olution The term A is missing t,o variables because the domain of ! is (A, B, 0 A $ A(B / B $ AB / AB because B / B $ 1
=

B0

missing A, so

B0(A / A $ AB0 / AB0 AB(0 / 0 $ AB0 / AB0 AB(0 / 0 $ AB0 / AB0 ! $ AB0 / AB0 / AB0 / AB0 / AB0 / AB0 Because A / A $ A ! $ AB0 / AB0 / AB0 / AB0 / AB0 ! $ m>/ m / m = m/ :m /6 #n short notation !(A, B, 0 $ N(1, 6, :, =, > !(A, B, 0 $ N(0, 8, * T+e (%mpleme!) %- a -.!()$%! exp"e##e* a# )+e #.m %- m$!)e"m# e/.al )% )+e #.m %- m$!)e"m# m$##$!& -"%m )+e %"$&$!al -.!()$%!,
1

Truth table for ! $ A / B0 A 0 1 8 * 6 : = > 0 0 0 0 1 1 1 1 B 0 0 1 1 0 0 1 1 C 0 1 0 1 0 1 0 1 B 1 1 0 0 1 1 0 0 BC 0 1 0 0 0 1 0 0 F 0 1 0 0 1 1 1 1

1"ample 1"press ! $ "y / "D &olution ! $ "y / "D $ ("y / " ("y / D $ (" / " (y / " (" / D (y / D remember "/"$1 ! $ (y / " (" / D (y / D ! $ (" / y / DD (" / yy / D ("" / y / D ! $ (" / y / D (" / y / D (" / y / D (" / y / D (" / y /D (" / y / D
$$$$$$$$$$ 444444444444444444 4444444444444444 $$$$$$$$$$

in a product of ma"terms form.

! $ (" / y / D (" / y / D (" / y / D (" / y / D ! $ @6@ @ : @ 0


8

!(", y, D $ O(0, 8, 6, : !(", y, D $ O(1, *, =, > T+e (%mpleme!) %- a -.!()$%! exp"e##e* a# )+e p"%*.() %- max)e"m# e/.al )% )+e p"%*.() %- max)e"m# m$##$!& -"%m )+e %"$&$!al -.!()$%!, To convert from one canonical form to another, interchange the symbols N, O and list those numbers missing from the original form. ! $ @6@ @ : @ 0 $8m / m 1 /m * / m= !(", y, D $ O(0, 8, 6, : $ N(1, *, =, >
>

1"ample .evelop a truth table for the standard &+J e"pression AB0 / AB0 / AB0.

Converting P#S &'pressions to Truth Table %ormat )eca11 that a J+& e"pression is equal to 0 only if at least one of the sum terms is equal to 0. To construct a truth table from a J+& e"pression, list all the possible combinations of binary values of the variables Pust as ,as done for the &+J e"pression. -e"t, convert the J+& e"pression to standard form if it is not already. !inally, place a 0 in the output column (< for each binary value that ma2es the e"pression a 0 and place a 1 for all the remaining binary values. This procedure is illustrated in 1"ample belo,9 1"ample .etermine the truth table for the follo,ing standard J+& e"pression9

&olution There are three variables in the domain and the eight possible binary values are listed in the left three columns of. The binary values that ma2e the sum terms in the e"pression equal to 0 are A/ B / 09 000' A / B / 09 0109 A / B / 09 011' A / B / 09 10l' and A / B / 09 110. !or each of these binary values, place a 0 in the output column as sho,n in the table. !or each of the remaining binary combinations, place a 1 in the output column.

0ARNAUGH MAP MINIMI1ATION


A Qarnaugh map provides a systematic method for simplifying Boolean e"pressions and, if properly used, ,ill produce the simplest &+J or J+& e"pression possible, 2no,n as the minimum e"pression. As you have seen, the effectiveness of algebraic simplification depends on your familiarity ,ith all the la,s, rules, and theorems of Boolean algebra and on your ability to apply them. The Qarnaugh map, on the other hand, provides a %coo2boo2% method for simplification. A Qarnaugh map is similar to a truth table because it presents all of the possible values of input variables and the resulting output for each value. #nstead of being organiDed into columns and ro,s li2e a truth table, the Qarnaugh map is an array of cells in ,hich each cell represents a binary value of the input variables. The cells are arranged in a ,ay so that simplification of a given e"pression is simply a matter of properly grouping the cells. Qarnaugh maps can be used for e"pressions ,ith t,o, three, four. and five variables. Another method, called the Ruine4@c0lus2y method can be used for higher numbers of variables. The number of cells in a Qarnaugh map is equal to the total number of possible input variable combinations as is the number of ro,s in a truth table. !or three variables, the number of cells is 8 $ * ?. !or four variables, the number of cells is 8 6$ 1=. !"e -./a iable 0a naug" Map The *4variable Qarnaugh map is an array of eight cells. as sho,n in !ig.(:4 1 (a . #n this case, A, B, and 0 are used for the variables although other letters could be used. Binary values of A and B are along the left side (notice

the sequence and the values of 0 are across the top. The value of a given cell is the binary values of A and B at the left in the same ro, combined ,ith the value of 0 at the top in the same column. !or e"ample, the cell in the upper left corner has a binary value of 000 and the cell in the lo,er right corner has a binary value of 101. !ig.(:41 ( b sho,s the standard product terms that are represented by each cell in the Qarnaugh map.

(a

(b

!ig.(:41 A *4variable Qarnaugh map sho,ing product terms. !"e 1./a iable 0a naug" Map The 64variable Qarnaugh map is an array of si"teen cells, as sho,n in !ig.(:48 (a . Binary values of A and B are along the left side and the values of 0 and . are across the top. The value of a given cell is the binary values of A and B at the left in the same ro, combined ,ith the binary values of 0 and . at the top in the same column. !or e"ample, the cell in the upper right corner has a binary value of 0010 and the cell in the lo,er right corner has a

binary value of 1010. !ig.(:48 (b sho,s the standard product terms that are represented by each cell in the 64variable Qarnaugh map.

(a !ig.(:48 A 64variable Qarnaugh map. Cell A!(acency

(b

The cells in a Qarnaugh map are arranged so that there is only a single4 variable change bet,een adPacent cells. AdPacency is defined by a single4 variable change. #n the *4variable map the 010 cell is adPacent to the 000 cell, the 011 cell, and the 110 cell. The 010 cell is not adPacent to the 001 cell, the 111 cell, the 100 cell, or the 101 cell.

!ig.(:4* AdPacent cells on a Qarnaugh map are those that differ by only one variable. Arro,s point bet,een adPacent cells. 0ARNAUG2 MA+ SO+ M,N,M,3A!,ON !or an &+J e"pression in standard form, a 1 is placed on the Qarnaugh map for each product term in the e"pression. 1ach 1 is placed in a cell corresponding to the value of a product term. !or e"ample, for the product term AB0, a 1 goes in the 10l cell on a *4variable map. 1"ample @ap the follo,ing standard &+J e"pression on a Qarnaugh map9 see !ig.(:46 . 1"ample @ap the follo,ing standard &+J e"pression on a Qarnaugh map9

&ee !ig.(:4: .

!ig.(:46

!ig.(:4: 1"ample @ap the follo,ing &+J e"pression on a Qarnaugh map9 &olution The &+J e"pression is obviously not in standard form because each product term does not have three variables. The first term is missing t,o variables,

the second term is missing one variable, and the third term is standard. !irst e"pand the terms numerically as follo,s9

1"ample @ap the follo,ing &+J e"pression on a Qarnaugh map9

&olution The &+J e"pression is obviously not in standard form because each product term does not have four variables.

@ap each of the resulting binary values by placing a 1 in the appropriate cell of the 64 variable Qarnaugh map.

0a naug" Map Si#plification of SO+ E(p essions Brouping the 1s, you can group 1s on the Qarnaugh map according to the follo,ing rules by enclosing those adPacent cells containing 1s. The goal is to ma"imiDe the siDe of the groups and to minimiDe the number of groups. A group must contain either 1, 8, 6, ?, or 1= cells, ,hich are all po,ers of t,o. #n the case of a *4variable map, *8 $ ? cells is the ma"imum group. 1ach cell in a group must be adPacent to one or more cells in that same group. Al,ays include the largest possible number of 1s in a group in accordance ,ith rule 1. 1ach 1 on the map must be included in at least one group. The 1s already in a group can be included in another group as long as the overlapping groups include noncommon 1s.

1"ample9 Broup the 1s in each of the Qarnaugh maps in !ig.(:4= .

!ig.(:4= &olution9 The groupings are sho,n in !ig.(:4> . #n some cases, there may be more than one ,ay to group the 1s to form ma"imum groupings.

!ig.(:4> .etermine the minimum product term for each group. a. !or a *4variable map9 (1 A l4cell group yields a *4variable product term (8 A 84cell group yields a 84variable product term (* A 64cell group yields a 14variable term (6 An ?4cell group yields a value of 1 for the e"pression

b. !or a 64variable map9 (1 A 14cell group yields a 64variable product term (8 A 84cell group yields a *4variable product term (* A 64cell group yields a 84variable product term (6 An ?4cell group yields a 14variable term (: A 1=4cell group yields a value of 1 for the e"pression 1"ample9 .etermine the product terms for each of the Qarnaugh maps in !ig.(:4> and ,rite the resulting minimum &+J e"pression.

!ig.(:4? &olution9 The resulting minimum product term for each group is sho,n in !ig.(:4? . The minimum &+J e"pressions for each of the Qarnaugh maps in the figure are9 (a AB/B0/AB0 (b B / A 0 / A0 (0 AB / A0 / AB. (d . / AB0 / B0

1"ample9 Gse a Qarnaugh map to minimiDe the follo,ing standard &+J e"pression9 AB0 / AB0 / AB0 / AB0 / AB0 1"ample9 Gse a Qarnaugh map to minimiDe the follo,ing &+J e"pression9

2D%!') Ca"e2 C%!*$)$%!# &ometimes a situation arises in ,hich some input variable combinations are not allo,ed. !or e"ample, recall that in the B0. code there are si" invalid combinations9 1010, 1011, 1100, 1101, 1110, and 1111. &ince these unallo,ed states ,ill never occur in an application involving the B0. code, they can be treated as %don(t care% terms ,ith respect to their effect on the output. That is, for these %don(t care% terms either a 1 or a 0 may be assigned to the output9 it really does not matter since they ,ill never occur. The %don(t care% terms can be used to advantage on the Qarnaugh map. !ig.(:4; sho,s that for each %don(t care% term, an < is placed in the cell. Ehen grouping the 1 s, the <s can be treated as 1s to ma2e a larger grouping or as 0s if they cannot be used to advantage. The larger a group, the simpler the resulting term ,ill be. The truth table in !ig.(:4; (a describes a logic function that has a 1 output only ,hen the B0. code for >,?, or ; is present on the inputs. #f the %don(t cares% are used as 1s, the resulting e"pression for the function is A / B0., as indicated in part (b . #f the %don(t cares% are not used as 1s, the resulting

e"pression is AB0 / AB0.9 so you can see the advantage of using %don(t care% terms to get the simplest e"pression.

!ig.(:4;

0ARNAUGH MAP POS MINIMI1ATION


#n this section, ,e ,ill focus on J+& e"pressions. The approaches are much the same e"cept that ,ith J+& e"pressions, 0s representing the standard sum terms are placed on the Qarnaugh map instead of 1s. !or a J+& e"pression in standard form, a 0 is placed on the Qarnaugh map for each sum term in the e"pression. 1ach 0 is placed in a cell corresponding to the value of a sum term. !or e"ample, for the sum term A / B / 0, a 0 goes in the 0 1 0 cell on a *4variable map. Ehen a J+& e"pression is completely mapped, there ,ill be a number of 0s on the Qarnaugh map equal to the number of sum terms in the standard J+& e"pression. The cells that do not have a 0 are the cells for ,hich the e"pression is 1. Gsually, ,hen ,or2ing ,ith J+& e"pressions, the 1s are left off. The follo,ing steps and the illustration in !ig.(:410 sho, the mapping process. &tep 1. .etermine the binary value of each sum term in the standard J+& e"pression. This is the binary value that ma2es the term equal to 0. &tep 8. As each sum term is evaluated, place a 0 on the Qarnaugh map in the corresponding cell.

!ig.(:410 1"ample of mapping a standard J+& e"pression. 1"ample9 @ap the follo,ing standard J+& e"pression on a Qarnaugh map9 &olution9

0a"!a.&+ Map S$mpl$-$(a)$%! %- POS Exp"e##$%!#


The process for minimiDing a J+& e"pression is basically the same as for an &+J e"pression e"cept that you group 0s to produce minimum sum terms instead of grouping 1s to produce minimum product terms. The rules for grouping the 0s are the same as those for grouping the 1s that you learned before. 1"ample9 Gse a Qarnaugh map to minimiDe the follo,ing standard J+& e"pression9 Also, derive the equivalent &+J e"pression.

&olution9

1"ample9 Gse a Qarnaugh map to minimiDe the follo,ing J+& e"pression9

1"ample9 Gsing a Qarnaugh map, convert the follo,ing standard J+& e"pression into a minimum J+& e"pression, a standard &+J e"pression, and

a minimum &+J e"pression.

FI3E-3ARIABLE 0ARNAUGH MAPS


Boolean functions ,ith five variables can be simplified using a *84cell Qarnaugh map. Actually, t,o 64variable maps (1= cells each are used to construct a :4variable map. Aou already 2no, the cell adPacencies ,ithin each of the 64 variable maps and ho, to form groups of cells containing 1s to simplify an &+J e"pression. All you need to learn for five variables is the cell adPacencies bet,een the t,o 64variable maps and ho, to group those adPacent 1s. A Qarnaugh map for five variables (AB0.1 can be constructed using t,o 64variable maps ,ith ,hich you are already familiar. 1ach map contains 1= cells ,ith all combinations of variables B, 0, ., and 1. +ne map is for A $ 0 and the other is for A $ 1, as sho,n in !ig.(:411 . Cell A!(acencies Aou already 2no, ho, to determine adPacent cells ,ithin the 64variable map. The best ,ay to visualiDe cell adPacencies bet,een the t,o 1=4cel1 maps is to imagine that the A $ 0 map is placed on top of the A $ 1 map. 1ach cell in the A $ 0 map is adPacent to the cell directly belo, it in the A $ 1 map, see !ig.(:418 .

!ig.(:411

!ig.(:418 The simplified &+J e"pression yields " $ .1 / B01 / AB. / B0 .1

1"ample9 Gse a Qarnaugh map to minimiDe the follo,ing standard &+J :4variable e"pression9

4 COMBINATIONAL LOGIC
ANALISIS

5- AND-OR L%&$(
!ig.(=41 (a sho,s an A-.4+) circuit consisting of t,o 84input A-. gates and one 84input +) gate' !ig.(=41 (b is the A-&# standard rectangular outline symbol. The Boolean e"pressions for the A-. gate outputs and the resulting &+J e"pression for the output < are sho,n in the diagram. #n general, all A-.4+) circuit can have any number of A-. gates each ,ith any number of inputs. The truth table for a 64input A-.4+) logic circuit is sho,n in Table =41. The intermediate A-. gate outputs ( AB and 0. columns are also sho,n in the table.

6a7 L%&$( *$a&"am

6b7 ANSI #)a!*a"* "e()a!&.la" %.)l$!e

#8mb%l,

F$&,64-57

F%" a 4-$!p.) AND-OR l%&$( ($"(.$)9 )+e %.)p.) X $# HIGH 657 $- b%)+ $!p.) A a!* $!p.) B a"e HIGH 657 %" b%)+ $!p.) C a!* $!p.) D a"e HIGH 657,

:-AND-OR-I!'e") L%&$(
Ehen the output of an A-.4+) circuit is complemented (inverted , it results in an A-.4+)4#nvert circuit. )ecall that A-.4+) logic directly implements &+J e"pressions. J+& e"pressions can be implemented ,ith A-.4+)4#nvert logic. This is illustrated as follo,s, starting ,ith a J+& e"pression and developing the corresponding A-.4+)4#nvert e"pression.
Table 4-5

F$&,64-:7

F%" a 4-$!p.) AND-OR-I!'e") l%&$( ($"(.$)9 )+e %.)p.) X $# LO; 6<7 $b%)+ $!p.) A a!* $!p.) B a"e HIGH 657 %" b%)+ $!p.) C a!* $!p.) D a"e HIGH 657,

=-Ex(l.#$'e-OR l%&$(
The e"clusive4+) gate ,as introduced before. Although, because of its importance, this circuit is considered a type of logic gate ,ith its o,n unique symbol it is actually a combination of t,o A-. gates, one +) gate, and t,o inverters, as sho,n in !ig.(=4* (a . The t,o standard logic symbols are sho,n in parts (b and (c .

F$&,64-=7

The output e"pression for the circuit in !ig.(=4* is

0an be ,ritten as
Table 4-: T".)+ )able -%" a! ex(l.#$'e-OR,

4- Ex(l.#$'e-NOR L%&$(
As you 2no,, the complement of the e"clusive4+) function is the e"clusive4-+), ,hichis derived as follo,s9 < $ AB / AB $ (AB (AB $ (A / B (A / B $ AB / AB -otice that the output < is L#BL only ,hen the t,o inputs, A and B, are at the same level. The e"clusive4-+) can be implemented by simply inverting the output of an e"clusive4 +), as sho,n in !ig(=46 (a , or by directly implementing the e"pression AB / AB, as sho,n in part (b .

F$&,64-47 Example .evelop a logic circuit ,ith four input variables that ,ill only produce a 1 output ,hen e"actly three input variables are 1s. !ig.(=4: sho,s the circuit.

!ig.(=4:

Example )educe the combinational logic circuit in !ig.(=4= to a minimum form.

F$&,64-47 S%l.)$%! The e"pression for the output of the circuit is ) $ (A B 0 0 / AB0 / . Applying .e@organ(s theorem and Boolean algebra,

The simplified circuit is a 64input +) gate as sho,n in !ig.(=4> .

F$&,64->7

THE UNI3ERSAL PROPERTY OF NAND AND NOR GATES


14 The -A-. Bate as a Gniversal Fogic 1lement The -A-. gate is a universal gate because it can be used to produce the -+T, the A-., the +), and the -+) functions. An inverter can be made from a -A-. gate by connecting all of the inputs together and creating, in effect, a single input, as sho,n in !ig.(=4? (a for a 84input gate. An A-. function can be generated by the use of -A-. gates alone, as sho,n in !ig.(=4? (b . An +) function can be produced ,ith only -A-. gates, as illustrated in part (c . !inally. a -+) function is produced as sho,n in part (d .

F$&,64-?7

84 The -+) Bate as a Gniversal Fogic 1lement Fi2e the -A-. gate, the -+) gate can be used to produce the -+T, A-.. +) and -A-. functions. A -+T circuit, or inverter, can be made from a -+) gate by connecting all of the inputs together to effectively create a single input, as sho,n in !ig.(=410 (a ,ith a 84input e"ample. Also, an +) gate can be produced from -+) gates, as illustrated in !ig.(=410 (b . An A-. gate can be constructed by the use of -+) gates, as sho,n in !ig.(=410 (c . #n this case the -+) gates B 1 and B 8 are used as inverters, and the final output is derived by the use of .e@organ(s theorem as follo,s9 <$A/B$AB !ig.(=410 (d sho,s ho, -+) gates are used t0 form a -A-. function.

F$&,64-5<7

Example

Example 5- ;"$)e )+e %.)p.) exp"e##$%! -%" ea(+ ($"(.$) a# $) appea"# $! F$&,64557 a!* )+e! (+a!&e ea(+ ($"(.$) )% a! e/.$'ale!) AND-OR (%!-$&."a)$%!, :- De'el%p )+e )".)+ )able -%" ($"(.$) $! F$&,64-5576a-b7, =- S+%@ )+a) a! ex(l.#$'e-NOR ($"(.$) p"%*.(e# a POS %.)p.),

> FUNCTIONS OF COMBINATIONAL LOGIC


>-5 BASIC ADDERS A half4adder adds t,o bits and produces a sum and a carry output. Adders are important in computers and also in other types of digital systems in ,hich numerical data are processed. The Lalf4Adder )ecall the basic rules for binary. 0/ 0$ 0 0/ 1$ 1 1/ 0$ 1 1 / 1 $ 10 The operations are performed by a logic circuit called a half4adder. The half4adder accepts t,o binary digits on its inputs and produces t,o binary digits on its outputs, a sum bit and a carry bit. A half4adder is represented by the logic symbol in !ig.(>41 . 2alf.Adde Logic9 !rom the operation of the half4adder as stated in Table >41, e"pressions can be derived for the sum and the output carry as functions of the inputs. -otice that the output 0arry (0 out is a 1 only ,hen both A and B are 1s9 therefore. 0 out can be e"pressed 0out $ AB -o, observe that the sum output ( N is a 1 only if the input variables A and B, are not equal. The sum can therefore be e"pressed as the e"clusive4+) of the input variables. N$A B

!ig.(>41 Fogic symbol for a half4adder.

!ig.(>48 Lalf4adder logic diagram. Table >41

The !ull4Adder The second category of adder is the full4adder. The full4adder accepts t,o input bits and an input carry and generates a sum output and an output carry. The basic difference bet,een a full4adder and a half4adder is that the full4adder accepts an input carry. A logic symbol for a full4adder is sho,n in !ig.(>4* , and the truth table in Table >48 sho,s the operation of a full4adder.

Table >48

!ig.(>4* Fogic symbol for a full4adder.

!ig.(>46 0omplete logic circuit for a full4adder.

N $ A B 0in 0out $ AB / (A B 0in -otice in !ig.(>46 there are t,o half4adders, connected as sho,n in the bloc2 diagram of !ig.(>4: , ,ith their output carries +)ed.

!ig.(>4: Arrangement of t,o half4adders to form a full4adder.

ExampleA !or each of the three full4adders in !ig.(>4= , determine the outputs for the inputs sho,n.

!ig.(>4=

>-: PARALLEL BINARY ADDERS As you sa, in &ection >41, a single full4adder is capable of adding t,o 14bit numbers and an input carry. To add binary numbers ,ith more than one bit, you must use additional full4adders. Ehen one binary number is added to another, each column generates a sum bit and a 1 or 0 carry bit to the ne"t column to the left, as illustrated here ,ith 84bit numbers.

To add t,o binary numbers, a full4adder is required for each bit in the numbers. &o for 84bit numbers, t,o adders are needed' for 64bit numbers, four adders are used' and so on. The carry output of each adder is connected to the carry input of the ne"t higher4order adder, as sho,n in !ig.(>4> for a 84bit adder. -otice that either a half4adder can be used for the least significant position or the carry input of a full4 adder can be made 0 (grounded because there is no carry input to the least significant bit position.

F$&,6>->7Bl%(B *$a&"am %- a ba#$( :-b$) pa"allel a**e" .#$!& )@% -.ll-a**e"#,

ExampleA .etermine the sum generated by the *4bit parallel adder in !ig.(>4? and sho, the intermediate carries ,hen the binary numbers 101 and 011 are being added.

!ig.(>4? Fou .Bit +a allel Adde s A group of four bits is called a nibble. A basic 64bit parallel adder is implemented ,ith four full4adder stages as sho,n in !ig.(>4; . Again, the F&Bs (A1 and B1 in each number being added go into the right4most full4adder9 the higher4order bits are applied as sho,n to the successively higher4order added, ,ith the @&Bs (A and B in each number being applied to the left4most full4adder. The 0arry output of each adder is connected to the carry input of the ne"t higher4order adder as indicated. These are called internal carries.

!ig.(>4; (a

!ig.(>4; A 64bit parallel adder. )a 4 Sa$e Adde 5)SA6 Amethod for adding three or more numbers at a time is called carry4save addition. This process is illustrated in 1"ample belo,9 ExampleA 00011 00001 / <5<<5 01011 / <<<5 01101 A B 0 sum, e"cluding carries carries shifted left one place final sum

A o Bo Bo Co

Co

A o Bo

Co

A o Bo

Co

Ao

ABC Co S

ABC C o S

ABC Co S

ABC Co S

ABC Co S

ABC Co S

ABC Co S

ABC Co S

>-= COMPARATORS The basic function of a comparator is to compare the magnitudes of t,o binary quantities to determine the relationship of those quantities. #n its simplest form, a comparator circuit determines ,hether t,o numbers are equal. E%ualit4 The e"clusive4+) gate can be used as a basic comparator because its output is a 1 if the t,o input bits are not equal and a 0 if the input bits are equal. !ig.(>411 sho,s the e"clusive4+) gate as a 84bit comparator.

!ig.(>411 Basic comparator operation.

#n order to compare binary numbers containing t,o bits each, an additional e"clusive4 +) gate is necessary. The t,o least significant bits (F&Bs of the t,o numbers are compared by gate B1. and the t,o most significant bits (@&Bs are compared by gate B8, as sho,n in !ig.(>418 . #f the t,o numbers are equal, their corresponding bits are the same, and the output of each e"clusive4+) gate is a 0. #f the corresponding sets of bits are not equal, a 1 occurs on that e"clusive4+) gate output.

F$&,6>-5:7 L%&$( *$a&"am -%" e/.al$)8 (%mpa"$#%! %- )@% :-b$) !.mbe"#,

,ne%ualit4 #n addition to the equality output, many #0 comparators provide additional outputs that indicate ,hich of the t,o binary numbers being compared is the larger. That is, there is an output that indicates ,hen number A is greater than number B (A S B and an output that indicates ,hen number A is less than number B (A T B , as sho,n in the logic symbol for a 64bit comparator in !ig.(>41* .

*. #f A* $ B*, then you must e"amine the ne"t lo,er bit position for an inequality

F$&,6>-5=7 L%&$( #8mb%l -%" a 4-b$) (%mpa"a)%" @$)+ $!e/.al$)8 $!*$(a)$%!,

To determine an inequality of binary numbers A and B, you first e"amine the highest4order bit in each number. The follo,ing conditions are possible9 1. #f A* $ 1 and B* $ 0, number A is greater than number B. 8. #f A* $ 0 and B* $ 1 number A is less than number B.

You might also like