Questions tagged [pyeda]

PyEDA is a Python library for electronic design automation.

This tag is intended for coding questions about using or modifying the Python Electronic Design Automation PyEDA library.

PyEDA is primarily concerned with implementing the data structures and algorithms necessary for performing logic synthesis and verification. These tools form the theoretical foundation for the implementation of CAD tools for designing VLSI (Very Large Scale Integrated circuit).

For detailed information and examples, visit the PyEDA documentation.

See also the official Github page.

17 questions
3
votes
2 answers

Any way to reorder variables for binary decision diagrams?

I am working on a teaching tool for binary decision diagrams in which there is also a feature for variable reordering. Can anyone suggest a suitable library which implements variable reordering while building the tree or some kind of algorithm which…
Razor21
  • 59
  • 1
  • 6
2
votes
1 answer

pyeda method "to abstract syntax tree"

What I'm really trying to do is to convert boolean expressions to integer linear programming constraints. I'm trying to first convert the expressions into a CNF (using pyeda) and then from the CNF form the constraints (since this is pretty straight…
Rikard Olsson
  • 841
  • 1
  • 7
  • 28
2
votes
1 answer

Generating Binary decision diagram from an available data structure

This question is a bit long; please bear with me. I have a data structure with elements like this {x1, x2, x3, x4, x5}: {0 0 0 0 0, 0 0 0 1 0, 1 1 1 1 0,.....} They represent all the TRUEs in the truth table. Of course, the 5-bit string elements…
user12928042
1
vote
1 answer

How to propagate negation down to literals?

I would like to transform an expression so that all negation operators are propagated down to the literals. So ~(a | b) becomes ~a & ~b. Does anyone have a solution for this? from pyeda.boolalg.expr import expr formula = "~(a | b)" e =…
Leevi L
  • 1,538
  • 2
  • 13
  • 28
1
vote
1 answer

Efficiently create structured binary decision diagram

I'm trying to create a BDD with a particular structure. I have a 1D sequence of boolean variables x_i, e.g. x_1, x_2, x_3, x_4, x_5. My condition is satisfied if there are no isolated ones or zeros (except possibly at the edges). I have implemented…
1
vote
1 answer

PYEDA truthtable of functions

Hope there is anybody who feels good with PYEDA. I want to add fictious variables to function Let me have f=x1, but how can I get truthtable for this function , which will have x2 too Like truthtable for f(x1)=x1 is: x1 f 0 0 1 1 But for…
1
vote
0 answers

Can pyeda simplify using xors?

I'm trying to analyze some functions with PyEDA. Is there a way to convert expressions in DNF to use XOR operations if it makes them simpler? For example: >>> import pyeda.inter >>> >>> a,b=map(pyeda.inter.exprvar,'ab') >>> x = a&~b | ~a&b >>>…
Jason S
  • 184,598
  • 164
  • 608
  • 970
1
vote
0 answers

PyEDA Binary Decision Diagram plotting in IPython

After installing Graphviz and gvmagic, I run the following command in order to display the BDD: ff = a|b&c %dotobj ff However, I get the following error: FileNotFoundError [WinError 2] Le fichier spécifié est introuvable Any…
Galileo
  • 321
  • 1
  • 4
  • 12
1
vote
0 answers

PyEDA - replace node in expression

Consider the following piece of PyEDA: a, b, c = map(exprvar, 'abc') f1 = And(a,Or(~a,b)) print(f1) outputs: And(a, Or(~a, b)) How can I replace the first a with c? compose replaces all instances of a: f1.compose({a: c}) outputs: And(c, Or(~c,…
poochon
  • 35
  • 6
1
vote
0 answers

BDD Visualization with IPython and GraphViz

I'm Trying to work with PyEDA, i need to visualize Binary Decision Diagram, i'm reading this document but i can't understand it! here it says: If you have GraphViz installed on your machine, and the dot executable is available on your shell’s path,…
1
vote
1 answer

Pyeda: infix form of boolean expression

Pyeda permits to write boolean expression in prefix form and in infix form: p = Or(And("A","B"), And("C","D")) # prefix i = expr("A & B | C & D") # infix Although it's possible to retrieve automatically from i the relative prefix form, I don't know…
enneppi
  • 1,029
  • 2
  • 15
  • 33
0
votes
0 answers

I can't initiate the X table in PyEDA

I have an issue with PyEDA. I have to do a 2-level-logic-minimization in PyEDA for a University project for "Low Level Synthesis" using Espresso minimization. I used this BLIF file as an input: # Benchmark "ex" written by ABC on Thu Jun 4 14:03:01…
SobuHasy
  • 9
  • 3
0
votes
0 answers

Specify DC cover with espresso_exprs

I'm just getting started learning pyeda, and fairly new to python in general. I have a very complex partially-defined Boolean expression (80~140 variables, 10K terms) that's too big to express as a truth table, but I can express it pretty easily as…
p.s.w.g
  • 146,324
  • 30
  • 291
  • 331
0
votes
1 answer

BDD test if an expression is true using PyEDA

I am trying to use the PyEDA package BDD implementation, and feed "True/False" data to construct a functional BDD. Then test as my data get updated if new expression is "True" in the constructed BDD. However, I could not utilize the "equivalent"…
hatahetahmad
  • 93
  • 1
  • 10
0
votes
1 answer

Python libraries for representing distance between a point and DNF of inequalities

Let us fix the number of variables to be 4: so x0, x1, x2, x3. I am looking for a python construct which allows me to: (i) store in memory, a disjunctive normal formula where the atomic formulas are inequalities: a0x0 + a1x1 + a2x2 + a3x3 >= a4 or…
Anon
  • 381
  • 1
  • 2
  • 13
1
2