{"id":20796871,"url":"https://github.com/hkproj/karno","last_synced_at":"2025-04-09T19:23:50.463Z","repository":{"id":94993891,"uuid":"113616830","full_name":"hkproj/karno","owner":"hkproj","description":"Karnaugh map solver that works with any number of variables","archived":false,"fork":false,"pushed_at":"2018-01-19T10:35:08.000Z","size":33,"stargazers_count":4,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-23T21:22:40.288Z","etag":null,"topics":["karnaugh","karnaugh-map","karnaugh-map-simplifier","karnaugh-map-solver"],"latest_commit_sha":null,"homepage":"","language":"C#","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/hkproj.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"publiccode":null,"codemeta":null}},"created_at":"2017-12-08T20:59:28.000Z","updated_at":"2024-11-21T00:32:33.000Z","dependencies_parsed_at":"2023-04-05T03:16:17.673Z","dependency_job_id":null,"html_url":"https://github.com/hkproj/karno","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hkproj%2Fkarno","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hkproj%2Fkarno/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hkproj%2Fkarno/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hkproj%2Fkarno/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hkproj","download_url":"https://codeload.github.com/hkproj/karno/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248096144,"owners_count":21046983,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["karnaugh","karnaugh-map","karnaugh-map-simplifier","karnaugh-map-solver"],"created_at":"2024-11-17T16:29:18.790Z","updated_at":"2025-04-09T19:23:50.455Z","avatar_url":"https://github.com/hkproj.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Karno\nKarno is a Karnaugh map solver that works with any number of variables. It includes an algorithm to minimize a k-map and one to test the output SOP expression against all possible inputs for the function.\n\n# Usage\n\nGiven a 4-variables function having the following truth table\n\nNumber | A | B | C | D | f(A, B, C, D)\n--- | --- | --- | --- | --- | ---\n0 | 0 | 0 | 0 | 0 | 0\n1 | 0 | 0 | 0 | 1 | 0\n2 | 0 | 0 | 1 | 0 | 0\n3 | 0 | 0 | 1 | 1 | 1\n4 | 0 | 1 | 0 | 0 | 1\n5 | 0 | 1 | 0 | 1 | 1\n6 | 0 | 1 | 1 | 0 | 1\n7 | 0 | 1 | 1 | 1 | 1\n8 | 1 | 0 | 0 | 0 | 0\n9 | 1 | 0 | 0 | 1 | 0\n10 | 1 | 0 | 1 | 0 | –\n11 | 1 | 0 | 1 | 1 | –\n12 | 1 | 1 | 0 | 0 | –\n13 | 1 | 1 | 0 | 1 | –\n14 | 1 | 1 | 1 | 0 | –\n15 | 1 | 1 | 1 | 1 | –\n\nThe code to solve the corresponding k-map is:\n\n```csharp\n// the first argument is the number of variables \n// the second argument is on-set (each number represents the corresponding binary string)\n// the third argument is the dc-set (each number represents the corresponding binary string)\nvar map = new KMap(4, new HashSet\u003clong\u003e() { 3, 4, 5, 6, 7 }, new HashSet\u003clong\u003e() { 10, 11, 12, 13, 14, 15 });\nmap.PrintCoverages(true); // Print only those with min cost\nmap.PrintTestResults(); // Test expression against all possible inputs\n```\n\nThis code will produce the following output:\n\n```\nCoverage: 3\n0011 - 0111 - 1011 - 1111 - Essential\n0100 - 0101 - 0110 - 0111 - 1100 - 1101 - 1110 - 1111 - Essential\nSOP: CD + B\nTEST: OK\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhkproj%2Fkarno","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhkproj%2Fkarno","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhkproj%2Fkarno/lists"}