LOGIC CIRCUITLOGIC CIRCUIT. Goal To understand how digital a computer can work, at the lowest level. To understand what is possible and the limitations.

Slides:



Advertisements
Similar presentations
BOOLEAN ALGEBRA. A Mathematical notation used to represent the function of the Digital circuit. A notation that allows variables & constants to have only.
Advertisements

Chapter 2 Logic Circuits.
K-Map Simplification COE 202 Digital Logic Design Dr. Aiman El-Maleh
Boolean Algebra and Combinational Logic
Digital Logic (Review)
Gate-Level Minimization. Digital Circuits The Map Method The complexity of the digital logic gates the complexity of the algebraic expression.
Chapter 2 – Combinational Logic Circuits Part 1 – Gate Circuits and Boolean Equations Logic and Computer Design Fundamentals.
CS 151 Digital Systems Design Lecture 6 More Boolean Algebra A B.
EET 1131 Unit 5 Boolean Algebra and Reduction Techniques
Computer Engineering (Logic Circuits) (Karnaugh Map)
Introduction Gate-level minimization refers to the design task of finding an optimal gate-level implementation of Boolean functions describing a digital.
بهينه سازي با نقشة کارنو Karnaugh Map. 2  Method of graphically representing the truth table that helps visualize adjacencies 2-variable K-map 3-variable.
CSCE 211: Digital Logic Design
Chapter 2: Combinatorial Logic Circuits Illustration Pg. 32 Logic Circuit Diagrams - Circuit Optimization -2,3,4 level maps 48 elements Optimized to 25.
IKI a-Simplification of Boolean Functions Bobby Nazief Semester-I The materials on these slides are adopted from those in CS231’s Lecture.
Chapter 2: Boolean Algebra and Logic Functions
1 Fundamentals of Computer Science Propositional Logic (Boolean Algebra)
1 Logic Gates Digital Computer Logic Kashif Bashir WWW:
1 COMBINATIONAL LOGIC One or more digital signal inputs One or more digital signal outputs Outputs are only functions of current input values (ideal) plus.
BOOLEAN ALGEBRA Saras M. Srivastava PGT (Computer Science)
Boolean Algebra and Digital Circuits
1 Simplification of Boolean Functions:  An implementation of a Boolean Function requires the use of logic gates.  A smaller number of gates, with each.
Department of Computer Engineering
CHAPTER 1 INTRODUCTION TO DIGITAL LOGIC. K-Map (1)  Karnaugh Mapping is used to minimize the number of logic gates that are required in a digital circuit.
Combinational Logic 1.
Dr. Eng. Farag Elnagahy Office Phone: King ABDUL AZIZ University Faculty Of Computing and Information Technology CPCS 222.
Charles Kime & Thomas Kaminski © 2008 Pearson Education, Inc. Circuit Optimization Logic and Computer Design Fundamentals.
EE345 – Micro-Controllers Gate-Level Minimization Prof. Ahmad Abu-El-Haija.
Gate-Level Minimization
Chapter 2 Two- Level Combinational Logic. Chapter Overview Logic Functions and Switches Not, AND, OR, NAND, NOR, XOR, XNOR Gate Logic Laws and Theorems.
Computer Engineering (Logic Circuits) (Karnaugh Map)
Chapter3: Gate-Level Minimization Part 1 Origionally By Reham S. Al-Majed Imam Muhammad Bin Saud University.
CHAPTER 3: PRINCIPLES OF COMBINATIONAL LOGIC
Lecture 4 Nand, Nor Gates, CS147 Circuit Minimization and
LOGIC GATES & BOOLEAN ALGEBRA
CS1Q Computer Systems Lecture 7
Ahmad Almulhem, KFUPM 2010 COE 202: Digital Logic Design Combinational Logic Part 3 Dr. Ahmad Almulhem ahmadsm AT kfupm Phone: Office:
Based on slides by:Charles Kime & Thomas Kaminski © 2004 Pearson Education, Inc. ECE/CS 352: Digital System Fundamentals Lecture 6 – Canonical Forms.
February 2, 2004CS 2311 Karnaugh maps Last time we saw applications of Boolean logic to circuit design. – The basic Boolean operations are AND, OR and.
Karnaugh Maps (K-Maps)
ENGIN112 L6: More Boolean Algebra September 15, 2003 ENGIN 112 Intro to Electrical and Computer Engineering Lecture 6 More Boolean Algebra A B.
Fundamentals of digital electronics Prepared by - Anuradha Tandon Assistant Professor, Instrumentation & Control Engineering Branch, IT, NU.
Boolean Algebra & Logic Circuits Dr. Ahmed El-Bialy Dr. Sahar Fawzy.
BOOLEAN ALGEBRA AND LOGIC SIMPLIFICATION
CHAPTER 1 INTRODUCTION TO DIGITAL LOGIC
Digital Logic (Karnaugh Map). Karnaugh Maps Karnaugh maps (K-maps) are graphical representations of boolean functions. One map cell corresponds to a row.
ECE DIGITAL LOGIC LECTURE 8: BOOLEAN FUNCTIONS Assistant Prof. Fareena Saqib Florida Institute of Technology Spring 2016, 02/11/2016.
BOOLEAN ALGEBRA LOGIC GATES. Introduction British mathematician George Boole( ) was successful in finding the link between logic and mathematics.
EE2174: Digital Logic and Lab Professor Shiyan Hu Department of Electrical and Computer Engineering Michigan Technological University CHAPTER 3 Combinational.
ECE 301 – Digital Electronics Minimizing Boolean Expressions using K-maps, The Minimal Cover, and Incompletely Specified Boolean Functions (Lecture #6)
Lecture 5 More Boolean Algebra A B. Overview °Expressing Boolean functions °Relationships between algebraic equations, symbols, and truth tables °Simplification.
LOGIC CIRCUITLOGIC CIRCUIT. Goal To understand how digital a computer can work, at the lowest level. To understand what is possible and the limitations.
CS231 Boolean Algebra1 Circuit analysis summary After finding the circuit inputs and outputs, you can come up with either an expression or a truth table.
Mu.com.lec 9. Overview Gates, latches, memories and other logic components are used to design computer systems and their subsystems Good understanding.
CE1110: Digital Logic Design Gate Level Minimization Karnaugh Maps (K-Maps)
CHAPTER 3 Simplification of Boolean Functions
Lecture 4 Nand, Nor Gates, CS147 Circuit Minimization and
Chapter 2: Boolean Algebra and Logic Functions
Computer Organisation
CS 105 Digital Logic Design
Complement of a Function
Karnaugh Maps.
17-Nov-18 Logic Algebra 1 Combinational logic.
Boolean Algebra.
BASIC & COMBINATIONAL LOGIC CIRCUIT
Boolean Algebra Boolean Algebra
Dr. Clincy Professor of CS
Laws & Rules of Boolean Algebra
Circuit Simplification and
Presentation transcript:

LOGIC CIRCUITLOGIC CIRCUIT

Goal To understand how digital a computer can work, at the lowest level. To understand what is possible and the limitations of what is possible for a digital computer.

Logic Gates Digital circuits are hardware components that manipulate binary information. Logic gates are implemented using transistors and integrated circuits. Each basic circuit is referred to as a logic gate.

Logic Gates All basic logic gates have the ability to accept either one or two input signals (depending upon the type of gate) and generate one output signal.

Binary Logic The binary logic system is one of a class of mathematical systems referred to as Boolean Algebra. In digital electronics, Boolean variables 0 and 1 correspond to binary 0 and 1. Input and Output signals are binary. binary: – always in one of two possible states; – typically treated as: » On / Off (electrically) » 1 / 0 » True / False Binary logic deals with binary variables

Review of Boolean Algebra The Boolean algebra is an algebra dealing with binary variables and logic operations. We use symbols to represent Boolean variables. The variables are designated by letters of the alphabet. E.g.: A, B, C, X, Y, Z. A Boolean expression is an algebraic expression formed by using binary variables, the logic operation symbols.

Logic Gates Symbols Inputs and outputs Gates have two or more inputs, except a NOT gate which has only one input. All gates have only one output. Usually the letters A, B, C and so on are used to label inputs, and Q is used to label the output. On this page the inputs are shown on the left and the output on the right. The inverting circle (o) Some gate symbols have a circle on their output which means that their function includes inverting of the output. It is equivalent to feeding the output through a NOT gate. For example the NAND (Not AND) gate symbol shown on the right is the same as an AND gate symbol but with the addition of an inverting circle on the output.

Basic logic gates NOT AND OR NAND NOR XOR

Truth Table A truth table is a good way to show the function of a logic gate. It shows the output states for every possible combination of input states. The symbols 0 (false) and 1 (true) are usually used in truth tables.

Logic Gate: NOT The NOT gate is also known as an inverter, simply because it changes the input to its opposite (inverts it). The NOT gate accepts only one input and the output is the opposite of the input. A common way of using the NOT gate is to simply attach the circle to the front of another gate. This simplifies the circuit drawing and simply says: "Invert the output from this gate."

Logic Gate: AND The AND gate requires two inputs and has one output. The AND gate only produces an output of 1 when BOTH the inputs are a 1, otherwise the output is 0.

Logic Gate: OR The OR gate requires two inputs and has one output. The OR gate only produces an output of 1 when AT LEAST ONE inputs is a 1, otherwise the output is 0.

Logic Gate: NAND This is an AND gate with the output inverted, as shown by the 'o' on the output. The output is true if input A AND input B are NOT both true: Q = NOT (A AND B) A NAND gate can have two or more inputs, its output is true if NOT all inputs are true.

Logic Gate: NOR This is an OR gate with the output inverted, as shown by the 'o' on the output. The output Q is true if NOT inputs A OR B are true: Q = NOT (A OR B) A NOR gate can have two or more inputs, its output is true if no inputs are true.

Logic Gate: XOR The output Q is true if either input A is true OR input B is true, but not when both of them are true: Q = (A AND NOT B) OR (B AND NOT A) This is like an OR gate but excluding both inputs being true. The output is true if inputs A and B are DIFFERENT. EX-OR gates can only have 2 inputs.

Logic Gate: XNOR This is an EX-OR gate with the output inverted, as shown by the 'o' on the output. The output Q is true if inputs A and B are the SAME (both true or both false): Q = (A AND B) OR (NOT A AND NOT B) EX-NOR gates can only have 2 inputs.

Logic Circuit Design

Logic Circuit Design Example 1 Find the Boolean expressions output of the following circuit: Answer: (x+y)y

Logic Circuit Design Example 2 Find the Boolean expressions output of the following circuit: Answer: xy _ _ ___ ___

Logic Circuit Design Example 3 Draw the circuits for the following Boolean algebraic expressions: x+y __ __ x+yx+y x

Logic Circuit Design Example 4 Draw the circuits for the following Boolean algebraic expressions: x+yx+y (x+y)x(x+y)x x+yx+y (x+y)x(x+y)x

Circuit-to-Truth Table Example OR A Y NOT AND B C 2 # of Inputs = # of Combinations 2 3 = A B C Y

OR A Y NOT AND B C A B A C A = A B + A C A B C Y } 1 1 } Circuit-to-Truth Table Example

BOOLEAN ALGEBRA

LAWS OF BOOLEAN ALGEBRA The next aspect of Boolean algebra is that of laws or properties Laws or rules for Boolean Algebra expressions have been invented to help reduce the number of logic gates needed to perform a particular logic operation resulting in a list of functions or theorems known commonly as the Laws of Boolean. As with many kinds of algebra, the principal laws take the form of equations between terms built up from variables using the operations of the algebra. Such an equation is deemed a law or identity just when both sides have the same value for all values of the variables, equivalently when the two terms denote the same operation.

Basic Identities of Boolean Algebra 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

Commutative Associative

Simplification

Distributive

DeMorgan’s

Boolean & Truth Table Each Boolean expression can be specified by a truth table which lists all possible combinations of the values of all variables in the expression.

Proof using Truth Table Truth Tables can be used to prove that two Boolean expressions are equal. If the two expressions have the same value for all possible combinations of input variables, they are equal. For example, prove the following Boolean expression using truth table:

The truth table for the expressions will look like below:

Another example is proving the Distributive Law using truth table: X(Y + Z) = XY + XZ

PRACTICE 1. Demonstrate by means of truth tables the validities of the following identities: a. (XYZ)’ = X’ + Y’ + Z’ b. X + YZ = (X + Y)(X + Z) c. X’Y + Y’Z + XZ’ = XY’ + YZ’ + X’Z 2. Prove the following identity of each of the following Boolean equations using algebraic manipulation: a. A’B + B’C’ + AB + B’C = 1 b. Y + X’Z + XY’ = X + Y + Z c. AB + BC’D’ + A’BC + C’D = B + C’D

KARNAUGH MAP

Circuit Minimization Algebraic manipulations can be used to simplify Boolean expressions – As we've seen, this process is not always easy Karnaugh maps (K-maps) provide an easy and visual technique for finding the minimum cost Sum-of-Product (SOP) or Product-of- Sum (POS) form for a Boolean expression.

Canonical & Standard Forms We need to consider formal techniques for the simplification of Boolean functions. – Identical functions will have exactly the same canonical form. – Minterms and Maxterms – Sum-of-Minterms and Product-of- Maxterms – Product and Sum terms – Sum-of-Products (SOP) and Product-of-Sums (POS)

Definition Literal: A variable or its complement Product term: literals connected by * Sum term: literals connected by + Minterm: a product term in which all the variables appear exactly once, either complemented or uncomplemented Maxterm: a sum term in which all the variables appear exactly once, either complemented or uncomplemented

Forms of Boolean Expressions Sum-of-products (SOP) – First the product (AND) terms are formed then these are summed (OR) – E.g: ABC + DEF + GHI Product-of-sum (POS) – First the sum (OR) terms are formed then the products are taken (AND) – E.g: (A+B+C) (D+E+F) (G+H+I)

Minterm Represents exactly one combination in the truth table. Denoted by m j, where j is the decimal equivalent of the minterm’s corresponding binary combination (b j ). A variable in m j is complemented if its value in b j is 0, otherwise is uncomplemented. Example: Assume 3 variables (A,B,C), and j=3. Then, b j = 011 and its corresponding minterm is denoted by m j = A’BC

Maxterm Represents exactly one combination in the truth table. Denoted by M j, where j is the decimal equivalent of the maxterm’s corresponding binary combination (b j ). A variable in M j is complemented if its value in b j is 1, otherwise is uncomplemented. Example: Assume 3 variables (A,B,C), and j=3. Then, b j = 011 and its corresponding maxterm is denoted by M j = A+B’+C’

Truth Table notation for Minterms and Maxterms Minterms and Maxterms are easy to denote using a truth table. Example: Assume 3 variables x,y,z (order is fixed)

Minterms and Maxterms are easy to denote using a truth table. Example: Assume 3 variables x,y,z (order is fixed) xyzMintermMaxterm 000 x’y’z’ = m 0 x+y+z = M x’y’z = m 1 x+y+z’ = M x’yz’ = m 2 x+y’+z = M x’yz = m 3 x+y’+z’= M xy’z’ = m 4 x’+y+z = M xy’z = m 5 x’+y+z’ = M xyz’ = m 6 x’+y’+z = M xyz = m 7 x’+y’+z’ = M 7 Truth Table notation for Minterms and Maxterms

Canonical Form (Unique) Any Boolean function F( ) can be expressed as a unique sum of minterms and a unique product of maxterms (under a fixed variable ordering). In other words, every function F() has two canonical forms: – Canonical Sum-Of-Products (sum of minterms) – Canonical Product-Of-Sums (product of maxterms) Canonical Sum-Of-Products: The minterms included are those m j such that F( ) = 1 in row j of the truth table for F( ). Canonical Product-Of-Sums: The maxterms included are those M j such that F( ) = 0 in row j of the truth table for F( ).

Example: Truth table for f 1 (a,b,c) at right The canonical sum-of-products form for f 1 is: f 1 (a,b,c) = m 1 + m 2 + m 4 + m 6 = a’b’c + a’bc’ + ab’c’ + abc’ The canonical product-of-sums form for f 1 is: f 1 (a,b,c) = M 0 M 3 M 5 M 7 = (a+b+c)(a+b’+c’) (a’+b+c’)(a’+b’+c’). Observe that: m j = M j ’ abc f1f1f1f

Notation: ∑ and ∏ f 1 (a,b,c) = ∑ m(1,2,4,6), where ∑ indicates that this is a sum-of- products form, and m(1,2,4,6) indicates that the minterms to be included are m 1, m 2, m 4, and m 6. f 1 (a,b,c) = ∏ M(0,3,5,7), where ∏ indicates that this is a product-of- sums form, and M(0,3,5,7) indicates that the maxterms to be included are M 0, M 3, M 5, and M 7. Since m j = M j ’ for any j, ∑ m(1,2,4,6) = ∏ M(0,3,5,7) = f 1 (a,b,c)

Conversion Between Canonical Forms Replace ∑ with ∏ (or vice versa) and replace those j’s that appeared in the original form with those that do not. Example: f 1 (a,b,c)= a’b’c + a’bc’ + ab’c’ + abc’ = m 1 + m 2 + m 4 + m 6 = ∑(1,2,4,6) = ∏(0,3,5,7) = (a+b+c)(a+b’+c’)(a’+b+c’)(a’+b’+c’)

Standard Forms (NOT Unique) Standard forms are “like” canonical forms, except that not all variables need appear in the individual product (SOP) or sum (POS) terms. Example: f 1 (a,b,c) = a’b’c + bc’ + ac’ is a standard sum-of-products form f 1 (a,b,c) = (a+b+c)(b’+c’)(a’+c’) is a standard product-of-sums form.

Karnaugh Maps (K-Map) Karnaugh maps (K-maps) are graphical representations of boolean functions. It is a simplification tool for managing Boolean algebraic expressions. Complex boolean function can be simplified by using boolean algebra but it lacks specific rules and becomes tedious sometimes. The map method provides a simple and straightforward method. One map cell corresponds to a row in the truth table. Also, one map cell corresponds to a minterm or a maxterm in the boolean expression. Multiple-cell areas of the map correspond to standard terms.

B C A m0m0 m1m1 m3m3 m2m2 1m4m4 m5m5 m7m7 m6m6 B A 01 0m0m0 m1m1 1m2m2 m3m3 C D A B m0m0 m1m1 m3m3 m2m2 01m4m4 m5m5 m7m7 m6m6 11m 12 m 13 m 15 m 14 10m8m8 m9m9 m 11 m 10 K-maps in Various Sizes

The K-Map uses the following rules for simplification of expressions by grouping together adjacent cells containing ones: 1. Groups may not include any cell containing a zero Karnaugh Maps – Rules of Simplification

2. Groups may be horizontal or vertical, but not diagonal. Karnaugh Maps – Rules of Simplification

3. Groups must contain 1, 2, 4, 8, or in general 2 n cells. That is if n = 1, a group will contain two 1's since 2 1 = 2. If n = 2, a group will contain four 1's since 2 2 = 4.

4. Each group should be as large as possible. Karnaugh Maps – Rules of Simplification

6. Groups may overlap. Karnaugh Maps – Rules of Simplification

7. Groups may wrap around the table. The leftmost cell in a row may be grouped with the rightmost cell and the top cell in a column may be grouped with the bottom cell. Karnaugh Maps – Rules of Simplification

8. There should be as few groups as possible, as long as this does not contradict any of the previous rules. Karnaugh Maps – Rules of Simplification

1.No zeros allowed. 2.No diagonals. 3.Only power of 2 number of cells in each group. 4.Groups should be as large as possible. 5.Every one must be in at least one group. 6.Overlapping allowed. 7.Wrap around allowed. 8.Fewest number of groups possible Karnaugh Maps – Rules of Simplification SUMMARY

Two-Variable Map m3m3m3m3 m2m2m2m2 1 m1m1m1m1 m0m0m0m A B NOTE: ordering of variables is IMPORTANT for f(A, B), A is the row, B is the column. Cell 0 represents A’B’; Cell 1 represents A’B; etc. If a minterm is present in the function, then a 1 is placed in the corresponding cell. m3m3m3m3 m1m1m1m11 m2m2m2m2 m0m0m0m00 10 B A OR

Any two adjacent cells in the map differ by ONLY one variable, which appears complemented in one cell and uncomplemented in the other. Example: m 0 (=x 1 ’x 2 ’) is adjacent to m 1 (=x 1 ’x 2 ) and m 2 (=x 1 x 2 ’) but NOT m 3 (=x 1 x 2 )

f(x 1,x 2 ) = x 1 ’x 2 ’+ x 1 ’x 2 + x 1 x 2 ’ = m 0 + m 1 + m 2 = x 1 ’ + x 2 ’ 1s placed in K-map for specified minterms m 0, m 1, m 2 Grouping (OR-ing) of 1’s allows simplification. What (simpler) function is represented by each dashed rectangle? – x 1 ’ = m 0 + m 1 – x 2 ’ = m 0 + m 2 Note m 0 covered twice x1x1x1x x2x Variable Map - Example

f(x1,x2) =  m(0,1,3) Canonical SOP: – f = x1'x2'+x1'x2+x1x2 = x1'x2'+x1'x2+x1x2+x1'x2 = x1'+x2 x1x2F x2 x minimum form: f = x1'+x2 2-Variable Karnaugh Map

m6m6m6m6 m7m7m7m7 m5m5m5m5 m4m4m4m41 m2m2m2m2 m3m3m3m3 m1m1m1m1 m0m0m0m yz x Note: variable ordering is (x,y,z); yz specifies column, x specifies row. Each cell is adjacent to three other cells (left or right or top or bottom or edge wrap) 3-Variable Karnaugh Map

The types of structures that are either minterm or are generated by repeated application of the minimization theorem on a three variable map are shown at right. Groups of 1, 2, 4, 8 are possible. minterm group of 2 terms group of 4 terms

f(A,B,C) =  m(1,2,6,7) Minimum SOP is f = A B + B C' + A' B' C B C A Variable Karnaugh Map

More 3 Variable K-Maps B C A B C A A' B + A B'(A  B) A' + B f =

B C A B C A A' C + A C'(A  C) C' + A B f =

Four-Variable Karnaugh Maps Top cells are adjacent to bottom cells. Left-edge cells are adjacent to right-edge cells. Note variable ordering (WXYZ). m 10 m 11 m9m9m9m9 m8m8m8m8 10 m 14 m 15 m 13 m m6m6m6m6 m7m7m7m7 m5m5m5m5 m4m4m4m4 01 m2m2m2m2 m3m3m3m3 m1m1m1m1 m0m0m0m WX YZ

One square represents a minterm of 4 literals. A rectangle of 2 adjacent squares represents a product term of 3 literals. A rectangle of 4 squares represents a product term of 2 literals. A rectangle of 8 squares represents a product term of 1 literal. A rectangle of 16 squares produces a function that is equal to logic 1. Four-variable Map Simplification

Example: Simplify the following Boolean function (A,B,C,D) = ∑m(0,1,2,4,5,7,8,9,10,12,13). First put the function g( ) into the map, and then group as many 1s as possible. cd ab g(A,B,C,D) = c’+b’d’+a’bd Four-variable Karnaugh Map

– f(A,B,C,D) =  m(0,1,2,3,6,8,9,11,13,14) – f = A C' D + B C D' + B' C ' + B' D + A'B' C D A B Four-variable Karnaugh Map

– f(A,B,C,D) =  m(0,1,2,5,6,7,8,9,10,13,15) – f = B D + A' B C + B' D' + B' C'or – f = B D + A' B C + B' D' + C' D(there are 2 more) C D A B These are not essential! Four-variable Karnaugh Map

Many times there are incompletely specified conditions – Valuations that can never occur, or for which we “don’t care what the device does” They are denoted with ‘X’. Each ‘X’ may be arbitrarily assigned the value 0 or 1 in an implementation. Don’t cares can be used to further simplify a function Don't care situations are often called incompletely specified functions Don’t Care Conditions

f(A,B,C,D) =  m(1,5,8,9,10) + d(3,7,11,15) – f = A B' + A' D C D A B X0 0101X0 1100X0 1011X1 Example Using Don't Cares

Example: Simplify the function f(a,b,c,d) whose K-map is shown at the right. f = a’c’d+ab’+cd’+a’bc’ or f = a’c’d+ab’+cd’+a’bd’ xx11 xx xx11 xx xx 11xx ab cd