Docsity

Two-Level Logic Minimization Project: Quine-McCluskey Algorithm - Prof. Susan Lysecky, Study Guides, Projects, Research of Electrical and Electronics Engineering

Toggle sidebar
bg1
ECE 474A/574A Programming Project 4: 2-Level Logic Minimizer
Deliverables
Phase I (20pts): Due April 16, 2008 (Wednesday) at 8:00 pm
ECE 474/574A Deliverables
• Parser that reads in input file and generates a Verilog or text output file based on the command line flag. In this phase, your
parser does not optimize the input file. You will simply read in the function (storing this function in the data structure of your
choice) and output the same function in the aforementioned formats.
• Makefile
Turnin
• Submit your project using electronic turnin, class_account_name is “ece474a”, assignment_name is “proj4a”
Phase II (50pts): Due May 5, 2008 (Monday) at 8:00 pm
ECE 474A Deliverables
• Logic minimization tool (Quine-McCluskey – exact algorithm) implemented in C/C++
• Makefile
ECE 574A Deliverables
• Logic minimization tool (your own algorithm) implemented in C/C++
• Makefile
• 2-3 page project report
Turnin
• Submit your project using electronic turnin, class_account_name is “ece474a”, assignment_name is “proj4b”
Project Description
The goal of this project is to implement a two-level logic minimization tool that takes in a functional description of a n-input, 1-output
Boolean function, optimizes the function by reducing the size of the circuit, then outputs the optimized circuit.
Logic Minimization
Logic minimization is an active area of research, both in two-level logic minimization and multi-level logic minimization, with many exact
algorithms and heuristics available. In lecture we have looked at several of these techniques including Quine-McCluskey, Petrick’s method,
iterated and recursive consensus method, row/column dominance, Espresso, branch-and-bound, and simulated annealing.
ECE474A students, your logic minimizer will implement the Quine-McCluskey algorithm. Your implementation should consider don’t
care inputs and produce the optimal solution (i.e. implement as an exact algorithm).
ECE 574A students, instead of implementing a specific algorithm/heuristic, you will develop you own methodology drawn from
previous work, a combination of techniques, or a completely novel technique developed on your own. Just remember that your
methodology should at a minimum match the difficulty of the Quine-McClusky algorithm. In addition to the logic minimization tool, you
will need to provide a 2-3 page report of your logic minimizer
in standard IEEE 2-column format (a sample is provided at
http://www.ieee.org/portal/cms_docs/pubs/confpubcenter/pdfs/
samplems.pdf). Your report should minimally include a
discussion (and citation) of relevant previous work, an
overview of your minimization strategy, and results discussing
the effectiveness of your methodology illustrated through
experiments.
Input File
Your minimizer will read in an input file that specifies the
functionality of a two-level Boolean function. The logic
function is described as a character matrix with keywords
embedded in the input to specify the size of the matrix, input
and output variable names, and an optional end of file marker.
Keywords are specified in Figure 1. The input file format is
based on the input file format for ESPRESSO. Many other
options exits for ESPRESSO, but we limit this project to
consider only the keywords listed in Figure 1.
Figure 1: Input file keywords.
Keyword Description
# comment Comments are allowed within the input by placing a
pound sign (#) as the first character on a line.
.i [d] Specifies the number of input variables, where [d]
denotes a decimal number.
.o [d] Specifies the number of output functions, where [d]
denotes a decimal number.
.ilb [s1] [s2] ... [sn] Gives the names of the binary valued variables. This
must come after .i and .o. There must be as many tokens
following the keyword as there are input variables.
.ob [s1] [s2] ... [sn] Gives the names of the output functions. This must come
after .i and .o. There must be as many tokens following
the keyword as there are output variables.
.e Optionally specifies the end of the file
pf2

Partial preview of the text

Download Two-Level Logic Minimization Project: Quine-McCluskey Algorithm - Prof. Susan Lysecky and more Study Guides, Projects, Research Electrical and Electronics Engineering in PDF only on Docsity!

ECE 474A/574A Programming Project 4: 2-Level Logic Minimizer

Deliverables

Phase I (20pts): Due April 16, 2008 (Wednesday) at 8:00 pm

ECE 474/574A Deliverables

  • Parser that reads in input file and generates a Verilog or text output file based on the command line flag. In this phase, your parser does not optimize the input file. You will simply read in the function (storing this function in the data structure of your choice) and output the same function in the aforementioned formats.
  • Makefile

Turnin

  • Submit your project using electronic turnin, class_account_name is “ece474a”, assignment_name is “proj4a”

Phase II (50pts): Due May 5, 2008 (Monday) at 8:00 pm

ECE 474A Deliverables

  • Logic minimization tool (Quine-McCluskey – exact algorithm) implemented in C/C++
  • Makefile

ECE 574A Deliverables

  • Logic minimization tool (your own algorithm) implemented in C/C++
  • Makefile
  • 2-3 page project report

Turnin

  • Submit your project using electronic turnin, class_account_name is “ece474a”, assignment_name is “proj4b”

Project Description

The goal of this project is to implement a two-level logic minimization tool that takes in a functional description of a n-input, 1-output Boolean function, optimizes the function by reducing the size of the circuit, then outputs the optimized circuit.

Logic Minimization

Logic minimization is an active area of research, both in two-level logic minimization and multi-level logic minimization, with many exact algorithms and heuristics available. In lecture we have looked at several of these techniques including Quine-McCluskey, Petrick’s method, iterated and recursive consensus method, row/column dominance, Espresso, branch-and-bound, and simulated annealing.

ECE474A students, your logic minimizer will implement the Quine-McCluskey algorithm. Your implementation should consider don’t care inputs and produce the optimal solution (i.e. implement as an exact algorithm).

ECE 574A students, instead of implementing a specific algorithm/heuristic, you will develop you own methodology drawn from previous work, a combination of techniques, or a completely novel technique developed on your own. Just remember that your methodology should at a minimum match the difficulty of the Quine-McClusky algorithm. In addition to the logic minimization tool, you will need to provide a 2-3 page report of your logic minimizer in standard IEEE 2-column format (a sample is provided at http://www.ieee.org/portal/cms_docs/pubs/confpubcenter/pdfs/ samplems.pdf). Your report should minimally include a discussion (and citation) of relevant previous work, an overview of your minimization strategy, and results discussing the effectiveness of your methodology illustrated through experiments.

Input File

Your minimizer will read in an input file that specifies the functionality of a two-level Boolean function. The logic function is described as a character matrix with keywords embedded in the input to specify the size of the matrix, input and output variable names, and an optional end of file marker. Keywords are specified in Figure 1. The input file format is based on the input file format for ESPRESSO. Many other options exits for ESPRESSO, but we limit this project to consider only the keywords listed in Figure 1. (^) Figure 1: Input file keywords.

Keyword Description

comment Comments are allowed within the input by placing a

pound sign (#) as the first character on a line.

.i [d] Specifies the number of input variables, where [d] denotes a decimal number.

.o [d] Specifies the number of output functions, where [d] denotes a decimal number.

.ilb [s1] [s2] ... [sn] Gives the names of the binary valued variables. This must come after .i and .o. There must be as many tokens following the keyword as there are input variables.

.ob [s1] [s2] ... [sn] Gives the names of the output functions. This must come after .i and .o. There must be as many tokens following the keyword as there are output variables.

.e Optionally specifies the end of the file

Figure 2 provides a sample input file utilizing the keywords outlined in Figure 1. The first three lines are comments, and strictly for readability. The entry “.i 2 ” specifies there are two input variables to the function, and “.ilb a b” indicates the names of these two input variables are a and b. Additionally, the entries “.o 1 ” and “.ob F” specifies this is a single output function with output variable name F. The last four entries specify the functionality of F, basically constructing a truth table indicating the corresponding output value given an input combination. Variables are represented as “1” (on), “0” (off), and “-” (don’t care).

Additional input files can be downloaded from the course page. When parsing these files, remember not all files will be exactly the same. For example, comments can appear anywhere in the file as long as they are preceded by a #. Additionally, an input file can have multiple empty lines or no empty lines. Make sure your parser handles these (and possibly other) cases.

Output File

Your logic minimization tool should allow the user to specify the input file, the output file type, and the output file, using the following command line argument.

logic_min -flag

Two file types are possible, a Verilog file (indicated by –v) or a text file (indicated by –t). If the user enters the –v flag on the command line, your tool should provide an output file implementing the optimized circuit as a Verilog module. The user should be able to compile and simulate the Verilog file in Xilinx WebPACK. You do not need to provide a testbench. Alternatively, if the users enters a –t flag on the command line, your tool should provide an output file in a text format adhering to the specifications in Figure 1. Essentially, your output file is another input file. Generating another input file can be useful because this file can be read in again by the logic minimizer (or other tools) to perform multiple optimization passes.

Compilation Requirements

Your minimizer must be written in C or C++, and able to run on ece2.ece.arizona.edu. A sample makefile and test programs are provided on the course page as a reference. You should be able to logon to ece2.ece.arizona.edu, type “make”, and execute the program provided. Similarly, the grader should only have to type “make” to compile your project and use the command line outlined above to specify the input file, output file format, and output file. A gain, file names and file format are command line arguments. You will loose points if you hardcode these parameters or utilize a menu system in your code. All projects will be compiled and executed on ece2.ece.arizona.edu. Please make sure you either work on this machine or test your code on this machine before you submit.

Additional Resources

Espresso input file format

  • http://www.cs.indiana.edu/classes/c421/man/espresso.5.html
  • Google

The TA or I will be more than happy to discuss the espresso input specification, optimization methodologies and/or algorithms, or high- level implementation details. However, we will not answer C/C++ syntax questions or figure out why your code does not compile (or seg faults). You will be responsible for the C/C++ language portion of the project. Language details can be found in a good reference book or at one of the online resources below.

  • C Language Reference Manual from SGI techpubs library - http://techpubs.sgi.com/library/manuals/0000/007-0701- 150/pdf/007-0701-150.pdf
  • C Reference Manual from Computing Science Research at Bell Labs – http://cm.bell-labs.com/cm/cs/who/dmr/cman.pdf
  • The GNU C Library from GNU.org - http://www.gnu.org/software/libc/manual/html_node/index.html
  • C Reference Master Index from the Space Research & Planetary Sciences Research Division at the University of Bern (Switzerland) - http://www.space.unibe.ch/comp_doc/c_manual/C/cref.html
  • Google

Figure 2: Sample input file.

test1.txt

F = a’b + ab’ + ab

F = a + b (opitmized)

.i 2 .o 1 .ilb a b .ob F

00 0 01 1 10 1 11 1