Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/oantolin/circuits
Find minimal circuits for all boolean functions of n variables
https://github.com/oantolin/circuits
Last synced: 12 days ago
JSON representation
Find minimal circuits for all boolean functions of n variables
- Host: GitHub
- URL: https://github.com/oantolin/circuits
- Owner: oantolin
- Created: 2021-10-30T16:49:47.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2021-11-07T21:12:01.000Z (about 3 years ago)
- Last Synced: 2024-05-01T14:13:57.804Z (8 months ago)
- Language: Common Lisp
- Size: 995 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.org
Awesome Lists containing this project
README
This is very simple-minded dynamic programming code to find minimal
circuits for all boolean functions of n variables. Only use it for
n<=4. :PTo generate a file of minimal circuits just run =(save-mincircuits n)=
and the file =mincircuits#.txt= will be produced with =#= replaced by =n=.
If you try a /huge/ value of =n=, say 5 or more, then you may want to ad
an optional maximal circuit complexity to bound the search. In that
case use =(save-mincircuits n :complexity bound)=.The search procedure is fairly general. If you want to use different
logic gates, take a look at the code for =mincircuits= and see how the
=and=, =or= and =not= gates are implemented. It is easy to modify that
function to use your preferred gates or, for example, to add constant
1 and constant 0 wires.