3 February Lab for CSCI 274

Project goal

Implement the circuit for the top segment of a 7-segment display in the same way that we have solved problem 1-12 of the textbook below. Use diglog to create the sum-of-product gates circuit and simulate the circuit to show that it works as required.

Starting off

Just like last time, create a protected directory for this lab by executing the following commands:

If any of these steps fail, get in touch with the instructor!

Our solution to problem 1-12

Creating espresso input

Use an editor to put together a file Prob1_12.in that has the form shown below. This will serve as input to the espresso program. Espresso is a PLA (Programmed Logic Array) program written by graduate students at UC-Berkeley more than a decade ago. Espresso creates an output that shows a minimal sum-of-products logic equation that satisfies the input-output requirements. In this problem, the number of input variables is four, the number of output variables is one, and the number of product terms is sixteen. Note how we have arranged the inputs, A, B, C, and D in binary number order. Examine the file format to be certain you understand that the outputs are 1 for the inputs numbered 2, 3, 4, 5, 6, 7, 11, 14, and 15.

Here is the file contents of Prob1_12.in:

.i 4
.o 1         #           Comments
.p 16        #           
0000 0       #   \ CD     00      01      11      10
0001 0       #  AB\     ------------------------------
0010 1       #  00 |     0(0)    1(0)    3(1)    2(1)
0011 1       #  01 |     4(1)    5(1)    7(1)    6(1)
0100 1       #  11 |    12(0)   13(0)   15(1)   14(1)
0101 1       #  10 |     8(0)    9(0)   11(1)   10(0)
0110 1
0111 1
1000 0
1001 0
1010 0
1011 1
1100 0
1101 0
1110 1
1111 1

Running espresso

Execute the espresso program on the above file by typing

This produces the following Prob1_12.out file:

.i 4
.o 1
.p 4
01-- 1
--11 1
0-1- 1
-11- 1

With a bit of decoding, the minimized sum-of-products equation can be read directly from the above file as

Hint: The dashes (-) in the output mean don't care.

Building the circuit with diglog

We then used diglog to create a sum-of-products implementation of the minimized equation.

Testing out our work

Getting started

To get started, copy our implementation of problem 1-12 into your space.

Note that both of these commands end with a space followed by a period.

Trying out espresso

To verify that you can run espresso properly, run espresso on the Prob1_12.in file to produce Prob1_12.out. The output file should look like the one shown above.

Trying out diglog

To strengthen your diglog skills, run diglog on the Prob1_12.lgf file.

Because .lgf is the default extension for diglog you do not need to type the .lgd when starting diglog.

Once in diglog, move the text window down to the lower left corner. Then make the graphic screen larger by using the mouse on it's lower right corner. Use arrow keys to get the figure in the center of the screen. Enter "glow" mode by pressing the mouse on cursor and dragging over to glow. The red glow on the wires A, B, C, D will count up slowly as binary numbers from 0000 to 1111 Red is binary 1, and black is binary 0.

Note the color of output F for each of the sixteen input combination. The value of F should agree with the output value in the file Prob1_12.in.

Exit diglog by pressing misc and tdragging to save page. Hit the enter key. This will save your work. Quit by pressing misc and dragging to exit.

Doing it yourself

Now that you have some expertise with diglog and espresso proceed with designing the circuit for the top segment of a 7-segment display. Now the top segment of the display is defined as follows:

We suggest following these steps:

If you are willing to do a little testing, you can do the first few steps of the problem with Dean Brock's combinatorial circuit specification CGI script.

This lab based on Wayne Lang's Project 1 from last semester.

Return to CSCI 274 labs
Return to CSCI 274 home page
Return to Dean Brock's home page
CSCI logo Return to the UNCA Computer Science home page