Sie sind auf Seite 1von 35

Basics of Digital

Systems
Boolean algebra
Truth tables
Karnaugh maps
Boolean Algebra
In digital systems we deal with the binary number system. This
means that the value of an element can be either 0 or 1.
The elements can also be referred to as false or true for 0 or 1
respectively.
There are three operators in Boolean algebra:
AND
OR
NOT
Boolean Algebra: AND
The AND operator is by a dot between the two elements or
nothing between the two elements at all. It is also know as
the product of elements.
xy or xy
The AND operator requires that all elements have a value 1 (or
true) for the result to be 1 (or true). Thus if we had two
elements x, y, both x AND y need to be 1 for the result to be
one.
x y xy
0 0 0
0 1 0
1 0 0
1 1 1
Boolean Algebra: OR
The OR operator is represented the same as addition in
regular algebra, with a plus sign. It is also known as the sum of
elements.
x+y
The OR operator requires that either of the two elements be 1
for the result to be 1. So if we had two element x, y, then x OR
y has to have a value of 1 for the result to have a value of 1.

x y x+y
0 0 0
0 1 1
1 0 1
1 1 1
Boolean Algebra: NOT
The NOT operator is represented with an apostrophe after the
element. It is also known as the complement of an element.
x
The NOT operator give the opposite of the elements value as
the result. So for an element x with a value of 1, the NOT of x
is equal to 0.

x x
0 1
1 0
Boolean Algebra: Properties
Boolean algebra is governed by several key properties.
Commutative
x+y=y+x xy=yx
Associative
x + (y + z) = (x + y) + z x (y z) = (x y) z
Distributive
x (y + z) = x y + x z x + y z = (x +y)(x + z)
Absorption
x+xy=x x (x + y) = x
Involution
(x) = x
DeMorgan
(x + y) = xy (x y) = x + y
Boolean Algebra: Properties
Using the previous properties and the knowledge of the
different operators, we can find a few more important
properties of Boolean algebra.

x+0=x x1=x

x + x = 1 x x = 0

x+x=x xx=x

x+1=1 x0=0
Boolean Algebra: Simplifying
Using the properties we can simplify Boolean expressions. For
example lets simplify the following expression.
F = xyz + xy z + x y
First we can see the use of the distributive property. We can
apply is to simplify the expression to:
F = xz (y + y) + x y
Next we can apply one of our derived properties. (x + x) = 1.
This gives us a final simplification of:
F = xz + x y

This simplification process can be much easier through the use


of Truth Tables and Karnaugh Maps.
Minterms and Maxterms
In addition to simplifying a boolean expression we can also
expand them. There are two ways of expanding a boolean
expression: a sum of minterms or a product of maxterms.
The minterms are the products of each of the elements in the
expression in every combination (the elemnts can be
complmented or not. Ex. x yz). Each minterm has a
designation starting with m0.
The maxterms are the sums of each of the elements in the
expression in every expression (the elements can be
complements or not. Ex. x + y + z). Each maxterm has a
designation starting with M0.
Minterms and Maxterms cont.
The minterms and maxterms for an expression with 3
elements are as follows.

Minterms Maxterms
Term Designation Term Designation
xyz m0 x+y+z M0
xyz m1 x + y + z M1
xy z m2 x + y + z M2
xy z m3 x + y + z M3
x yz m4 x + y + z M4
z yz m5 x + y + z M5
x y z m6 x + y + z M6
xyz m7 x + y + z M7
Minterms and Maxterms
Example
If we look at the simplified version of the previous example we
can expand it to a sum of minterms or a product of maxterm.
F = xz + x y
To have a sum of minterms, we need to make each term have
all three element (x, y and z). We know that,
(xz)(1) = xz
And we know that,
(y + y) = 1
So we can add the y element into that term.
xz = xz(y + y)
Minterms and Maxterms:
Example cont.
We can multiply the term out to get:
xz = xy z + xyz
By using this same method we can expand the second term.
x y = x yz + x yz
So we find that,
F = xz + x y = xy z + xyz + x yz + x yz
We can express this as a sum of minterm designations.
F = m1 + m3 + m4 + m5
Minterms and Maxterms:
Example cont.
Now we will expand our function to a product of maxterms.
F = xz + x y
This is easiest to do by taking the complement of the sum of
minterms.
F = (m1 + m3 + m4 + m5)
F = m1 m3 m4 m5
F = (xyz) (xyz) (x yz) (x yz)
F = (x + y + z)(x + y + z)(x + y + z)(x + y + z)
F = M1 M3 M4 M5
We now have our two expansions of our function. As a sum of
minterms and as a product of maxterms.
Truth Tables
A truth tables is a method of setting up and testing a boolean
expression for every possible input. The truth table is set up
with a column for each different element in the expression
and an additional column for the fuction its self. For example:

F = x + yz

x y z F
Truth Tables cont.
We then want to fill in the columns with our elements x, y and
z to allow for every possible combination of inputs. As you
may notice, each row corresponds to one minterm starting
with m0 and ending with m7.
x y z F
0 0 0
0 0 1
0 1 0
0 1 1
1 0 0
1 0 1
1 1 0
1 1 1
Truth Tables cont.
Next we input each of these cases into the function and
calculate what the output will be. The output goes under the
functions column.
x y z F
0 0 0 0
0 0 1 1
0 1 0 0
0 1 1 0
1 0 0 1
1 0 1 1
1 1 0 1
1 1 1 1
Karnaugh Map
The truth table is great for visualizing for which inputs you get
a 0 or 1, however it may not be easy to use it to simplify a
boolean expression. For that we use the Karnaugh map.
The Karnaugh map or K-map is a table setup in such a way to
make simplifying expressions really easy. It works with
minterms like the truth tables, this makes going from one to
the other fairly simple.
Well start my looking at a two variable map.
Two-Variable K-map
The first K-map shows the layout for an expression with two
elements.
In the second K-map we can see the relation between the
minterms and the elements.
y
x 0 1
m0 m1 0 xy xy

m2 m3 1 x y xy

Once we have the K-map drawn, we can look at our truth table
and in each box we place the output we found corresponding
to each minterm.
Two-Variable Example
Lets look at the the following function.
F = xy + x y + xy
We start by making a truth table.
x y F
0 0 1
0 1 1
1 0 1
1 1 0

Then we construct our K-map using the truth table.


y
x 0 1
0 1 1

1 1 0
Two-Variable Example cont.
In order to use this K-map to reduce our expression we need
to remember one of our properties of boolean algebra:
(y + y) = 1
If we use this with our minterms we see that,
x y + x y = x(y + y) = x or m0 + m1 = x
We can show this in our K-map but highlighting those given
boxes.

y
x 0 1
0 1 1

1 1 0
Two-Variable Example cont.
We can do the same thing with m0 and m2.

y
x 0 1
0 1 1

1 1 0

Using these highlightings we can reduce the expression to,


F = x + y
Three-Variable K-map
The three variable map can be extended from the two variable
map. Instead of having only y along the top we put yz.
yz
x 00 01 11 10
m0 m1 m3 m2 0 xyz xyz xy z xy z
m4 m5 m7 m6
1 x yz x yz xyz x y z

It is important to note that the minterms are NOT placed in


ascending order. The third and fourth column are switched. If
we look at the k-map with the elements, we can see that the
columns are labeled like gray code. By having only one bit
change between each row/column we are able to use our
highlighting method.
Three-Variable Example 1
Lets look are the following example,
F = m 2 + m3 + m 4 + m 5
yz
x 00 01 11 10
0 0 0 1 1

1 1 1 0 0

When highlighting with a three variable k-map we can


highlight pairs of two, lines of four, boxes of four, or all eight.
This is because we set up the k-map such that there is only
one bit change from column to column or row to row (like gray
code).
Three-Variable Example 1
To figure out what the resulting simplification will be, look are
each highlighted section and determine which bits dont
change.
In our example, for the yellow highlighting, we see that x stays
at one and y stays at zero. Thus our simplification for that
highlighting is,
x y
We do the same thing for the second highlighting and add
them together to get,
F = xy + x y
Three-Variable Example 2
Now we will look at a more complicated example.
F = m 0 + m2 + m 4 + m 5 + m6
yz
x 00 01 11 10
0 1 0 0 1

1 1 1 0 1

Before we highlight an important thing to note is that


between m0 and m2, there is only a one bit change. This mean
that when highlighting we are allowed to wrap around the
edges of the table.
Three-Variable Example 2
For our expression we can highlight a box around the edges as
well as a pair on the bottom.
yz
x 00 01 11 10
0 1 0 0 1

1 1 1 0 1

Again we look at the variables that dont change for each


highlighting. For the box, x varies between 1 and 0, y varies
between 1 and 0, and z stays at 0. So our expression for the
red box is,
z
Three-Variable Example 2
Doing the same thing with the pair highlighting we get a final
answer of,
F = z + x y
Four-Variable K-map
The four variable k-map functions the same as the three
variable k-map, but we must make sure that there is only a
one bit change between rows and columns. This means that in
addition to the third and four column being switched, the
third and fourth row are also switched.
yz
wx 00 01 11 10
m0 m1 m3 m2 00 wxyz wxyz wxy z wxy z
m4 m5 m7 m6 01 wx yz wx yz wx y z wx y z
m12 m13 m15 m14
11 w x yz w x yz wxyz w x y z
m8 m9 m11 m10
10 w xyz w xyz w xy z w xy z
Four-Variable K-map
Just like with the three variable map, we are allowed to wrap
around the edges of the map, both on the sides and the
top/bottom.
For the four variable map there are many possible
highlightings: a pair, a line of four, a box of four, a 2x4 box of
eight (two full columns or rows), or all sixteen. As a special
note, the for corners actually create a box of four because you
can wrap both horiztontally and vertically.
Four-Variable Example
Lets use the follow function,
F= m0 + m1 + m2 + m8 + m9 + m10 + m15
yz
wx 00 01 11 10
00 1 1 0 1

01 0 0 0 0

11 0 0 1 0

10 1 1 0 1

For this example we have two boxes of four and one left over.
Four-Variable Example
We can highlight it as follows.

yz
wx 00 01 11 10
00 1 1 0 1

01 0 0 0 0

11 0 0 1 0

10 1 1 0 1

By looking at which variables dont change, we can find the


reduced expression for each highlingting.
Four-Variable Example
The red highlighting reduces to,
xz
The blue highlighting reduces to,
xy
The purple highlighting cannot be reduced, it stay as,
wxyz
Adding everything together we get,
F = xz + xy + w x y z
Sample Problems
Try making a truth table and k-map to reduce the following
expressions.
1. F= m3 + m4 + m6 + m7
2. F= xz + xy + x yz + y z
3. F= (0, 1, 2, 4, 5, 6, 8, 9, 12, 13, 14)
4. F= m1 + m2 + m4 + m7 + m8 + m10 + m13 + m15
Solutions
1. y z + x z
2. z + xy
3. y + wz + x z
4. w x z + x y z + w xz +xy z + wxyz + wx yz
Reference
Digital Design, Fourth Edition
M. Morris Mano, Michael D. Ciletti

Das könnte Ihnen auch gefallen