Professional Documents
Culture Documents
Irredundant Standard Input Standard Output: Y F A B C D M D
Irredundant Standard Input Standard Output: Y F A B C D M D
Using espresso
1 Introduction
espresso is part of the OctTools suite of design tools from U.C. Berkeley. Its main function
is to nd simple SOP Boolean expressions for arbitrary truth tables, possibly including don't
cares and possibly for several outputs simultaneously. With a few tricks, you can even give it
arbitrary Boolean expressions as input and get readable Boolean expressions as output.
As pointed out in Katz and in class, espresso is not designed to nd absolutely minimal
SOP forms. Rather, it guarantees an irredundant cover of the ON-set of a function and uses
heuristics to try to make this cover simple. For small problems, however, (with up to ve or six
inputs, say), it is very unlikely that espresso's solution is not minimal.
espresso is available on the Department's HP workstations, and is a \classic" UNIX-type
program. It operates on an input text le, or on text input fed to its standard input, and
produces text output on its standard output, which can be redirected through the UNIX shell
to an output le if desired. Details of its operation can be controlled using options included on
the command line.
2 Basic Use
The command synopsis is
espresso [options] [file]
The square brackets mean, in UNIX-speak, that these arguments are optional. If the file
argument is not included, espresso operates instead on its standard input (i.e., it will wait for
you to type input into it, or you can use the shell's redirection capabilities to pipe data to it).
If the options argument is not included, espresso will operate in its input data in the default
way and produce its output in the default format.
espresso expects its input in Berkeley PLA Format, which you're probably familiar with.
X
For example, to specify the Boolean function
X
Y = f (A; B; C; D) = m(0; 3; 5; 12; 13) + d(1; 2; 15)
in PLA format you would type
.i 4
.o 1
.ilb A B C D
.ob Y
.p 8
0000 1
0011 1
0101 1
1100 1
1101 1
0001 -
0010 -
1111 -
.e
ENGR 365 { Using espresso 2
Basically you're identifying the truth table rows where the function should be 1 and where it
should be don't care (-).
If the above PLA description is stored in the le in.pla, you can simplify it by typing
espresso in.pla. This will produce the following output on your terminal:
.i 4
.o 1
.ilb A B C D
.ob Y
.p 3
-101 1
00-- 1
110- 1
.e
If you want to have the above output saved to a le called out.pla instead of appearing on your
terminal, just type espresso in.pla > out.pla instead. (\>" redirects a command's standard
output to a le in most UNIX shells.) In any case, the output means that the simplest form
espresso could nd for f is
3 Options
Using the [options] argument you can get espresso to do some nice things:
-o eqntott
Use this to get espresso's output to look like a (sort of) readable equation. For example,
the output of espresso -o eqntott in.pla is
Y = (B&!C&D) | (!A&!B) | (A&B&!C);
Using this SOP expression for f and two applications of DeMorgan's Theorem gives a
simple POS form for f (see Slide 16, Chapter 2, of the lecture handouts):
f (A; B; C; D) = f (A; B; C; D) = AB + BC + ABD
= (AB )(BC )(ABD)
= (A + B )(B + C )(A + B + D)
-Dmap
This produces a crude Karnaugh map of the input function's ON-set; espresso -Dmap
in.pla gives
Output space # 0
1.1.
....
1...
..11
Unfortunately, the rows and columns aren't arranged in the way we're used to. :-(
-Dexact
This causes espresso to work much harder to nd a minimal cover (although still not
guaranteed minimal, I don't think).
There are lots more options too. For more information, try man espresso. For details on the
PLA le format, try man 5 espresso.
This can be saved to a le using redirection (as in misII -t eqn -T pla in.eqn > in.pla)
and a simplied SOP form obtained using espresso -o eqntott in.pla, which gives the out-
put
Y = (A);
ENGR 365 { Using espresso 4
Redirection can be used with the espresso command to save this to a le if desired. What this
computation has done, of course, is to show that
Y = AB + AB = A
To be really cool and UNIX-y you can do this whole process in the one command line misII
-t eqn -T pla in.eqn | espresso -o eqntott > out.eqn, after which the le out.eqn will
contain
Y = (A);
Note that the input expression doesn't have to be SOP (although the output always is). For
example, if in.eqn contains
Y = (!A|B)&(A|C)&(A|B);
5 Multiple Outputs
One handy thing espresso can do is simultaneous simplication of several functions at once.
Here, for example, is the PLA le describing a one-bit full adder:
.i 3
.o 2
.ilb a b cin
.ob sum cout
.p 8
111 10
001 10
010 10
100 10
111 01
011 01
101 01
110 01
.e
If this le is called in.pla then simple SOP expressions for both outputs can be obtained using
espresso -o eqntott in.pla, which gives
Although it didn't make any dierence in this case, espresso will look for and take advantage of
common product terms between the two output functions. (Sometimes the overall solution can
be simplied by taking advantage of common terms rather than going for the absolute simplest
expression for each output separately.)