You are on page 1of 5

TUTORIAL ON ESPRESSO

What is a Truth Table?


A table that describes a logic function by listing all possible combinations of
input values and indicating for each combination, the output value.
For example, for an AND gate (with 2 inputs A and B; Output C),
Inputs

Output
A
0
0
1
1

B
0
1
0
1

C
0
0
0
1

AND
GATE

Truth Table
The Truth Table tells us What the Output C is when the Input A is 0,
Input B is 0? All possible combinations of the inputs and their
corresponding outputs are seen in the Truth Table. So the truth table shown
above represents the logic function C = A (AND) B. Thus any logic function
can be represented using a Truth Table. So, given the truth table we can
derive the logic function and vice versa. In order to derive the logic function
from a given truth table, we represent the truth table in terms of K-maps and
derive the logic function.
A
0
0
1

B
1
1
0

C
0
1
1

F(Output)
1
1
1

For the above truth table we draw the K-Map, we obtain


BC

00

01

10

A 0
1

11

11

Thus, the minimized logic function is F = A(!B)C + (!A)B .

Now let us use the Espresso program to minimize this function automatically.

What is Espresso?
Espresso is a two level logic minimization tool. It is a program that helps us
minimize and compute the logic function from the truth table. Espresso takes
as input the truth table specified in a special format called the PLA
(Programmable Logic Array) format.

.i3

.o1

NumberofInputs
Outputs

.ilbabc NamesofInputSignals
.obfOutputSignals
0111
0101
1011
.e

PLA Format
TruthTable

The espresso program takes this file as an input and generates the
minimized logic function.

Running the Espresso Program


At the command prompt, type the following command:
> espresso <filename>
For example, in the following snapshot we see the espresso program being run
on the filename ece274.pla
>espressoece274.pla

Output of the Espresso Program


The output of the Espresso program can be seen on the screen or it can be
saved to a file. By just typing the above command, the output is seen on the
screen and is as shown in the snapshot below.

>espressoece274.pla
.i3
.o1
.ilbabc
.obf
.p2
1011
011
.e
>

Thus, the minimized function F = A(!B)C + (!A)B can be obtained by


observing the truth table in the PLA format output by the Espresso program.
As we can see, the minimized function from the K-Map and the Espresso
output are the same. The necessity for using Espresso over manual
minimization (K-Map method) can be appreciated as the number of variables
in the logic function increase.

Writing the output to a File


For the espresso output to be written to a file, type the following command at
the command prompt.
>espresso <filename> > <output_filename>
For example, in the snapshot, the Espresso program is being run on the
filename ece274.pla and the output is being directed to the file ece274.out
>espressoece274.pla>ece274.out
>

Other options using Espresso


The Espresso program can also be used with various other options. The
format of the instruction is as shown below.
>espresso [options] [file]
A few options are listed here
1. -o[type] : Selects the output format. By default, only the ON-set (Values of
inputs for which Output is 1) is output after minimization. [type] can be one of
f, d, r, fd, fr, or fdr to select the Combination of the onset (f), offset (r) and

dont care set (d). This is illustrated in the snapshot shown below. The
espresso output with fr indicates both On-set and Offset of the minimized
function. The output file can also be written in the EQN format. In the
snapshot shown below, we see both the onset and the offset.
2. -Dexact : Performs the exact minimization algorithm in espresso.
3. Dso : Minimize each function, one at a time as a singleoutput function.
Terms will not be shared among the functions. The option S1 will perform an
exact minimization for each singleoutput function.
4. Dso_both : Minimize each function one at a time as a singleoutput
function, but choose the function or its complement based on which has
fewer terms. The option S1 will perform an exact minimization for each
singleoutput function and its complement to determine which has fewer
terms.
5.Dstats : Provide simple statistics on the size of the function.
6.Dverify : Checks for Boolean equivalence of two PLA's. Reads two
filenames from the command line, each containing a single PLA.
>espressoece274.pla
.i3
.o1
.ilbabc
.obf
.p2
1011
011
.e
>espressoofrece274.pla
.typefr
.i3
.o1
.ilbabc
.obf
.p4
1011
1 1
0 0
110
.end

Various other options like -DPLAverify, -Dmap, -d, -s, -x, -epos are also
available. The function of each of these options is given in the Espresso
manual.

You might also like