Starting from:

$29.99

Programming ABC_Assignment 1


Programming Assignment 1

1 [Using ABC]
(10%)
(a) Use BLIF manual
(http://www.eecs.berkeley.edu/alanmi/publications/other/blif.pdf)
to create a BLIF le representing a four-bit adder.
(b) Perform the following steps to practice using ABC
(http://www.eecs.berkeley.edu/alanmi/abc/):
1. read the BLIF le into ABC (command \read")
2. check statistics (command \print stats")
3. visualize the network structure (command \show")
4. convert to AIG (command \strash")
5. visualize the AIG (command \show")
6. convert to BDD (command \collapse")
7. visualize the BDD (command \show bdd"; note that show bdd only shows
the rst PO; command \cone" can be applied in combination to show
other POs)
Items to turn in:
1. The BLIF le.
2. Screenshot of your ABC execution steps.
3. Results of \show" and \show bdd".
Comment 1: For commands \show" and "show bdd" to work, please download
the binary of software \dot" from GraphViz webpage
(http://www.graphviz.org) and put it in the same directory as the ABC
binary or anywhere else in the path.
Comment 2: Make sure GSview and Ghostscript are installed on your com-
puter. (http://pages.cs.wisc.edu/ghost/gsview/) A proper path of
gsview32.exe needs to be speci ed in \nsrcnbasenabcnabcShow.c."
For Windows 7, the path is likely to be
C:nProgram Files (x86)nGhostgumngsviewngsview32.exe.
2 Programming Assignment 1
2 [ABC Boolean Function Representations]
(10%) In ABC there are di erent ways to represent Boolean functions.
(a) Please compare the following di erences.
1. logic network in AIG (by command \aig") vs. structurally hashed AIG
(by command \srtash" )
2. logic network in BDD (by command \bdd") vs. collapsed BDD (by com-
mand \collapse")
(b) Given a structurally hashed AIG, please nd a sequence of ABC commands
to covert it to a logic network in SOP.
3 [Programming ABC]
(80%) Write a procedure in ABC to nd hidden majority (MAJ) gates in a
given AIG. Integrate your MAJ identi cation procedure into ABC, so that run-
ning command \MAJ find" (de ned by function named \Abc CommandMajFind")
would invoke your code to report the found MAJ gates. To x the notation, let
f = MAJ(a; b; c), where f is the output, and a; b; c are the inputs. So the com-
mand output may list, e.g., 25 = MAJ(5;􀀀14; 22), for AIG node (ID) 25 being
the output with inputs 5, negated 14, and 22. Also it should summarize the total
number of the found MAJ gates at the end.
Note that Abc NtkStrash can be used to convert a logic network to an AIG.
Refer to the code of command strash in abc.c for its usage. The instructions
about how to add your code to ABC can be found in PA1 README.txt. Please
do NOT modify any ABC code to make your program stand alone.
Programming help:
Example of code to iterate over the objects
void Abc NtkCleanCopy( Abc Ntk t * pNtk )
f
Abc Obj t * pObj;
int i;
Abc NtkForEachObj( pNtk, pObj, i )
pObj-pCopy = NULL;
g

More products