{"id":34112971,"url":"https://github.com/dreylago/logicmin","last_synced_at":"2026-03-27T04:30:47.174Z","repository":{"id":57438813,"uuid":"83377093","full_name":"dreylago/logicmin","owner":"dreylago","description":"Logic Minimization in Python","archived":false,"fork":false,"pushed_at":"2026-02-23T16:31:49.000Z","size":253,"stargazers_count":26,"open_issues_count":2,"forks_count":7,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-02-23T21:46:22.609Z","etag":null,"topics":["combinational-circuit","logic-design","logic-minimization","state-machine"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dreylago.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2017-02-28T01:53:28.000Z","updated_at":"2026-02-23T16:35:39.000Z","dependencies_parsed_at":"2024-03-23T15:24:28.026Z","dependency_job_id":"3b9c34eb-f682-4c2e-bea3-df8909ed420d","html_url":"https://github.com/dreylago/logicmin","commit_stats":{"total_commits":23,"total_committers":3,"mean_commits":7.666666666666667,"dds":"0.13043478260869568","last_synced_commit":"469b76673f586802f2a486a97aea644f90aa7028"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/dreylago/logicmin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dreylago%2Flogicmin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dreylago%2Flogicmin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dreylago%2Flogicmin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dreylago%2Flogicmin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dreylago","download_url":"https://codeload.github.com/dreylago/logicmin/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dreylago%2Flogicmin/sbom","scorecard":{"id":356109,"data":{"date":"2025-08-11","repo":{"name":"github.com/dreylago/logicmin","commit":"ca0b2db6d231a45f4dceaeb1f0556f51f4d93bc9"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.5,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 1/29 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.txt:0","Info: FSF or OSI recognized license: MIT License: LICENSE.txt:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 3 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-18T09:39:18.636Z","repository_id":57438813,"created_at":"2025-08-18T09:39:18.636Z","updated_at":"2025-08-18T09:39:18.636Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31019283,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-27T03:51:26.850Z","status":"ssl_error","status_checked_at":"2026-03-27T03:51:09.693Z","response_time":164,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["combinational-circuit","logic-design","logic-minimization","state-machine"],"created_at":"2025-12-14T19:06:05.052Z","updated_at":"2026-03-27T04:30:47.146Z","avatar_url":"https://github.com/dreylago.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LogicMin: Logic Minimization in Python\n\n\nMinimize logic functions.\n\n\n## Description\n\nLogicMin is a Python package that minimize boolean functions using the tabular method of minimization (Quine-McCluskey). An object represent a truth table to which rows are added. After all rows are added, call a solve function.The solve function returns the minimized Sum of Products. The sum of products can be printed or analyzed. \n\nFor more information, look into references:\n\n\t- Edward J. McCluskey. 1986. Logic Design Principles with Emphasis on Testable Semicustom Circuits. Prentice-Hall, Inc., Upper Saddle River, NJ, USA. \n\t- John F. Wakerly. 1989. Digital Design Principles and Practices. Prentice-Hall, Inc., Upper Saddle River, NJ, USA.\n\n\n## Full-adder\n\n```python\n\n\t# Full-adder\n\timport logicmin\n\t# truth table 3 inputs, 2 outputs\n\tt = logicmin.TT(3,2);\n\t# add rows to the truth table (input, ouutput)\n\t# ci a b  |  s co\n\tt.add(\"000\",\"00\")\n\tt.add(\"001\",\"10\")\n\tt.add(\"010\",\"10\")\n\tt.add(\"011\",\"01\")\n\tt.add(\"100\",\"10\")\n\tt.add(\"101\",\"01\")\n\tt.add(\"110\",\"01\")\n\tt.add(\"111\",\"11\")\n\t# minimize functions and get\n\t# solution for analysis and print\n\tsols = t.solve()\n\t# print solution mapped to var names (xnames=inputs, ynames=outputs)\n\t# add debug information\n\tprint(sols.printN(xnames=['Ci','a','b'],ynames=['s','Co'], info=True))\n```\n\n\nOutput:\n\n```txt\n\tCo \u003c= a.b + Ci.b + Ci.a\n\ts \u003c= Ci'.a'.b + Ci'.a.b' + Ci.a'.b' + Ci.a.b\n```\n\n\nGet expression in VHDL syntax:\n\n```python\n\tprint(sols.printN(xnames=['Ci','a','b'],ynames=['s','Co'], syntax='VHDL'))\n```\n\nOutput:\n\n```txt\n\tCo \u003c= a and b or Ci and b or Ci and a\n\ts \u003c=  not(Ci) and  not(a) and b or  not(Ci) and a and  not(b) or Ci and  not(a) and  not(b) or Ci and a and b\n```\n\n\nGet expression in Verilog syntax:\n\n```python\n\tprint(sols.printN(xnames=['Ci','a','b'],ynames=['s','Co'], syntax='Verilog'))\n```\nOutput:\n\n```txt\n\tCo \u003c= a \u0026 b | Ci \u0026 b | Ci \u0026 a\n\ts \u003c= ~Ci \u0026 ~a \u0026 b | ~Ci \u0026 a \u0026 ~b | Ci \u0026 ~a \u0026 ~b | Ci \u0026 a \u0026 b\n```\n\n## BCD to 7 segment converter\n\n\n```python\n\t# BCD-8421 to 7 segment\n\timport logicmin\n\tt = logicmin.TT(4,7);\n\t# b3 b2 b1 b0  | a b c d e f g \n\tt.add(\"0000\",\"1111110\") \n\tt.add(\"0001\",\"0110000\") \n\tt.add(\"0010\",\"1101101\") \n\tt.add(\"0011\",\"1111001\") \n\tt.add(\"0100\",\"0110011\") \n\tt.add(\"0101\",\"1011011\") \n\tt.add(\"0110\",\"0011111\") \n\tt.add(\"0111\",\"1110000\") \n\tt.add(\"1000\",\"1111111\") \n\tt.add(\"1001\",\"1110011\") \n\tt.add(\"1010\",\"-------\") \n\tt.add(\"1011\",\"-------\") \n\tt.add(\"1100\",\"-------\") \n\tt.add(\"1101\",\"-------\") \n\tt.add(\"1110\",\"-------\") \n\tt.add(\"1111\",\"-------\") \n\t# Outputs minimized independently\n\tsols = t.solve()\n\tprint(sols.printN( xnames=['b3','b2','b1','b0'], ynames=['a','b','c','d','e','f','g']))\n```\n\nOutput:\n\n\n```txt\n\tg \u003c= b2'.b1 + b2.b1' + b2.b0' + b3\n\tf \u003c= b1'.b0' + b2.b1' + b2.b0' + b3\n\te \u003c= b2'.b0' + b1.b0'\n\td \u003c= b2.b1'.b0 + b2'.b0' + b2'.b1 + b1.b0'\n\tc \u003c= b1' + b0 + b2\n\tb \u003c= b1'.b0' + b1.b0 + b2'\n\ta \u003c= b2'.b0' + b1.b0 + b2.b0 + b3\n```\n\n## Finite-state machines\n\nFor finite-state machines, a FSM object is provided.\n\nThe advantages of FSM objects are:\n\n\t1. States can have meaningful names.\n\t2. It is possible to try different state code assignments to evaluate result complexity.\n\n\n###  Binary counter with hold\n\n```python\n\t# Finite-state machine\n\t# x=0 =\u003e hold\n\t# x=1 =\u003e binary up count\n\t# y = 1 in states: e1 and e3\n\timport logicmin\n\t# state labels\n\tstates = ['e0','e1','e2','e3']\n\t# 2 bits for state codes\n\t# 1 input variable\n\t# 1 output variable\n\tm = logicmin.FSM(states,2,1,1)\n\t# transition table\n\tm.add('0','e0','e0','0')\n\tm.add('1','e0','e1','0')\n\tm.add('0','e1','e1','1')\n\tm.add('1','e1','e2','1')\n\tm.add('0','e2','e2','0')\n\tm.add('1','e2','e3','0')\n\tm.add('0','e3','e3','1')\n\tm.add('1','e3','e0','1')\n\t# asign code to states\n\tcodes = {'e0':0,'e1':1,'e2':2,'e3':3}\n\tm.assignCodes(codes)\n\t# solve with D flip-flops\n\tsols = m.solveD()\n\t# print solution with input and output names\n\tprint(sols.printN(xnames=['X','Q1','Q0'], ynames=['D1','D0','Y']))\n```\n\nOutput:\n\n```txt\n\tY \u003c= Q0\n\tD0 \u003c= X'.Q0 + X.Q0'\n\tD1 \u003c= X.Q1'.Q0 + X'.Q1 + Q1.Q0'\n```\n\n\n### Other examples\n\nLook into `examples` directory.\n\n### Install\n\n\n```sh\n \tpip install logicmin\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdreylago%2Flogicmin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdreylago%2Flogicmin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdreylago%2Flogicmin/lists"}