Variables and Functions
Variables and Functions
Figure 1
L (x) = x
This logic expression describes the output L as
Figure 2
a function of the input x.
Switches in series
Figure 3
Determine the logic function for the circuit shown in Figure 4
INVERSION
We want a circuit that will turn the light on when the switch is open. The logic function for
this circuit will be
TRUTH TABLES
The AND, OR and complement functions can be represented in the form of a table called a
truth table. The truth table lists all possible combinations of inputs and outputs for the logic
function.
Timing Diagrams
The changes in the input variables cause changes in the output variables. These changes can
also be represented by a timing diagram. Consider the circuit shown
Figure 7
Write the logic function for the output and derive the truth table.
The timing diagram for the circuit is shown below.
Since Figure 7 will give the logic expression f(x, y) = x’ + xy and Figure 9 gives g(x, y) = x’ + y,
there must be some rules to show that x’ + xy = x’ + y.
These rules will allow for algebraic manipulation of the functions to show equivalency.
Boolean Algebra
In the late 1930s Claude Shannon showed that Boolean algebra provides an effective
means of describing circuits built with switches. The algebra can, therefore, be used to
describe logic circuits.
Again, we can prove the validity of these properties either by perfect induction or by
performing algebraic manipulation. The truth table below illustrates how perfect induction
can be used to prove DeMorgan’s theorem. The evaluation of the left-hand and right-hand
sides of the identity in 15a gives the same result.
Example
Let us prove the validity of the logic equation (x + z) · (x’ + z’) = x . z’ + x’ · z
The left-hand side can be manipulated as follows. Using the distributive property, 12a,
gives
LHS = x . x’ + z . x’+ x . z’ + z . z’ and from theorem 8, x . x’ and z . z’ are both zero, then the
LHS = 0 + z . x’ + x . z’ + 0 , and using theorem 6b gives LHS = z . x’ + x . z’
Using the commutative property 10a and 10b this becomes
LHS= x . z’ + x’ . z = RHS.
Question
Prove the equivalency of the logic equation
x · z’ + y’ · z’ + x · z + y’ · z = x’ · y’ + x . y + x · y’
Precedence of operations
Brackets must be done first, then NOT, AND and then OR.
Then a procedure for designing a logic circuit that implements the truth table is to create a
product term that has a value of 1 for each valuation for which the output function
f has to be 1. Then we can take a logical sum of these product terms to realize f .
Any function f can be represented by a sum of minterms that correspond to the rows
in the truth table for which f = 1. The resulting implementation is functionally correct and
unique, but it is not necessarily the lowest-cost implementation of f . A logic expression
consisting of product (AND) terms that are summed (ORed) is said to be of the sum-of
products (SOP) form. If each product term is a minterm, then the expression is called a
canonical sum-of-products for the function f .
A function can be expressed as a sum of minterms as follows
Question.
Given the following truth table, derive the canonical sum of products for the output f. Hence
derive the logic circuit. Is this the minimal cost circuit, if not derive the minimal cost circuit.
Maxterms
The principle of duality suggests that if it is possible to synthesize a function f by
considering the rows in the truth table for which f = 1, then it should also be possible to
synthesize f by considering the rows for which f = 0. This alternative approach uses the
complements of minterms, which are called maxterms. All possible maxterms for three
variable functions are listed in the truth table of Figure 11.
If a given function f is specified by a truth table, then its complement f’ can be represented
by a sum of minterms for which f’ = 1 which are the rows for f = 0.
F(x, y, z) = (0, 2, 4, 5)
Question
1. A class room has three doors with a switch near each door that controls the lights in the
room. The circuit operates as follows: the lights can be turned on or off by changing
the state of any one of the switches. Design the logic circuit to implement the
operation.
2. A circuit has three inputs: x, y and z. Assume that the output of the circuit will be the
same as the value of input x if z = 0, and it will be the same as y if z = 1. implement the
circuit.
Note that this circuit is a multiplexer.
3. For the timing diagram shown, synthesize the function f (x1, x2, x3) in the simplest sum-
of-products form.
4. For the Boolean function
F = xy’z + x’y’z + w’xy + wx’y + wxy
(a) Obtain the truth table of F.
(b) Draw the logic diagram, using the original Boolean expression.
(c) Use Boolean algebra to simplify the function to a minimum number of literals.
(d) Obtain the truth table of the function from the simplified expression and show
that it is the same as the one in part (a).
(e) Draw the logic diagram from the simplified expression, and compare the total
number of gates with the diagram of part (b).
Answers
1) Dual : (A+B+C)(A’+B)(A+B’C)(A’+B+C’)
Complement: (A’+B’+C’)(A+B’)(A’+BC’)(A+B’+C)
2) Dual : (x+w’+y’z’)(x+y’+z(x’+y+z))
Complement: (x’+w+yz)(x’+y+z’(x+y’+z’))