Chapter 10 Combinational Circuits
Boolean Algebra and Logic Gates A circuit: a collection of devices that are physically connected by wires. The two basic types of circuits at Level LG1: Combinational Sequential.
Each line can carry a signal whose value is either 1 or 0. Figure 10.2 Each line can carry a signal whose value is either 1 or 0.
Combinational circuit The output depends only on the input i.e. if you put in abc = 101 today and get out xy = 01, then if you put in abc = 101 tomorrow you will get out xy = 01 again This behavior is not characteristic of a sequential circuit It may be possible for you to put abc = 101 into a sequential circuit and get out xy = 01 at one moment, but xy = 11 a few microseconds later
Methods to describe a combinational circuit Truth table Boolean algebraic expression Logic diagram
Truth table Lists the output for every combination of the input
Figure 10.3
Figure 10.4
Boolean algebra Three basic operations Binary OR + Binary AND • Unary Complement ´
Ten properties of boolean algebra Commutative Associative Distributive Identity Complement
Commutative
Associative
Distributive
Identity
Complement
Figure 10.5
Distributive
Complement
Associativity
Duality To obtain the dual expression Exchange + and •
Example In the distributive property x + (y · z) = (x + y) · (x + z) if you exchange the + and · operators, you get x · (y + z) = (x · y) + (x · z) which is the other distributive property. Each fundamental property of Boolean algebra has a corresponding dual property.
Idempotent property
Zero theorem
Absorption property
Consensus theorem
De Morgan’s law
Complement theorems
QUESTION Find complement of the following Boolean expression: F1 = x’yz’ + x’y’z
ANSWER F1 = x’yz’ + x’y’z The dual of F1 is (x’ + y + z’)(x’ + y’ + z) Complement each literal: F1’ = (x + y’ + z)(x + y + z’)
QUESTION Find complement of the following Boolean expression: F2 = x(y’z’ + yz)
ANSWER F2 = x(y’z’ + yz) The dual of F2 is x + (y’+z’) .(y+z)
Logic diagrams An interconnection of logic gates Closely resembles the hardware Gate symbol represents a group of transistors and other electronic components Lines connecting gate symbols represent wires
Figure 10.6
Figure 10.7
Figure 10.8
Figure 10.9
Figure 10.10
Set theory representation OR gate is set union AND gate is set intersection Inverter is set complement
Figure 10.11
Figure 10.12
Boolean expressions and logic diagrams AND gate corresponds to AND operation OR gate corresponds to OR operation Inverter corresponds to complement operation
QUESTION Draw the logic diagram for the expression a + b.c’
Figure 10.13 ANSWER
QUESTION Draw the logic diagram for the expression ((ab + bc’)a)’
Figure 10.14 ANSWER
Abbreviated logic diagrams Any signal can be duplicated by a junction of two wires The complement of any variable can be produced by an inverter
Abbreviated version of Figure 10.14
Figure 10.16
QUESTION What is the Boolean expression of output F(A,B,C) F(A,B,C)
ANSWER
Truth tables and boolean expressions Given a truth table, write a boolean expression without parentheses as an OR of several AND terms Each AND term corresponds to a 1 in the truth table
Figure 10.17
Figure 10.18
QUESTION Show the behavior of the following circuit with a truth table:
ANSWER
QUESTION Show the behavior of the following circuit with a truth table:
ANSWER
QUESTION Derive truth table for Boolean expression for a′bd′ + a′c′d′.
ANSWER
Two-level circuits gate delay: time it takes for the output of a gate to respond to a change in its input (~2ns) Any combinational circuit can be transformed into an AND-OR circuit or an OR-AND circuit with at most two gate delays (not counting the gate delay of any inverters) When you change a signal at the input of a gate, the output does not respond instantly. Instead, there is a time delay during which the signal works its way through the internal electronic components of the gate. The time it takes for the output of a gate to respond to a change in its input is called the gate delay.
AND- OR (Sum of Products - SOP) QUESTION Use Boolean logic rules to convert Boolean expression (a′bc ⊕ c + a + d)′ to AND-OR expression
ANSWER
Figure 10.19 AND- OR Expression We used Boolean algebra to write the expression for this circuit as an AND-OR expression: corresponding circuit: x = (a′bc ⊕ c + a + d)′ = a′bd′ + a′c′d′ Alternatively, you can make what amounts to a truth table for the expression two-level circuit because a change in the input requires only two gate delays to propagate to the output
Equivalent to circuit of Figure 10.17
Equivalent two level circuit Three level circuit Equivalent two level circuit
Question Convert following expression into AND-OR(sum of products SOP) expression (ac+b)(a+b’c)+ac
Answer Then make sure that every term contains each of a,ba,b, and cc by using the fact that x+x’=1:
Alternatively, you can use a truth table to derive the SOP (AND-OR) expression: ab’c abc’ abc
OR-AND (Product of Sums POS) x = (a + b′ + c′)(a′ + b′ + c):
two-level OR-AND circuit x = (a + b′ + c′)(a′ + b′ + c)
Question Convert following Boolean expression to OR-AND (POS) expression:
Answer STEP1: Use De Morgan’s laws to negate (invert) the original expression
STEP2: Now find the SoP form of this:
STEP3: negate (invert) last expression, to get PoS form You can use the truth table to get the PoS as well. This time you’ll use the rows in which the expression evaluates to 0
Using truth table: OR-AND (POS) term: a+b+c a+b+c’ a+b’+c a+b’+c’ https://www.allaboutcircuits.com/textbook/digital/chpt-8/minterm-maxterm-solution/ a’+b+c OR-AND (POS) term:
Question Convert thisexpression: x = a + b′c to OR-AND terms
Answer x = a + b'c first write its complement x’ x‘ = (a + b'c)' = a'(b'c)' = a'(b + c') = a'b + a'c’ (AND-OR) expression. Now use De Morgan’s law to write x as x = (x')' = (a'b + a'c')' = (a'b)'(a'c')' = (a + b')(a + c) (OR-AND) expression. It usually happens that a circuit with three or more levels requires fewer gates than the equivalent two-level circuit. Because a gate occupies physical space in an integrated circuit, the two-level circuit achieves its faster processing time at the expense of the extra space required for the additional gates.
Simplifying Expressions We use the following laws of Boolean algebra for simplifying expressions
QUESTION Simplify following Boolean expression to minimal number of terms: x + x’y
ANSWER X + X’Y = (X+X’)(X+Y) = (1).(X+ Y) = (X+Y)
QUESTION Simplify following Boolean expression to minimal number of terms: X(X’ + Y)
ANSWER X(X’+Y) =XX’ + XY =0 + XY = XY
QUESTION Simplify following Boolean expression to minimal number of terms/literals: XY + X’Z + YZ
ANSWER XY+X’Z+YZ = XY + X’Z + YZ(1) = XY + X’Z + YZ(X + X’) =XY + X’Z + XYZ + X’YZ = XY(1+Z) + X’Z (1+Y) = XY + X’Z
Canonical expressions A minterm(m) is a term in an AND-OR expression(product term) in which all input variables occur exactly once e.g. xy The four minterms for the two variables X and Y are X Y, X’Y, XY’, and X’Y’
QUESTION How many minterms are possible for n variables?
ANSWER 2n -1
A Boolean function can be constructed from a given truth table by forming the logical sum of all the minterms that produce a 1 in the function. This expression is called a sum of minterms(A CANONICAL EXPRESSION) .
Figure 10.25
QUESTION Express the Boolean function of following truth table as a sum of minterms:
ANSWER F = X’Y’Z’ + X’YZ’ + XY’Z + XYZ = m0 + m2 + m5 + m7 m0 m1 m2 m3
QUESTION Express the Boolean function F = A + B’C in sum of minterms
ANSWER A: B’C: F(A,B,C) = A + BC’ A = A(B+B’) = AB + AB’ = AB(C+C’) + AB’(C+C’) = ABC + ABC’ + AB’C + AB’C’ B’C: B’C = B’C(A+A’) = AB’C + A’B’C F(A,B,C) = A + BC’ = ABC + ABC’ + AB’C + AB’C’ + A’B’C = m7 + m6 + m5 + m4 + m1 = (1,4,5,6,7)
Another way .. F(A,B,C) = A + BC’ = ABC + ABC’ + AB’C + AB’C’ + A’B’C m0 m1 m2 m3 m4 m5 m6 m7 F(A,B,C) = A + BC’ = ABC + ABC’ + AB’C + AB’C’ + A’B’C = m7 + m6 + m5 + m4 + m1 = (1,4,5,6,7)
Maxterm(M) A sum term that contains all the variables in complemented or uncomplemented form possible to formulate 2n maxterms with n variables. Mj = mj’ and mj = Mj’ E.g. M3 = X+Y’+Z’ = (X’YZ)’ = m3’
Figure 10.25
QUESTION Express the Boolean function F = xy + x’z in a product of maxterm form.
ANSWER First, convert the function into OR terms using the distributive law: The function has 3 variables, x,y,z. Each OR term is missing one variable.So:
Combining all the terms we get:
Conversion Between Canonical Terms Consider the function expressed as a sum of minterms: Complement F’: F = (F’)’
Karnaugh maps Method for simplifying Boolean expressions A Karnaugh map is a truth table arranged so that adjacent cells represent adjacent minterms Two minterms are adjacent if the distance between them is one The distance between two minterms is the number of places in which they differ
We will consider maps for two, three, and four variables 2-variable map 3-variable map number of squares in each map is equal to the number of minterms m7 4-variable map
Figure 10.26
Two Variable Maps E.g. two variable function F(A,B): STEP1: enter the function(truth table, sum of minterms) into map E.g. two variable function F(A,B): F = A’ + AB F(A, B) = m(0, 1, 3)
STEP2: Identify rectangle of squares on the map for simplifying expression Goal: find the fewest such rectangles that cover all of the squares marked with 1s. Rectangles of 1s should be large as possible This will give the fewest product terms A’B’ + A’B = A’ A’B + AB = B
STEP4: determine if any of the rectangles is not needed to cover all of the 1s on the K-map. A rectangle can be deleted (not required) if all it’s are covered by the remaining rectangles. If there are choices as to which rectangle of two having unequal size to remove, the largest one should remain. Rectangle A’ needed to cover minterm 0 Rectangle B needed to cover minterm 3
+ F = A’ + B STEP4: read off the sum-of-products (AND-OR) expression A’B’ + A’B = A’ + F = A’ + B A’B + AB = B
QUESTION Simplify the expression G(A, B) = m(1, 2) using Karnaugh Maps
ANSWER G(A, B) = A’B + AB’
Three- Variable Maps
Figure 10.27
Figure 10.28
Figure 10.29
Decimal labels for the minterms Figure 10.30 Decimal labels for the minterms
Figure 10.31
Figure 10.32
Figure 10.33
QUESTION Simplify the Boolean function: F(A, B, C) = m(0, 1, 2, 3, 4, 5) Using Karnaugh Maps
ANSWER A’ F = A’ + B’ B’
QUESTION Simplify the Boolean function G(A, B, C) = m(0, 2, 4, 5, 6) Using Karnaugh maps
ANSWER AB’ C’ F = C’ + AB’
QUESTION Simplify the Boolean function H(A, B, C) = m(1, 3, 4, 5, 6) Using Karnaugh maps
One of Rectangle (1, 5) or (5, 4) can be deleted ANSWER One of Rectangle (1, 5) or (5, 4) can be deleted A’C AC’ F = A’C + AB’ + AC’ AB’ deleted
Four-Variable Map Simplification
Figure 10.34
Figure 10.35
Figure 10.36
Figure 10.37
Another correct minimization of Figure 10.37
QUESTION Simplify the Boolean function F(A, B, C, D) = m(0, 1, 2, 4, 5, 6, 8, 9, 10, 12, 13) Using Karnaugh maps
ANSWER B’D’ F = A’D’ + B’D’ + C’ A’D’ C’
QUESTION Simplify the Boolean function G(A, B, C, D) = A’C’D’ + A’D + B’C + C D + AB’D’ Using Karnaugh maps
G(A, B, C, D) = A’C’D’ + A’D + B’C + C D + AB’D’ ANSWER G(A, B, C, D) = A’C’D’ + A’D + B’C + C D + AB’D’ A’D A’C’D’ B’C CD B’D’ A’C’ restructure G = B’D’ + A’C’ + CD CD AB’D’
Dual Karnaugh maps To minimize a function in an OR-AND expression minimize the complement of the function in the AND-OR expression Use x = (x´)´ and De Morgan’s law
Figure 10.29(c) Figure 10.39
Don’t Care Conditions The minterms of a Boolean function specify all combinations of variable values for which the function is equal to 1. The function is assumed to be equal to 0 for the rest of the minterms. This assumption, however, is not always valid, since there are applications in which the function is not specified for certain variable value combinations.
There are two cases in which this occurs: input combinations never occur. E.g. 4-bit binary code for the decimal digits has six combinations that are not used and not expected to occur. input combinations are expected to occur, but we do not care what the outputs are In both cases, the outputs are said to be unspecified for the input combinations.
Don’t-care conditions A don’t care condition is shown as an X in a Karnaugh map In choosing adjacent squares to simplify the function in a map, the don’t-care minterms may be used.
EXAMPLE incompletely specified function F F has three don’t-care minterms d
Figure 10.40
NAND – Not AND NOR -Not OR E.g. (abc)′ De Morgan’s law states that (abc)′ = a′ + b′ + c′ (OR of inverted input) NOR -Not OR E.g. (a + b + c)’ = a’b’c’ (AND of inverted inputs)
Figure 10.21
you replace an arbitrary AND-OR circuit entirely with NAND gates
QUESTION Convert the following AND-OR circuit to all NAND gate circuit (NAND-NAND circuit)
Figure 10.22 abc + def = ((abc + def)’)’ =((abc)’.(def)’)’ Last nand gate in (b) Drawn as inverted input OR
Similarly you can create a NOT gate from NOR gate: Figure 10.23 you can construct an inverter from a NAND gate by connecting the NAND inputs together Similarly you can create a NOT gate from NOR gate:
NAND gates Conceptually, you can construct any combinational circuit from only NAND gates. Furthermore, NAND gates are usually easier to manufacture than either AND or OR gates. Consequently, the NAND gate is by far the most common gate found in integrated circuits.
AND, OR and NOT Gates from NAND
Two graphic symbols for NAND Gate
NAND-NAND circuit from a Boolean expression
Example F = A + (B’ + C)(D’ + BE) AND-OR NAND with two graphic symbols NAND with one graphic symbols
Another Example F = (CD + E)(A+B’) Introduce bubbles Matching bubbles Introduce bubbles to make AND a NAND and OR an NAND
NOR gates The same reasoning that applies to NAND circuits also applies to NOR circuits. Any combinational circuit can be written as a two- level OR-AND circuit, which can be written as NOR-NOR. You can conceptually construct any combinational circuit with only NOR gates.
NOT, OR and AND Gates from NOR
Two graphic symbols for NOR Gate
Figure 10.24
Example
Combinational Devices combinational devices that are commonly used in computer design
Enable lines An enable line to a combinational device turns the device on or off If enable = 0 : the output is 0 regardless of any other inputs If enable = 1: the device performs its function with the output depending on the other inputs
Figure 10.41 Enable Gate An AND gate can implement the enable property
Selective Inverter Gate For input, it has a data line and an invert line. If the invert line is 1: the output is the complement of the data line. If the invert line is 0: the data passes through to the output unchanged.
selective inverter is an XOR gate Figure 10.42 selective inverter is an XOR gate
Multiplexer A multiplexer selects one of several data inputs to be routed to a single data output Control lines determine the particular data input to be passed through
2–to–1-line multiplexer two information inputs, I0 and I1, and a single select input S S = 0 output= I0 S = 1 output= I1
4-to-1-line multiplexer Y depends on four inputs I0, I1, I2, and I3 and two select inputs S1 and S0
The eight-input multiplexer Figure 10.43 The eight-input multiplexer 2n input lines and n selection inputs
Figure 10.44
Binary decoder A decoder takes a binary number as input and sets one of the data output lines to 1 and the rest to 0 The data line that is set to 1 depends on the value of the binary number that is input An n-bit binary code can represent up to 2n distinct elements of coded information
The 1 x 2 binary decoder
Figure 10.45 The 2 x 4 binary decoder
A 2 x 4 binary decoder with enable Figure 10.47 A 2 x 4 binary decoder with enable
QUESTION Design a BCD–to–Seven-Segment Decoder: electronic products as alarm clocks often use light-emitting diodes (LEDs). Each digit is formed from seven LED segments. A BCD(Bianry Coded Decimal)–to–seven-segment decoder accepts a decimal digit in BCD and generates the appropriate outputs for the segments of the display for that decimal digit. The seven outputs of the decoder (a, b, c, d, e, f, g)
ANSWER
Demultiplexer A demultiplexer routes a single input value to one of several output lines Control lines determine the data output line to which the input gets routed
The four-output demultiplexer Figure 10.48 The four-output demultiplexer
Half adder The half adder adds the right-most two bits of a binary number Inputs: The two bits Outputs: The sum bit and the carry bit
Figure 10.49 The half adder
Full adder The full adder adds one column of a binary number Inputs: The two bits for that column and the carry bit from the previous column Outputs: The sum bit and the carry bit for the next column
Figure 10.50 The full adder
Sum Cout Sum = A’B’Cin + A’BCin’ + AB’Cin’ + ABCin = A B Cin Cout = AB + ACin + Bcin
Figure 10.51 If either the first or second half adder has a carry, the full adder has a carry out.
Ripple-carry adder The ripple-carry adder adds two n-bit binary numbers The full adders are connected in cascade, with the carry output from one full adder connected to the carry input of the next full adder. Inputs: The two n-bit binary numbers to be added Outputs: The n-bit sum, the C bit for the carry out, and the V bit for signed integer overflow
Figure 10.52
Q. Design a Gray code–to–BCD code converter that gives output code 1111 for all invalid input combinations. Assume that the Gray code sequence for decimal numbers 0 through 9 is 0000, 0001, 0011, 0010, 0110, 0111, 0101, 0100, 1100, and 1101. All other input combinations should be considered to be invalid Answer: Q. Design a circuit with a 4-bit BCD input A, B, C, D that produces an output W, X, Y, Z that is equal to the input + 3 in binary. For example, 9 (1001) + 3 (0011) = 12 (1100). The outputs for invalid BCD codes are don’t-cares. Answer:
References Logic & Computer Design Fundamentals, 5th Edition, By M. Morris R. Mano, Charles R. Kime, Tom Martin Computer System Architecture, 3rd Edition, By M. Morris R. Mano