770 likes | 883 Views
L O G I C C I R C U I T. G oal. 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.
E N D
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 DesignExample 1 Find the Boolean expressions output of the following circuit: Answer: (x+y)y
___ _ _ Logic Circuit DesignExample 2 Find the Boolean expressions output of the following circuit: Answer: xy
x+y x Logic Circuit DesignExample 3 Draw the circuits for the following Boolean algebraic expressions: x+y __
(x+y)x (x+y)x x+y Logic Circuit DesignExample 4 Draw the circuits for the following Boolean algebraic expressions: x+y
A AND AND B Y OR NOT C A B C Y 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 Circuit-to-Truth Table Example 2# ofInputs = # of Combinations 2 3 = 8
A A B A AND AND B Y = A B + A C OR } NOT } C A C A B C Y 0 0 0 0 0 0 0 1 1 0 1 0 0 0 1 1 1 1 0 0 0 1 0 1 0 1 1 0 1 1 1 1 1 Circuit-to-Truth Table Example
LAWS OFBOOLEANALGEBRA • 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 • X + 0 = X • X . 1 = X • X + 1 = 1 • X . 0 = 0 • X + X = X • 6. X . X = X • 7. X + X = 1 • X . X = 0 • 9. X = X
Commutative Associative
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:
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 + X’Z = 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
CircuitMinimization • 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 mj, where j is the decimal equivalent of the minterm’s corresponding binary combination (bj). • A variable in mj is complemented if its value in bj is 0, otherwise is uncomplemented. • Example: Assume 3 variables (A,B,C), and j=3. Then, bj= 011 and its corresponding minterm is denoted by mj = A’BC
Maxterm • Represents exactly one combination in the truth table. • Denoted by Mj, where j is the decimal equivalent of the maxterm’s corresponding binary combination (bj). • A variable in Mj is complemented if its value in bj is 1, otherwise is uncomplemented. • Example: Assume 3 variables (A,B,C), and j=3. Then, bj= 011 and its corresponding maxterm is denoted by Mj = 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)
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)
Canonical Form (Unique) • Any Boolean function F( ) can be expressed as a uniquesum 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 mj such that F( ) = 1 in row j of the truth table for F( ). • Canonical Product-Of-Sums:The maxterms included are those Mj such that F( ) = 0 in row j of the truth table for F( ).
Example: • Truth table for f1(a,b,c) at right • The canonical sum-of-products form for f1 is:f1(a,b,c) = m1 + m2 + m4 + m6 = a’b’c + a’bc’ + ab’c’ + abc’ • The canonical product-of-sums form for f1 is:f1(a,b,c) = M0 • M3 • M5 • M7 = (a+b+c)•(a+b’+c’)• (a’+b+c’)•(a’+b’+c’). • Observe that: mj = Mj’
Notation: ∑ and ∏ • f1(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 m1, m2, m4, and m6. • f1(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 M0, M3, M5, and M7. • Since mj = Mj’ for any j, ∑m(1,2,4,6) = ∏M(0,3,5,7) = f1(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: f1(a,b,c) = a’b’c + a’bc’ + ab’c’ + abc’ = m1 + m2 + m4 + m6= ∑(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: f1(a,b,c) = a’b’c + bc’ + ac’is a standard sum-of-products form • f1(a,b,c) = (a+b+c)•(b’+c’)•(a’+c’)is a standard product-of-sums form.