Digital Circuits ECS 37 Dr. Prapun Suksompong prapun@siit.tu.ac.th Lecture 7 Office Hours: KD 36-7 Monday 9:-:3, :3-3:3 Tuesday :3-:3
Announcement HW2 posted on the course web site Chapter 4: Write down all the steps that you have done to obtain your answers. Due date: July 9, 29 (Thursday) Please submit your HW to the instructor 3 minutes EFORE your class starts. Late submission will NOT be accepted. Earlier submission is possible. There are two HW boxes in the EC department (6 th floor) for ECS 37. (One for CS. Another one for IT.) 2
Announcement Score and solution for HW posted on the course web site. Reading Assignment Chapter 4: 4.to 4-9 The textbook contains much more explanation than what I can talk about in class. Reading it will help you understand our material from another perspective. Today, we will use Handout for lecture 7 (new one) Handout for lecture 5-6 (old one) 3
Our Goals Ultimate goals:. Analyze digital circuits. 2. Design digital circuits to do something useful.. Analyze digital circuit: Given a digital circuit, find out what it does. One way to achieve this goal is to look at the truth table. 4
Example: Analyzing Logic Circuit. Suppose we are given a digital circuit. 2. Analyze it via the truth table A X X A A It may be useful to find a oolean expression first. 5 3. Interpretation: This is a circuit that checks whether A =. Output X = if A and are not the same. Output X = if A is the same as. We can apply the same technique to more complicated circuits. Sometimes, we may be able to simplify the circuit by simplifying its oolean expression.
Our Goals 6 Ultimate goals:. Analyze digital circuits. 2. Design digital circuits to do something useful.. Analyze digital circuit: 2. Design digital circuits: Given a task, build a SIMPLE digital circuit that perform the specified task. A recipe: Directly determine a oolean expression corresponding to the task or start with a truth table and then turn it into a oolean expression. Simplify the expression. Many examples last week. (One in next slide.) Construct a circuit from the simplified expression.
Example A C X X AC AC AC AC AC AC AC AC AC AC AC AC AC AC AC AC AC AC AC AC AC AC Direct construction of a circuit from this equation will be complicated. Simplification 7 Construction of an equivalent circuit from this equation is simpler. X AC
Example: Designing Logic Circuit. Suppose we want to build a circuit that perform a one-bit addition A S S C out 3. Can we turn this truth table into a simple circuit? S 2. We can summarize its task by a truth table. Inputs Outputs A C out S 8 A C out
Example: Designing Logic Circuit (2) 9. Suppose we want to build a circuit that perform a one-bit addition with input carry 2. We can summarize its task by a truth table. 3. Can we turn this truth table into oolean expression? Outputs Inputs A C out S C in How?
Truth Table oolean Expression? How can we turn a truth table into oolean expression? Let s first study the relationship between truth table and oolean expression. It is easier to convert a oolean expression into a truth table. There are some forms of oolean expressions that are easily converted into their corresponding truth tables. Sum-of-products form Product-of-sums form
Product Term A single literal or a product of two or more literals. Example: Caution: A C AC A A C D A C A C is not a product term. Q : When does A C? A C A: IFF,,,, So, it is very easy to construct a truth table for X A C X A C
2 Sum Term A single literal or a sum of two or more literals. Example: Caution: A C A C A A C D A C A C is not a sum term. Q : When does A C? It might be easier to ask: Q : When does A C? A C A: IFF,,,, Q : When does A C? A C A: IFF,,,, It is easy to construct a truth table for X A C A C X
Again. It is easy to find the case when a product term =. A C A C iff,,,, 2. It is easy to find the case when a sum term =. A C iff A,, C,, 3
Sum-of-Product (SOP) Form A product term or a sum of product terms Example: A AC A C AC CDE Example: Develop a truth table for X A AC 4 Observe that when a product term does not contain all variables, it corresponds to multiple s in the output column of the truth table. This is because the missing variable does not affect the product term and hence can be or. A C X Observe that when a product term contains all the variables, it corresponds to a unique in the output column of the truth table.
Nonstandard product term 5 Observe these! Standard SOP (Canonical Sum) Each product term contains all variables. Example: A AC AC AC AC is not a standard SOP expression. is a standard SOP expression. Minterm: A product term in a standard SOP expression. Example: AC AC AC contains 3 minterms A minterm is equal to for only one combination of variable values. A minterm corresponds to a unique in the output column of the truth table. A minterm corresponds to a unique row of the truth table. A canonical sum is a sum of minterms.
Remember these: SOP = Sum of products Standard SOP = Canonical sum Minterm = A product term in canonical sum 6
Domain Domain of an expression: Set of variables contained in the expression. Example: Domain of A AC is A,, C. So, a standard SOP expression is one in which all the variables in the domain appear in each product term in the expression. Alternative definition for a standard SOP expression. 7
Row Number of the Truth Table Row # A C X 2 3 4 5 6 7 Think of these as one unsigned binary number. The corresponding decimal value is the row #. 8
Minterm/Row Number & Truth Table Row # A C Minterm A C A C 2 A C 3 A C 4 A C 5 A C 6 A C 7 A C Summary: Each row of the truth table corresponds to. A combination of input (A,,C). 2. A row #. 3. A minterm. 9
2 inary Representation Example: Consider a canonical sum: = IFF (A,,C,D) = (,,,) ACD ACD (of minterm and of any oolean expression) ACD ACD A,, C, D 5,6 = IFF (A,,C,D) = (,,,) Row # 5 Row # 6 X ACD ACD This is called a minterm list A C D X It means the sum of minterms 5,6 with variable A,, C, D
Canonical Sum and Minterm List Example: Convert AC A into canonical sum. Hint : X X X Y Y Example: Convert AC A into a minterm list. X Y X Y Any logic function/expression can be expressed as a canonical sum (which is equivalent to a minterm list). 2
Truth Table oolean Expression (A Revisit!) Add all the minterms corresponding to a in the output column of the truth table. A C X X A C A C A C A C A C Alternatively, we may write X A,, C,3,4,6,7 22
Minimization (A Revisit!) The process that results in an expression containing the fewest possible terms with the fewest possible variables. We have done some minimization using oolean algebra. The expression can then be implemented with fewer logic gates. 23
Karnaugh Map A C C A CD C 3 2 2 3 4 5 7 6 24 A Row # A C 2 3 4 5 6 7 6 7 4 5 A 2 3 8 9 The small number inside each cell is the corresponding row number in the truth table, assuming that the truth table inputs are labeled alphabetically from left to right (e.g. A,, C) and the rows are numbered in binary counting order. D 5 4 Row # A C D 2 3 4 5 6 7 8 9 2 3 4 5
Karnaugh Map: asic Layout Similar to a truth table. Present all of the possible values of input variables and the resulting output for each value. Instead of being organized into columns and rows, it is an array of cells. The number of cells in a K-map, as well as the number of rows in a truth table, is equal to the total number of possible input variable combinations (which is the same as the total number of minterms). The cells are arranged in a way so that simplification of a given expression is simply a matter of properly grouping the cells. Used for simplifying oolean expressions to their minimum form. C C A C CD A 25 A A D
Example: Truth Table v.s. K-map Input Columns A C X X A AC A A C C Output Column 26 It can be difficult (especially for large K-map) to remember which cell in K-map corresponds to a particular row in the truth table. We also want to get the K-map directly from oolean expression without writing down truth table first.
The 2-variable Karnaugh Map (2x2 K-Map) Domain A, We will study K-maps for logic functions of 2, 3, and 4 variables Each row of the truth table corresponds to one minterm. Input Columns Each cell of the K-map corresponds to one minterm. 27 A X Minterm A A A A Output Column A Use these to find the corresponding minterm for each cell.
The 3-variable Karnaugh Map Domain A,, C 28
The 4-variable Karnaugh Map Domain A,, C, D 29
Mapping (Canonical Sum) Map the following expression on an appropriate Karnaugh map AC AC AC AC A C C ACD AC D ACD ACD AC D ACD AC D CD C A A A 3 D