Uchechukwu Ofoegbu Chapter 2: Combinational Systems Temple University Adapted from Alan Marcovitz s Introduction to Logic and Computer Design
Riddle Four switches can be turned on or off. One is the switch for the incandescent overhead light in the next room, which is initially off, but you don't know which. The other three switches do nothing. From the room with the switches in it, you can't see whether the light in the next room is turned on or off. You may flip the switches as often and as many times as you like, but once you enter the next room to check on the light, you must be able to say which switch controls the light without flipping the switches any further. (And you can't open the door without entering, either!) How can you determine which switch controls the light?
Design Process for Combinational Systems Begins with a verbal description of the intended system, known as the PROBLEM STATEMENT A block diagram of the system should be developed The desired objectives and constraints
Illustrations 1. A system with four inputs, A, B, C, and D, and one output, Z, such that Z = 1 iff three of the inputs are 1. 2. A single light (that can be on or off) that can be controlled by any one of three switches. One switch is the master on/off switch. If it is off, the lights are off. When the master switch is on, a change in the position of one of the other switches (from up to down or from down to up) will cause the light to change state. 3. A system to do 1 bit of binary addition. It has three inputs (the 2 bits to be added plus the carry from the next lower order bit) and produces two outputs, a sum bit and a carry to the next higher order position.
Illustrations 4. A system that has as its input the code for a decimal digit, and produces as its output the signals to drive a sevensegment display, such as those on most digital watches and numeric displays. 5. A system with nine inputs, representing two 4-bit binary numbers and a carry input, and one 5-bit output, representing the sum. (Each input number can range from 0 to 15; the output can range from 0 to 31.)
Design Steps 1. Represent each of the inputs and output in binary. This is sometimes taken care of in the problem statement (ex 1, 3, 5) 2. Formalize the design specification either in the form of a truth table or of an algebraic expression. There are 2 n input combinations for n inputs in a truth table. Truth tables are written in binary order to avoid omissions. If necessary, break the problem into smaller subproblems before or after creating the truth tables.
Design Steps 3. Simplify the description. Most times expressions have to be converted to algebraic forms Several techniques exist for reducing complexity of algebraic forms 4. Implement the system with the available components, subject to the design objectives and constraints. Gates are the most common components A gate is a network with one output The less number of gates required, the more desirable the system is, since each signal passing through a gate introduces a delay in the system. More complex systems can be used in addition to gates (ex. Adders, decoders, e.t.c.).
Don t t Care Conditions Don t cares occur when The output is not specified for all input combinations, so for the remaining input combinations, it doesn t matter There are input combinations that don t occur in the system Flip-flops one systems drives another When we just don t care Don t cares are represented by X in a truth table. The output of the combination could either be a 1 or a 0.
Developing Truth Tables 1. A system with four inputs, A, B, C, and D, and one output, Z, such that Z = 1 iff three of the inputs are 1.
2. A single light (that can be on or off) that can be controlled by any one of three switches. One switch is the master on/off switch. If it is off, the lights are off. When the master switch is on, a change in the position of one of the other switches (from up to down or from down to up) will cause the light to change state.
4. A system that has as its input the code for a decimal digit, and produces as its output the signals to drive a seven-segment display
Switching Algebra 3. Simplify the description. Most times expressions have to be converted to algebraic forms Several techniques exist for reducing complexity of algebraic forms 4. Implement the system with the available components, subject to the design objectives and constraints. Gates are the most common components A gate is a network with one output The less number of gates required, the more desirable the system is, since each signal passing through a gate introduces a delay in the system. More complex systems can be used in addition to gates (ex. Adders, decoders, e.t.c.).
Switching Algebra Basic Digital logic is based on 3 primary functions (the basic gates): AND OR NOT
The AND function: The AND function If all the inputs are high is the output is high If any input is low, the output is low If this input AND this input are high, the output is high
AND Logic Symbol Inputs Output If both inputs are 1, the output is 1 If any input is 0, the output is 0
AND Logic Symbol Inputs 0 0 0 Output Determine the output
AND Logic Symbol Inputs 0 1 0 Output Determine the output
AND Logic Symbol Inputs 1 1 1 Output Determine the output
AND Truth Table To help understand the function of a digital device, a Truth Table is used: Every possible input combination Input Output 0 0 0 0 1 0 1 0 0 1 1 1 AND Function
AND Gates It is possible to have AND gates with more than 2 inputs. The same logic rules apply if any input
The OR function: The OR function if any input is high, the output is high if all inputs are low, the output is low If this input OR this input is high, the output is high
OR Logic Symbol Inputs Output If any input is 1, the output is 1 If all inputs are 0, the output is 0
OR Logic Symbol Inputs 0 0 0 Output Determine the output
OR Logic Symbol Inputs 0 1 Output 1 Determine the output
OR Logic Symbol Inputs 1 1 Output 1 Determine the output
Truth Table Input Output 0 0 0 0 1 1 1 0 1 1 1 1 OR Truth Table OR Function
The NOT function: The NOT function If any input is high, the output is low If any input is low, the output is high The output is the opposite state of the input The NOT function is often called INVERTER
NOT Logic Symbol Input Output If the input is 1, the output is 0 If the input is 0, the output is 1
NOT Logic Symbol Input 0 1 Output Determine the output
NOT Logic Symbol Input 1 0 Output Determine the output
Summary OR (written as +)1 a + b (read a OR b) is 1 if and only if a = 1 or b = 1 or both AND (written as or simply two variables catenated) a b = ab (read a AND b) is 1 if and only if a = 1 and b = 1. NOT (written ) a (read NOT a) is 1 if and only if a = 0
Literal: The appearance of a variable or its complement. Product Term: one or more literals connected by AND operators. Definitions Standard product term: Also called minterm product term that includes each variable of the problem, either uncomplemented or complemented. Sum of products expression (often abbreviated SOP) one or more product terms connected by OR operators. A canonical sum or sum of standard product terms: a sum of products expression where all of the terms are standard product terms.
A Minimum Sum of Products expression: one of those SOP expressions for a function that has the fewest number of product terms. If there is more than one expression with the fewest number of terms, then minimum is defined as one or more of those expressions with the fewest number of literals. (1) x yz + x yz + xy z + xy z + xyz 5 terms, 15 literals (2) x y + xy + xyz 3 terms, 7 literals (3) x y + xy + xz 3 terms, 6 literals (4) x y + xy + yz 3 terms, 6 literals Definitions
Simplification x yz + x yz + xy z + xy z + xyz 5 terms, 15 literals = (x yz +x yz)+(xy z + xy z) + xyz associative = x y(z+z ) + xy (z+z ) + xyz distributive = x y.1 +xy.1 +xyz = x y + xy + xyz adjacency complement = x y + xy + xz identity Down to three terms and seven literals
x yz + x yz + xy z + xy z + xyz + xy z 5 terms, 15 literals = (x yz +x yz)+(xy z + xy z) + (xyz + xy z) associative = x y + xy + xz adjacency Simplification Reduce the number of literals by adding a second copy of xy z (or x yz), based on P6a indempotency. Down to three terms and six literals
Definitions Sum Term: one or more literals connected by OR operators. Standard sum term: also called a maxterm a sum term that includes each variable of the problem, either uncomplemented or complemented. Product of sums expression (POS): one or more sum terms connected by AND operators. Canonical product or product of standard sum terms: a product of sums expression where all of the terms are standard sum terms. SOP: x y + xy + xyz POS: (x + y )(x + y)(x + z ) both: x + y + z or xyz neither: x(w + yz) or z + wx y + v(xz + w )
Simplification of Functions in Maxterm Form g = (w + x + y) (w + x + y + z ) = x + y + w (w + z ) distributive (P8b) = x + y + w z simplification (p10b) = (x + y + w ) (x + y + z ) distributive (P8b)
Implementation of Logic Gates f = x y + xy + xz Minimum sum of product implementation of f. Circuit with only uncomplemented inputs.
P11a. (a+b) = a b P11b. (ab) = a +b Pleas note: (a +b )!= a +b (ab)!= a b De Morgan s s Theorem Table 2.8 Proof of DeMorgan s theorem.
1 2a 3a 5a, b 8a, d 10c 12a In groups
From the truth table to Algebraic Expressions f = a b + ab + ab
From the truth table to Algebraic Expressions
Example Input f f 000 0 1 001 1 0 010 1 0 011 1 0 100 0 1 101 0 1 110 1 0 111 1 0 f(a,b,c) ) = Σm(1,2,3,6,7) =? f (A,B,C) ) =?
Don t t Cares Input f 000 0 001 X 010 1 011 1 100 0 101 X 110 1 111 1 f(a,b,c) ) = Σm(2,3,6,7)+ Σd(1,5)
NAND gates. Alternate symbol for NAND. Symbols for NOR gate.
Many electronic systems automatically invert gates Only one gate required instead of two Why NAND, NOR
NAND Gate Implementation When we have a circuit consisting of AND and OR gates such that 1. the output of the circuit comes from an OR, 2. the inputs to all OR gates come either from a system input or from the output of an AND, and 3. the inputs to all AND gates come either from a system input or from the output of an OR. All gates are replaced by NAND gates, and any input coming directly into an OR is complemented.
Example Try: g = wx(y+z)+x y
NOR Gate Implementation When we have a circuit consisting of AND and OR gates such that 1. the output of the circuit comes from an AND, 2. the inputs to all OR gates come either from a system input or from the output of an AND, and 3. the inputs to all AND gates come either from a system input or from the output of an OR. All gates are replaced by NOR gates, and any input coming directly into an AND is complemented.
Example Try: g = (x+y )(x +y)(x +z)
A xor B is 1 if a = 1 or b is 1 and 0 if both are 1 or 0; XOR and XNOR Develop a truth table for XOR
13 14 17 c, f 18 b,d 19c 20 a,b In groups