0% found this document useful (0 votes)
2 views

Variables and Functions

The document discusses digital systems, focusing on variables, functions, logic gates, and circuit design. It explains concepts such as truth tables, Boolean algebra, and the synthesis of logic circuits using AND, OR, and NOT operations. Additionally, it covers the representation of functions in sum-of-products and product-of-sums forms, as well as examples and exercises related to these topics.

Uploaded by

shivani.ragbir20
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Variables and Functions

The document discusses digital systems, focusing on variables, functions, logic gates, and circuit design. It explains concepts such as truth tables, Boolean algebra, and the synthesis of logic circuits using AND, OR, and NOT operations. Additionally, it covers the representation of functions in sum-of-products and product-of-sums forms, as well as examples and exercises related to these topics.

Uploaded by

shivani.ragbir20
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 28

Digital Systems

Variables and Functions


A simple switch has two states: open and close as shown in Fig. 1

Figure 1

Connection to a circuit When x = 0 light (L) = off


When x = 1 light (L) = on
OR
If x = 0 L = 0 and
If x = 1 L = 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.

Two input AND OR and Complement functions

The three-input truth table has 8


different input combinations. A four
input table will have 16 different input
combinations. In general, an n-input
table will have 2n different input
combinations (rows).
Logic Gate Symbols

Figure 6 Basic gates


Draw the logic circuit for the function
f(x, y, z) = (x + y) . z

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.

Figure 8 Timing diagram


Functionally Equivalent Circuits
Consider the circuit in Figure 9. Write the logic expression for the output g.

Figure 9 Equivalent circuit to Figure 7

Now derive the truth table for the circuit.


The truth table is identical to that derived for Figure 7. hence the two circuits are functionally
equivalent. That is both circuits give the same outputs for the same input combination.
Therefore it is prudent to use the simpler one which will be less costly to implement.

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.

Synthesis of Logic Circuits using AND, OR and NOT


The process whereby we begin with a description of the desired functional behavior
and then generate a circuit that realizes this behavior is called synthesis.
Suppose that we wish to design a logic circuit with two inputs, x and y. Assume that x and y
represent the states of two switches, either of which may be open (0) or closed (1).
The required functional behavior of this circuit is that the output must be equal to 0 if the
switch x is closed and y is open; otherwise, the output must be 1.

The first step in the design is to derive the truth table.

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 .

The first row gives x’ . y’ =1 , the 2nd gives x’ .y =1 the 3rd


gives x . y’ = 0 and the 4th gives x . y = 1. Taking the terms that
give 1 to realize the output function gives
F (x, y) = x’y’ + x’y +xy = x’(y’+y) + xy
= x’ + xy and by Theorem 16a
= x’ + y
The logic network that corresponds to this expression is called a canonical sum of products
network and is shown in Figure 10 a. This network may not necessarily be the least cost
solution. Figure 10 b shows the least cost network. Prove their equivalency using Boolean
Algebra.

Figure 10 Two realizations of the same function


Sum-of-Products and Product-of-Sums Forms
If a function f is specified in the form of a truth table, then an expression that realizes
f can be obtained by considering either the rows in the table for which f = 1, as we have
already done, or by considering the rows for which f = 0, as we will do shortly.
For a function of n variables, a product term in which each of the n variables appears
once is called a minterm. The variables may appear in a minterm either in uncomplemented
or complemented form. The truth table in Figure 11 shows all the minterms for a three-
variable table.
A function f can be represented by an expression that is a sum of minterms, where each
minterm is ANDed with the value of f for the corresponding valuation of input variables. For
example the function for Figure 10a can be represented as the sum of the minterms for
rows 0, 1 and 3 of the truth table.

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.

Product of Sums form


Consider the truth table shown for the circuit of Figure 10. The complement of f is
f’(x, y) = m2 = xy’
Using de Morgan’s theorem to complement the expression we get
f’’(x, y) = f (x, y) = (xy’)’ = x’ + y .
This result was obtained earlier. We can summarize
A logic expression consisting of sum (OR) terms that are the factors of a logical product
(AND) is said to be of the product-of-sums (POS) form. If each sum term is a maxterm,
then the expression is called a canonical product-of-sums for the given function.
Any function f can also be synthesized by finding its canonical product-of-sums. This
involves taking the maxterm for each row in the truth table for which f = 0 and forming a
product of these maxterms.
Example
Express the Boolean function F = A + B’C as a sum of minterms. The function has three
variables: A, B, and C. The first term A is missing two variables; therefore,
A = A(B + B‘) = AB + AB‘
This function is still missing one variable, so
A = AB(C + C‘) + AB‘(C + C‘) = ABC + ABC’ + AB’C + AB’C’
The second term B’C is missing one variable; hence,
B’C = B’C(A + A’) = AB’C + A’B’C
Combining all terms, we have
F = A + B’C = ABC + ABC’ + AB’C + AB’C’ + AB’C + A’B’C
But AB’C appears twice, and according to theorem 1 (x + x = x), it is possible to remove one
of those occurrences. Rearranging the minterms in ascending order, we finally obtain

F = A’B’C + AB’C’ + AB’C + ABC ‘ + ABC = m1 + m4 + m5 + m6 + m7 =  (1, 4, 5. 6, 7)


Example
Express the Boolean function F = xy + x’z as a product of maxterms.
First add the missing terms to get
F = xy(z+z) +xz(y+y) = xyz + xyz + xyz + xyz
From the principle of duality m = M that is the inverse of the SOP is the POS.
The above expression is in the SOP form, therefore get the dual of F = F
F = (x+ y + z) . (x + y + z) . (x + y +z) . (x + y + z)
This expression is now in the POS or Maxterm form.
Therefore F = (M7. M6 . M3 . M1)
Hence F = (M5 . M4 . M2 . M0)

A convenient way to express this function is as follows:

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).

5. Generate the dual and the complement of the following functions:


i) ABC + A′B + A(B′ +C) + A′BC′
ii) xω′(y′ +z′)+ xy′(z +x′yz)
iii) Construct truth tables for the above functions

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’))

6. Express the Boolean function F = A + BC’ as a sum of minterms.

You might also like