Faculty: Science Course: BSc Sem: II Unit: IV Paper: II Topic: Combinational Logic Circuits Teacher: Saikumar Chirra Physics Department. Unit-IV: Combinational Logic Circuits ❖ Outlines of Unit - IV 1) Introduction and laws of :- i. Commutative ii. Associative iii. Distribution and iv. Absorptive Laws 2) De-Morgan’s laws:- 3) Dual & Complement of : 4) SOP & POS (or) Minterms & Maxterms: 5) Karnaugh’s (K) - Mapping: 6) Simplification of Boolean Expression:- By i. Boolean laws ii. K - maps 7) Combinational Logic Circuits: i. Half adder, ii. Full adder, iii. Half Subtractor and iv. Full Subtractor. 1. Introduction and laws of Boolean Algebra

Introduction: ➢ Boolean Algebra is the mathematics we use to analyze digital gates and circuits and these gates are used as the building blocks in the design of more complex digital logic circuits. ➢ We can use these “Laws of Boolean” to both reduce and simplify a complex Boolean expression in an attempt to reduce the number of logic gates required. ➢ Boolean Algebra is therefore a system of mathematics based on logic that has its own set of rules or laws which are used to define and reduce Boolean expressions. It is named after its inventor George Boole. ➢ The variables used in Boolean Algebra only have one of two possible values, a logic “0” and a logic “1” but an expression can have an infinite number of variables all labelled individually to represent inputs to the expression 1. Introduction and laws Continue……

➢ The algebra that deals with binary literals and logic functions ➢ literals: Denote by letters of the alphabet. e.g. A, B, X, Y, Z (or) a, b, x, y, z ….etc ➢ Basic Logic operations on those literals: AND, OR, NOT ➢ A Boolean Expression (e.g. X+YZ) is Formed by: - Binary literals -Logic operations (operators) on the literals and constants -Constants 0,1 ➢ A Boolean Function can be described by a Boolean Equation of the form ➢ Each equation can be represented as a logic diagram ➢ A Boolean Function can be uniquely expressed as a truth table showing the mapping between each possible combination of the input literals and the output literal (n input literals = 2ncombinations) ➢ Simplest functions require the smallest number of the smallest gates. 1. Introduction and laws Continue…… George Boole, 1815 - 1864

• Born to working class parents • Taught himself mathematics and joined the faculty of Queen’s College in Ireland. • Wrote An Investigation of the Laws of Thought (1854) • Introduced binary variables • Introduced the three fundamental logic operations: AND, OR, and NOT.

Copyright © 2007 Elsevier Simplifying a Logic Circuit F = A(A’ + B) The expression F simplifies to AB.

Which circuit is cheaper?

In order to use of Boolean Algebra we need to know some basic Laws and Principles. 1. Introduction and laws Continue…… i. Commutative Law • The order of application of two separate terms is not important • i.e. A * B = B * A ➢ The order in which two variables are AND’ed makes no difference. A . B = B . A ➢ The order in which two variables are OR’ed makes no difference. A + B = B + A ii. Associative law • This law allows the removal of brackets from an expression and regrouping of the variables. • i. e. (A * B) * C = A * (B * C) = A * B * C ➢ A + (B + C) = (A + B) + C = A + B + C (OR Associate Law) ➢ A(B.C) = (A.B)C = A . B . C (AND Associate Law) 1. Introduction and laws Continue…… iii. Distributive Law • This law permits the multiplying or factoring out of an expression. • i.e. A * B . C = A * B . A * C ➢ A.(B + C) = A.B + A.C (OR Distributive Law) ➢ A + (B.C) = (A + B).(A + C) (AND Distributive Law) iv. Absorptive Law • This law enables a reduction in a complicated expression to a simpler one by absorbing like terms. • B is irrelevant (redundant, absorbed) in this expression. • i.e. A * (A * B) = A ➢ A + (A.B) = A (OR Absorption Law) ➢ A(A + B) = A (AND Absorption Law) 1. Introduction and laws Continue…… Basic Principles of Boolean algebra • A Boolean algebra requires: – A set of values B, which contains at least two elements 0 and 1

– Two 2-argument operations + and • – A one-argument operation ' • The values and operations must satisfy the axioms below.

1. x + 0 = x 2. x • 1 = x 3. x + 1 = 1 4. x • 0 = 0 5. x + x = x 6. x • x = x 7. x + x’ = 1 8. x • x’ = 0 9. (x’)’ = x 10. x + y = y + x 11. xy = yx Commutative 12. x + (y + z) = (x + y) + z 13. x(yz) = (xy)z Associative 14. x(y + z) = xy + xz 15. x + yz = (x + y)(x + z) Distributive 16. (x + y)’ = x’y’ 17. (xy)’ = x’ + y’ DeMorgan’s 2. De-Morgan’s laws:-

• Augustus De Morgan was a contemporary of George Boole. He was the first professor of mathematics at the University of London. • De Morgan (27 June 1806 – 18 March 1871) was a British mathematician and logician. He formulated De Morgan's laws and introduced the term mathematical induction, making its idea rigorous. • De Morgan did not actually create the law given his name, but is credited with stating it. • De Morgan’s axioms/Laws are especially important for circuit design. • Easily generalized to n variables. 2. De-Morgan’s laws Continue….

• De Morgan's laws are a pair of transformation rules that are both valid rules of inference. • Can be proven using a Truth table or Boolean Algebra ➢ 1st Law : - When the NOT operator is applied to the AND of two variables, it is equal to the NOT applied to each of the variables with an OR in between: 퐘 = 푨 . 푩 = 푨ഥ + 푩ഥ Or (x . y)’ = x’ + y’ ✓ Pushing a bubble from the output back to the inputs puts bubbles on all gate inputs.

A A Y Y B B 2. De-Morgan’s laws Continue….

➢ 2nd Law: - When the NOT operator is applied to the OR of two variables, it is equal to the NOT applied to each of the two variables with an AND in between: 퐘 = 푨 + 푩 = 푨ഥ . 푩ഥ Or (x + y)’ = x’ . y’

✓ Pushing bubbles on all gate inputs forward toward the output puts a bubble on the output and changes the gate body.

A A Y Y B B 3. Dual & Complement of Boolean Function: Duality ➢ The dual of any equation is always true. ➢ For any expression, the dual is formed by replacing • AND with OR, • OR with AND, • 0 with 1, and • 1 with 0. • Variables and complements are left unchanged. Ex: (AB' + C)' = (A + B').C (OR) ✓ The dual of an expression may be found by complementing the entire expression and then complementing each of the individual variables. Ex: (AB' + C)' = (AB')'.C' = (A' + B).C' Therefore, (AB' + C)D = (A + B').C 3. Dual & Complement Continue…. Duality • Look carefully at the left and right columns of axioms. • They are duals, where we’ve: – exchanged all AND operations with OR operations, and – exchanged all 0s with 1s. • The dual of any equation is always true. 1. x + 0 = x 2. x • 1 = x 3. x + 1 = 1 4. x • 0 = 0 5. x + x = x 6. x • x = x 7. x + x’ = 1 8. x • x’ = 0 9. (x’)’ = x 10. x + y = y + x 11. xy = yx Commutative 12. x + (y + z) = (x + y) + z 13. x(yz) = (xy)z Associative 14. x(y + z) = xy + xz 15. x + yz = (x + y)(x + z) Distributive 16. (x + y)’ = x’y’ 17. (xy)’ = x’ + y’ DeMorgan’s 3. Dual & Complement Continue…. Complement of a function • When you complement an expression algebraically, you can use De-Morgan’s axiom to keep “pushing” the complement operators inwards: If f(x,y,z) = x(y’z’ + yz) then find f’ ??

Sol: 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’] 3. Dual & Complement Continue…. Complement of a function • The magenta axioms deal with the complement operation, which doesn’t exist in normal algebra. • Most of them almost make sense if you translate them into English: – “It is raining or it is not raining” is always true (x + x’ = 1) – “It is raining and it is not raining” can never be true (x • x’ = 0) – “I am not not handsome” means “I am handsome” ((x’)’ = x)

1. x + 0 = x 2. x • 1 = x 3. x + 1 = 1 4. x • 0 = 0 5. x + x = x 6. x • x = x 7. x + x’ = 1 8. x • x’ = 0 9. (x’)’ = x 10. x + y = y + x 11. xy = yx Commutative 12. x + (y + z) = (x + y) + z 13. x(yz) = (xy)z Associative 14. x(y + z) = xy + xz 15. x + yz = (x + y)(x + z) Distributive 16. (x + y)’ = x’y’ 17. (xy)’ = x’ + y’ DeMorgan’s 3. Dual & Complement Continue…. Complement of a function • The complement of a function always outputs 0 where the original function output 1, and 1 where the original produced 0. • In a truth table, we can just exchange 0s and 1s in the output column. – On the left is a truth table for f(x,y,z) = x(y’z’ + yz) – On the right is the table for the complement, denoted f’(x,y,z).

x y z f(x,y,z) x y z f’(x,y,z) 0 0 0 1 0 0 0 0 0 0 1 1 0 0 1 0 0 1 0 1 0 1 0 0 0 1 1 1 0 1 1 0 1 0 0 0 1 0 0 1 1 0 1 0 1 0 1 1 1 1 0 1 1 1 0 0 1 1 1 0 1 1 1 1 3. Dual & Complement Continue…. Some more laws • Here are some more useful equations. – These are usually called laws, because they can all be proven from the more fundamental axioms. – You can also prove them using truth tables. – Notice that each law also has a dual. • Feel free to use these laws in homeworks and exams, if you like.

x + xy = x x(x + y) = x xy + xy’ = x (x + y)(x + y’) = x x + x’y = x + y x(x’ + y) = xy xy + x’z + yz = xy + x’z (x + y)(x’ + z)(y + z) = (x + y)(x’ + z) 3. Dual & Complement Continue…. Boolean Algebra

Exercise:1

For the following Boolean expression

F(A,B,C) = ABC + A'BC + AB'C + ABC'

1. Using Boolean algebra, simplify the Boolean expression. 2. Derive the Truth table for the simplified expression. 3. Confirm that the Truth table is also valid for the original expression. 4. Draw the circuit diagram for the “cheaper” expression. 3. Dual & Complement Continue…. Exercise:2

• Here are the circuits resulting from the original and simplified expressions on the previous page. 4. SoP & PoS (or) Minterms & Maxterms Standard/ Canonical forms of expressions • We can write expressions in many ways, but some ways are more useful than others. • It is useful to specify a Boolean function in a form that: ✓ Has a direct correspondence to the truth table ✓ Allows comparison for equality • Two main Canonical Forms in common use: ✓ Sum of Minterms (SoM) ✓ Product of Maxterms (PoM) These forms can be useful for the simplification of functions, which is of great importance in the optimization of Boolean formulas in general and digital circuits in particular

•A minterm and maxterm with the same subscript are the complements of each other, i.e., Mj= m’j Product of Maxterms

To convert a Boolean function F from SoM to PoM: –Find F’in SoM form –Find F= (F’)’in PoM form 4. SOP & POS Continue… SoP (Sum of Products) PoS (Product of Sum) Minterm Maxterm • Minterms are called products • Maxterms are called sums because because they are the logical AND of they are the logical OR of a set of a set of variables variables • A product term in which all the variables • A sum term in which all the variables appear exactly once (either appear exactly once (either complemented or uncomplemented) is complemented or uncomplemented) is called a minterm called a maxterm • A minterm represents exactly one • A maxterm represents exactly one combination of the binary variables in a combination of the binary variables in a truth table. It has the value of 1 for that truth table. It has the value of 0 for that combination and 0 for the others. combination and 1 for the others • A Boolean function can be represented • A Boolean function can be represented algebraically from a given truth table by algebraically from a given truth table by forming the logical sum of all the forming the logical product of all the minterms that produce a 1 in the maxterms that produce a 0 in the function. This expression is called a Sum function. This expression is called a of Minterms (SoM) Product of Maxterms (PoM) • F(X,Y,Z) = X’Y’Z’+ X’YZ’+ XY’Z + XYZ • F = (X+Y+Z’)(X+Y’+Z’)(X’+Y+Z)(X’+Y’+Z) = m0+ m2+ m5+ m7 = M1. M3. M4. M6 • F(X,Y,Z) = Σm(0,2,5,7) • F(X,Y,Z)= ∏M(1,3,4,6) 4. SOP & POS Continue… SoP PoS Properties of Minterms Properties of Maxterms • There are 2n minterms for n • There are 2n minterms for n Boolean variables. Boolean variables. • These minterms can be • These maxterms can be evaluated from the binary evaluated from the binary numbers from 0 to 2n-1 numbers from 0 to 2n-1 • Any Boolean function can be • Any Boolean function can be expressed as a logical sum of expressed as a logical sum of minterms maxterms • The complement of a function • The complement of a function contains those minterms not contains those maxterms not included in the original function included in the original function • F(X,Y,Z) = Σm(0,2,5,7) • F(X,Y,Z) = ∏M(1,3,4,6) • => F’(X,Y,Z) = Σm(1,3,4,6) • => F’(X,Y,Z) = ∏M(0,2,5,7) • A function that includes all the • A function that includes all the 2n minterms is equal to logic 1 2n maxterms is equal to logic 1 • G(X,Y)= Σm(0,1,2,3)= 1 • G(X,Y)= ∏M(1,3,4,6) = 1 4. SOP & POS Continue… SoP PoS Sum-of-Products Product-of-Sums • The term "Sum of Products" or • The term “Product of Sums" or "PoS" "SoP" is widely used for the for the canonical form that is a canonical form that is a disjunction conjunction (AND) of maxterms (OR) of minterms • The Product of Maxterms (PoM) • The Sum of Minterms (SoM) form is form is a standard algebraic a standard algebraic expression that expression that is obtained from a is obtained from a truth table truth table • When we simplify a function in SoM • When we simplify a function in PoM form by reducing the number of form by reducing the number of sum product terms or by reducing the terms or by reducing the number of number of literals in the terms, the literals in the terms, the simplified simplified expression is said to be in expression is said to be in Product- SoP form of-Sums form • F = Σm(0,1,2,3,4,5,7) (SoM) • F = ∏M(0,2,3,4,5,6) (PoM) = Y’+ X’YZ’+ XY (SoP) = X(Y’+ Z)(X + Y +Z’) (PoS) 4. SOP & POS Continue… Points to Remember ➢ Canonical Form – In Boolean algebra, Boolean function can be expressed as Canonical known as minterm and some are expressed as Canonical known as maxterm . ✓ In Minterm, we look for the functions where the output results in “1” while in Maxterm we look for function where the output results in “0”. ✓ We perform Sum of minterm also known as Sum of products (SOP) . We perform Product of Maxterm also known as Product of sum (POS). ✓ Boolean functions expressed as a sum of minterms or product of maxterms are said to be in canonical form. ➢ Standard Form – A Boolean variable can be expressed in either true form or complemented form. ✓ In standard form Boolean function will contain all the variables in either true form or complemented form while in canonical number of variables depends on the output of SOP or POS. • A Boolean function can be expressed algebraically from a given truth table by forming a : 4. SOP & POS Continue… Points to Remember • A Boolean function can be expressed algebraically from a given truth table by forming a : ✓ minterm for each combination of the variables that produces a 1 in the function and then taking the OR of all those terms. ✓ maxterm for each combination of the variables that produces a 0 in the function and then taking the AND of all those terms. Truth table representing minterm and maxterm – 4. SOP & POS Continue… Example ❖ Express the Boolean function F = A + B’C as standard sum of minterms. ✓ Solution – A = A(B + B’) = AB + AB’ This function is still missing one variable, so A = AB(C + C’) + AB'(C + C’) = ABC + ABC’+ AB’C + AB’C’ The second term B’C is missing one variable; hence, B’C = B’C(A + A’) = AB’C + A’B’C Combining all terms, we have F = A + B’C = ABC + ABC’ + AB’C + AB’C’ + AB’C + A’B’C But AB’C appears twice, and according to theorem 1 (x + x = x), it is possible to remove one of those occurrences. Rearranging the minterms in ascending order, we finally obtain F = A’B’C + AB’C’ + AB’C + ABC’ + ABC = m1 + m4 + m5 + m6 + m7 SOP is represented as Sigma(1, 4, 5, 6, 7) 4. SOP & POS Continue… Example • Express the Boolean function F = xy + x’z as a product of maxterms ✓ Solution – F = xy + x’z = (xy + x’)(xy + z) = (x + x’)(y + x’)(x + z)(y + z) = (x’ + y)(x + z)(y + z) but x’ + y = x’ + y + zz’ = (x’+ y + z)(x’ + y + z’) x + z = x + z + yy’ = (x + y + z)(x + y’ + z) y + z = y + z + xx’ = (x + y + z)(x’ + y + z)

F = (x + y + z)(x + y’ + z)(x’ + y + z)(x’ + y + z’) = M0*M2*M4*M5 POS is represented as Pi(0, 2, 4, 5) 4. SOP & POS Continue… Minterm Function Example • Truth Table for the Function F1 = m1+ m4+ m7 F1 = x’ y’ z + x’ y z + x y z F1 = m(1,4,7)

Ind F1 = x y Z OUT F1 And the truth table is: ex PUT

✓ Function is 1at each of its 0 0 0 0 0 specified minterms 0 0 1 1 1 m1 ✓ As the sum of all minterms for which the function is 1 !…. 0 1 0 2 0 0 1 1 3 0 1 0 0 4 1 m4 1 0 1 5 0 1 1 0 6 0 1 1 1 7 1 m7 4. SOP & POS Continue… Maxterm Function Example • Implement F1 in maxterms: F1 = ПM(0,2,3,5,6) F1 = M0·M2·M3·M5·M6 F1 = (x+ y + z) . (x + y’ + z) . (x + y’ +z’) . (x’ + y + z) . (x + y + z) And the truth table is: x y Z Ind F1 = OUT F1 ex PUT ✓ Function is 0at each of its 0 0 0 0 0 M0 specified maxterms 0 0 1 1 1 ✓ As the product of all maxterms 0 1 0 2 0 M2 for which the function is 0!…. 0 1 1 3 0 M3 1 0 0 4 1 1 0 1 5 0 M5 1 1 0 6 0 M6 1 1 1 7 1 4. SOP & POS Continue… Example on Sum of minterms for f’ • Every function can be written as a sum of minterms, which is a special kind of sum of products form. • The sum of minterms form for any function is unique. • If you have a truth table for a function, you can write a sum of minterms expression just by picking out the rows of the table where the function output is 1. x y z f(x,y,z) f’(x,y,z) 0 0 0 1 0 f = m0 + m1 + m2 + m3 + m6 = m(0,1,2,3,6) 0 0 1 1 0 = x’y’z’ + x’y’z + x’yz’ + x’yz + xyz’ 0 1 0 1 0 0 1 1 1 0 f’ = m4 + m5 + m7 = m(4,5,7) 1 0 0 0 1 = xy’z’ + xy’z + xyz 1 0 1 0 1 1 1 0 1 0 f’ contains all the minterms not in f. 1 1 1 0 1

4. SOP & POS Continue… Example :Implementing the Complement of a Function • For a function (F) expressed as a canonical sum of minterms, the complement of the function (F’) can be constructed as either: – A sum of the minterms missing in the given sum-of minterms canonical form for F – A Product of the Maxterms having the same indices Example: Given F(x,y,z) = Σm (1,3,5,7) F is 1 for these indices Then we have: ∴F is 1 for the remaining indices

F’(x,y,z) = Σ m (0,2,4,6) ∴F is 0 for the these indices F’(x,y,z) = Π M (1,3,5,7) Standard order Product of of input literals Maxterms 5. Karnaugh’s (K) - Mapping: ➢ Minimizing the gate input (or literal) cost of Boolean equations reduces circuit cost ➢ We will use the gate input G as the cost criterion ➢ Boolean Algebra and graphical techniques are tools to minimize cost criteria values ➢ Will cover optimum or near-optimum cost functions for two-level (SOP and POS) circuits ➢ Will Introduce a graphical optimization technique using Karnaugh maps (K-maps) ➢ A Karnaugh map is a graphical form of a truth table and consists of a square or rectangular array of adjacent cells or blocks. ➢ The number of cells in a particular map depends on the number of variables in the Boolean expression to be minimized. ➢ The number of cells for a particular map is determined from expression. N = 2n Where N = number of cells required for the Karnaugh map. n = number of variables in the Boolean expression. 5. Karnaugh’s (K) – Maps Conti…. Karnaugh Maps (K-maps) ➢ Karnaugh Map: A graphical technique for simplifying an expression into a minimal sum of products(MSP) form: o There are a minimal number of product terms in the expression o Each term has a minimal number of literals ➢ A K-map is a collection of cells ▪ Each cell represents a minterm ▪ The collection of cells is a graphical representation of a Boolean function ▪ Adjacent cells differ in the value of one literal only ▪ Alternative algebraic expressions for the same function are derived by recognizing patterns of cells ➢ The K-map can be viewed as ✓ A reorganized version of the truth table ✓ A topologically-warped as used to visualize sets in the algebra of sets 5. Karnaugh’s (K) – Maps Conti…. Karnaugh Maps (K-maps) ❖ View the function in a visual form ❖ Same information as truth table ❖ Easier to group minterms ❖ Re-arranging the Truth Table ✓ A two-variable function has four possible minterms. ✓ We can re-arrange these minterms into a Karnaugh map

x x 1 2 x x x 1 x 1 2 0 1 2 0 0 m 0 0 1 0 1 m m m 1 0 0 2 0 x’1 x’2 x1x’2 1 0 m 2 m m 1 1 3 1 x’1 x2 x1x2 1 1 m 3

(a) Truth table (b) Karnaugh map (c) K map with literals 5. Karnaugh’s (K) – Maps Conti…. Location of three-variable minterms

x 1 x 2 x 3 x 1 x 2 0 0 0 m x 0 3 00 01 11 10 0 0 1 m 1 0 m 0 m 2 m 6 m 4 0 1 0 m 2

0 1 1 m 3 1 m 1 m 3 m 7 m 5

1 0 0 m 4 (b) Karnaugh map 1 0 1 m 5

1 1 0 m 6

1 1 1 m 7

(a) Truth table 5. Karnaugh’s (K) – Maps Conti…. Location of three-variable minterms

x 1 x 2 x 3 x 1 x 2 0 0 0 m x 0 3 00 01 11 10 0 0 1 m 1 0 m 0 m 2 m 6 m 4 0 1 0 m 2

0 1 1 m 3 1 m 1 m 3 m 7 m 5

1 0 0 m 4 (b) Karnaugh map 1 0 1 m 5

1 1 0 m 6 1 1 1 m 7 Notice the placement of (a) Truth table ▪ Variables ▪ Binary pair values ▪ Minterms 5. Karnaugh’s (K) – Maps Conti…. & K-map

s x1 x2 5. Karnaugh’s (K) – Maps Conti…. Gray Code & K-map

s x1 x2

000 010 110 100

001 011 111 101 Adjacency Rules5. Karnaugh’s (K) – Maps Conti….

As if the K-map were adjacent drawn on a cylinder columns Adjacency Rules5. Karnaugh’s (K) – Maps Conti….

m m 4 m0 2

m5 m3 m1

As if the K-map were adjacent drawn on a cylinder columns 5. Karnaugh’s (K) – Maps Conti…. A four-variable Karnaugh map x1 x2 x3 x4 0 0 0 0 m0 0 0 0 1 m1 x 1 x x 0 0 1 0 m2 1 2 x x 0 0 1 1 m3 3 4 00 01 11 10 0 1 0 0 m4 m m m m 0 1 0 1 m5 00 0 4 12 8 0 1 1 0 m6 01 m 1 m 5 m 13 m 9 0 1 1 1 m7 x 1 0 0 0 m8 4 11 m m m m 1 0 0 1 m9 3 7 15 11 x 3 1 0 1 0 m10 10 m 2 m 6 m 14 m 10 1 0 1 1 m11 1 1 0 0 m12 1 1 0 1 m13 x 2 1 1 1 0 m14 1 1 1 1 m15 5. Karnaugh’s (K) – Maps Conti…. Adjacency Rules

adjacent rows

adjacent columns adjacent columns 5. Karnaugh’s (K) – Maps Conti…. Adjacency Rules

adjacent rows

As if the K-map were drawn on a torus

adjacent columns 5. Karnaugh’s (K) – Maps Conti…. Adjacency Rules

m8

m10

2

14

m m adjacent m6 rows m4 As if the K-map were drawn on a torus

adjacent columns 6. Simplification of Boolean Expression:-

Grouping Rules ➢ Group “1”s with rectangles

➢ Both sides a power of 2: ➢ 1x1, 1x2, 2x1, 2x2, 1x4, 4x1, 2x4, 4x2, 4x4

➢ Can use the same minterm more than once

➢ Can wrap around the edges of the map

➢ Some rules in selecting groups: ➢ Try to use as few groups as possible to cover all “1”s. ➢ For each group, try to make it as large as you can (i.e., if you can use a 2x2, don’t use a 2x1 even if that is enough). 6. Simplification Continue… Grouping Rules These are all valid groupings 6. Simplification Continue… Grouping Rules These are also valid

But try to use larger rectangles if possible. 6. Simplification Continue… Grouping Rules

This one is valid too

In this case the result is the constant function 1. 6. Simplification Continue… Grouping Rules

Why are these two not valid? 6. Simplification Continue… Grouping Rules These are valid groupings 6. Simplification Continue… Grouping Rules These are valid groupings 6. Simplification Continue… Grouping Rules These are valid groupings 6. Simplification Continue… Grouping Rules These are valid groupings 6. Simplification Continue… Grouping Rules

These are valid groupings 6. Simplification Continue… Grouping Rules

Some invalid groupings Grouping Rules 6. Simplification Continue… x 1 x 1 x 2 x x 3 4 00 01 11 10

00 m 0 m 4 m 12 m 8

01 m 1 m 5 m 13 m 9 x 4 11 m 3 m 7 m 15 m 11 x 3 10 m 2 m 6 m 14 m 10

x 2 Grouping Rules 6. Simplification Continue… x 1 x 1 x 2 x x 3 4 00 01 11 10

00 m 0 m 4 m 12 m 8

01 m 1 m 5 m 13 m 9 x 4 11 m 3 m 7 m 15 m 11 x 3 10 m 2 m 6 m 14 m 10

x 2 Grouping Rules 6. Simplification Continue… x 1 x 1 x 2 x x 3 4 00 01 11 10

00 m 0 m 4 m 12 m 8

01 m 1 m 5 m 13 m 9 x 4 11 m 3 m 7 m 15 m 11 x 3 10 m 2 m 6 m 14 m 10

x 2 Grouping Rules 6. Simplification Continue… x 1 x 1 x 2 x x 3 4 00 01 11 10

00 m 0 m 4 m 12 m 8

01 m 1 m 5 m 13 m 9 x 4 11 m 3 m 7 m 15 m 11 x 3 10 m 2 m 6 m 14 m 10

x 2 Grouping Rules 6. Simplification Continue… x 1 x 1 x 2 x x 3 4 00 01 11 10

00 m 0 m 4 m 12 m 8

01 m 1 m 5 m 13 m 9 x 4 11 m 3 m 7 m 15 m 11 x 3 10 m 2 m 6 m 14 m 10

x 2 All sides must be powers of 2. Grouping Rules 6. Simplification Continue… x 1 x 1 x 2 x x 3 4 00 01 11 10

00 m 0 m 4 m 12 m 8

01 m 1 m 5 m 13 m 9 x 4 11 m 3 m 7 m 15 m 11 x 3 10 m 2 m 6 m 14 m 10

x 2 All sides must be powers of 2. 6. Simplification Continue… Ex: -1. Write The Expression

x1 x2 Out put x x 1 0 0 1 2 0 1 0 1 1 0 1 0 1 0 0 1 1 1 1 1 1

_ x1 + x2 6. Simplification Continue… x1 x2 Out put 0 0 1 0 1 1 Example 2 1 0 0 1 1 0 x x x x 1 x 1 x 1 2 0 1 2 0 1 2 0 1 0 1 0 0 0 0 0 1 0 + = 1 0 0 1 1 0 1 1 0

m0 + m1 = m0 + m1

_ _ _ _ + = x1x2 x1x2 x1

Property 14 (Combining) 6. Simplification Continue… Examples 3: Find expression? 6. Simplification Continue…

Example 4: Find function f1 from given K map 6. Simplification Continue…

Example 5: Find function f3 from given K map 6. Simplification Continue…

Example 6: Find function f4 from given K map 7) Combinational Logic Circuits:

• Logic circuits for digital systems may be classified as Combinational Logic Circuits and Sequential Logic Circuits. • Combinational logic circuit (circuits with out memory) consists of input variables, logic gates, and output variables. In this type of circuits output is depend only on the current inputs.

• Sequential logic circuit (circuits with memory) employ storage elements and logic gates. In this type of circuits outputs depend on the current inputs and previous Timed “States” inputs. 7. Combinational Continue…. Combinational Logic Circuits Sequential Logic Circuits • Output of any instance of • Output is generated time depends only upon dependent upon the present the input variables input variables and also on the basis of past history of these inputs • Memory unit is not • Memory unit is required. required. – i.e. it allocates any – i.e. it doesn’t allocate memory to the any memory to the elements. elements. • Faster • Slower • Easy to design • Difficult • Parallel adder • Serial adder • Ex- Half and full adder • Ex- Flip flops Shift Half and full subtractor registers Binary counters MUX , DEMUX 7. Combinational Continue…. Binary Adding Circuits • We will now look at how binary addition may be implemented using combinational logic circuits. • We will consider first 2: – Half adder – Full adder – Ripple carry adder 7. Combinational Continue…. Half adder • A combinational circuit that performs the addition of two bits is called a half adder. • The block diagram, truth table and circuit for the half adder :

73 7. Combinational Continue…. Half adder • Another way of representation • The truth table for the half adder :

S = Sum S = x’y + xy’

C = Carry C = xy

Implementation of Half-Adder

74 7. Combinational Continue…. Half adder • The Sum (Σ) column is our familiar XOR gate, while the Carry (Cout) column is the AND gate. • This device is called a half-adder for reasons that will make sense in the next section. • Now it has been cleared that 1-bit adder can be easily implemented with the help of the XOR Gate for the output ‘SUM’ and an AND Gate for the ‘Carry’. • When we need to add, two 8-bit bytes together, we can be done with the help of a full-adder logic. • The half-adder is useful when you want to add one binary digit quantities. A way to develop a two-binary digit adders would be to make a truth table and reduce it. • Draw backs: – 1. Doesn’t handle carries – 2. Does not do further processing on carries. 75 7. Combinational Continue…. Full-Adder • One that performs the addition of three bits(two significant bits and a previous carry) is a full adder. • It consists of three inputs and two outputs, two inputs are the bits to be added, the third input represents the carry form the previous position. • When we need to add, two 8-bit bytes together, we can be done with the help of a full-adder logic. • The full adder is usually a component in a cascade of adders, which add 8, 16 etc binary numbers. The difference between a half-adder and a full-adder ✓ The difference between a half-adder and a full-adder is that the full-adder has three inputs and two outputs, whereas half adder has only two inputs and two outputs. ✓ This adder is difficult to implement than a half-adder. ✓ The first two inputs are A, B like half adder and the third input is an input carry as C-IN. ✓ When a full-adder logic is designed, you string eight of them together to create a byte-wide adder and cascade the carry bit from one adder to the next. 76 7. Combinational Continue…. Full-Adder • A full adder can be implemented in many different ways such as composed of other gates. • One example implementation is with

➢ S = A ⊕ B ⊕ Cin and

➢ Cout = (A ⋅ B) + (Cin ⋅ (A ⊕ B)). The circuit and truth table for the full adder :

77 7. Combinational Continue…. Full-Adder • Expression for Sum and Carry

➢ S = A ⊕ B ⊕ Cin and

➢ Cout = (A ⋅ B) + (Cin ⋅ (A ⊕ B)).

78 7. Combinational Continue…. Full-Adder • Full-adder can also implemented with two half adders

79 7. Combinational Continue…. Binary Subtractor Circuits • It is a combinational circuit that performs subtraction of two binary bits. • As their name implies, a Binary Subtractor is a decision making circuit that subtracts two binary numbers from each other, for example, A – B to find the resulting difference between the two numbers. • Unlike the Binary Adder which produces a SUM (S) and a CARRY (C) bit when two binary numbers are added together, the binary subtractor produces a DIFFERENCE (D) by using a BORROW bit (B) from the previous column. • Then obviously, the operation of subtraction is the opposite to that of addition. • Subtraction is done according to the rule of binary subtraction 7. Combinational Continue…. Half-subtractor • It has two inputs (minuend and subtrahend) and two outputs Difference

(D) and Borrows (Bout). • We use half-subtractor to subtract the LSB of the subtrahend to the LSB of the minuend when one binary number is subtracted from another. • Operations can be summarized in a truth table:

Deducing Expressions for D & B Using K-maps 7. Combinational Continue…. Full-subtractor • Generally, the full subtractor is one of the most used and essential combinational logic circuits. • It is a basic electronic device, used to perform subtraction of two binary numbers. • The full-subtractor uses binary digits like 0,1 for the subtraction. The circuit of full subtractor can be built with logic gates such as OR, Ex-OR, NAND gate.

• The inputs of this subtractor are A, B, Bin and outputs are D, Bout. 7. Combinational Continue…. Full-subtractor • Obtaining Full subtractor by using half subtractor. Full-subtractor 7. Combinational Continue….

• Expression for Full subtractor Bin 7. Combinational Continue…. Full-subtractor Applications of Full Subtractor • These are generally employed for ALU (Arithmetic logic unit) in computers to subtract as CPU & GPU for the applications of graphics to decrease the circuit difficulty. • Subtractors are mostly used for performing arithmetical functions like subtraction, in electronic calculators as well as digital devices. • These are also applicable for different microcontrollers for arithmetic subtraction, timers, and program counter (PC) • Subtractors are used in processors to compute tables, address, etc. • It is also useful for DSP and networking based systems. The End