{"id":95,"date":"2025-07-31T02:54:19","date_gmt":"2025-07-31T02:54:19","guid":{"rendered":"https:\/\/blogs.stei.itb.ac.id\/waskita\/?p=95"},"modified":"2025-07-31T02:56:01","modified_gmt":"2025-07-31T02:56:01","slug":"solusi-minimisasi-tabular","status":"publish","type":"post","link":"https:\/\/blogs.stei.itb.ac.id\/waskita\/2025\/07\/31\/solusi-minimisasi-tabular\/","title":{"rendered":"Solusi Minimisasi Tabular"},"content":{"rendered":"\n<p>Prompt:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>create python script to solve logical minimization with quine mc cluskey algorithm.\nparameters:\nnumber_of_bits = 5\nminterms = &#91;4, 5, 7, 12, 15, 20, 21, 23, 28, 30]\nxterms = &#91;6, 14, 22, 26, 31]<\/code><\/pre>\n\n\n\n<p>Hasil: <a href=\"https:\/\/claude.ai\/share\/c0418058-d739-488b-bd63-ddc09af78091\">https:\/\/claude.ai\/share\/c0418058-d739-488b-bd63-ddc09af78091<\/a><\/p>\n\n\n\n<p>Output dari program python:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># python qq.py\nQUINE-MCCLUSKEY ALGORITHM\n==================================================\nStarting Quine-McCluskey Algorithm\nNumber of bits: 5\nMinterms: &#91;4, 5, 7, 12, 15, 20, 21, 23, 28, 30]\nDon't cares: &#91;6, 14, 22, 26, 31]\n--------------------------------------------------\nStep 1: Initial grouping by number of ones\nGroup 1: &#91;('00100', &#91;4])]\nGroup 2: &#91;('00101', &#91;5]), ('01100', &#91;12]), ('10100', &#91;20]), ('00110', &#91;6])]\nGroup 3: &#91;('00111', &#91;7]), ('10101', &#91;21]), ('11100', &#91;28]), ('01110', &#91;14]), ('10110', &#91;22]), ('11010', &#91;26])]\nGroup 4: &#91;('01111', &#91;15]), ('10111', &#91;23]), ('11110', &#91;30])]\nGroup 5: &#91;('11111', &#91;31])]\n\nStep 2.1: Combining terms\n  New Group 1: &#91;('0010-', &#91;4, 5]), ('0-100', &#91;4, 12]), ('-0100', &#91;4, 20]), ('001-0', &#91;4, 6])]\n  New Group 2: &#91;('001-1', &#91;5, 7]), ('-0101', &#91;5, 21]), ('-1100', &#91;12, 28]), ('011-0', &#91;12, 14]), ('1010-', &#91;20, 21]), ('1-100', &#91;20, 28]), ('101-0', &#91;20, 22]), ('0011-', &#91;6, 7]), ('0-110', &#91;6, 14]), ('-0110', &#91;6, 22])]\n  New Group 3: &#91;('0-111', &#91;7, 15]), ('-0111', &#91;7, 23]), ('101-1', &#91;21, 23]), ('111-0', &#91;28, 30]), ('0111-', &#91;14, 15]), ('-1110', &#91;14, 30]), ('1011-', &#91;22, 23]), ('1-110', &#91;22, 30]), ('11-10', &#91;26, 30])]\n  New Group 4: &#91;('-1111', &#91;15, 31]), ('1-111', &#91;23, 31]), ('1111-', &#91;30, 31])]\n\nStep 2.2: Combining terms\n  New Group 1: &#91;('-010-', &#91;4, 5, 20, 21]), ('001--', &#91;4, 5, 6, 7]), ('--100', &#91;4, 12, 20, 28]), ('0-1-0', &#91;4, 6, 12, 14]), ('-01-0', &#91;4, 6, 20, 22])]\n  New Group 2: &#91;('-01-1', &#91;5, 7, 21, 23]), ('-11-0', &#91;12, 14, 28, 30]), ('101--', &#91;20, 21, 22, 23]), ('1-1-0', &#91;20, 22, 28, 30]), ('0-11-', &#91;6, 7, 14, 15]), ('-011-', &#91;6, 7, 22, 23]), ('--110', &#91;6, 14, 22, 30])]\n  New Group 3: &#91;('--111', &#91;7, 15, 23, 31]), ('-111-', &#91;14, 15, 30, 31]), ('1-11-', &#91;22, 23, 30, 31])]\n\nStep 2.3: Combining terms\n  New Group 1: &#91;('-01--', &#91;4, 5, 6, 7, 20, 21, 22, 23]), ('--1-0', &#91;4, 6, 12, 14, 20, 22, 28, 30])]\n  New Group 2: &#91;('--11-', &#91;6, 7, 14, 15, 22, 23, 30, 31])]\n\nStep 2.4: Combining terms\nStep 3: Prime Implicants Found\n  PI1: 11-10 covers &#91;26, 30]\n  PI2: -01-- covers &#91;4, 5, 6, 7, 20, 21, 22, 23]\n  PI3: --1-0 covers &#91;4, 6, 12, 14, 20, 22, 28, 30]\n  PI4: --11- covers &#91;6, 7, 14, 15, 22, 23, 30, 31]\n\nStep 4: Coverage Table and Essential Prime Implicants\nCoverage Table:\nMinterm  Binary  Covered by PIs\n-------------------------\n4        00100   PI2, PI3\n5        00101   PI2\n7        00111   PI2, PI4\n12       01100   PI3\n15       01111   PI4\n20       10100   PI2, PI3\n21       10101   PI2\n23       10111   PI2, PI4\n28       11100   PI3\n30       11110   PI1, PI3, PI4\n\nEssential Prime Implicants:\n  PI2: -01-- (covers &#91;4, 5, 6, 7, 20, 21, 22, 23])\n  PI3: --1-0 (covers &#91;4, 6, 12, 14, 20, 22, 28, 30])\n  PI4: --11- (covers &#91;6, 7, 14, 15, 22, 23, 30, 31])\n\nFINAL RESULT:\n==============================\nMinimized Boolean Expression:\nF = B'C + CE' + CD\n\nTerm breakdown:\n  Term 1: -01-- \u2192 B'C\n  Term 2: --1-0 \u2192 CE'\n  Term 3: --11- \u2192 CD\n\n<\/code><\/pre>\n\n\n\n<p>Tahap selanjutnya membuat dengan NAND gates:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Create iterative python code to find minimal implementation of the following boolean equation with 2 input NAND gates only .\nF = B'C + CE' + CD<\/code><\/pre>\n\n\n\n<p>Hasil: <a href=\"https:\/\/claude.ai\/public\/artifacts\/99ce4712-ab81-4f9e-8ead-2a25bee86cda\">https:\/\/claude.ai\/public\/artifacts\/99ce4712-ab81-4f9e-8ead-2a25bee86cda<\/a><\/p>\n\n\n\n<p>Output program python:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># python  min.py\nBOOLEAN FUNCTION IMPLEMENTATION WITH 2-INPUT NAND GATES\n======================================================================\nFunction: F = B'C + CE' + CD\n\nStep-by-Step Conversion to NAND Gates\n==================================================\nOriginal: F = B'C + CE' + CD\n\nStep 1: Apply De Morgan's law\nF = ((B'C + CE' + CD)')'\nF = ((B'C)' \u00b7 (CE')' \u00b7 (CD)')'\n\nStep 2: Convert each product term to NAND form\nFor any product AB: AB = (A NAND B)' = (A NAND B) NAND (A NAND B)\n\nB'C where B' = B NAND B:\n  B'C = ((B NAND B) NAND C) NAND ((B NAND B) NAND C)\n\nCE' where E' = E NAND E:\n  CE' = (C NAND (E NAND E)) NAND (C NAND (E NAND E))\n\nCD:\n  CD = (C NAND D) NAND (C NAND D)\n\nStep 3: Convert the sum to NAND form\nA + B + C = ((A)' \u00b7 (B)' \u00b7 (C)')'\nWhere A', B', C' are complements of our product terms\n\nThis gives us the final NAND-only implementation.\n\n\nNAND Gate Circuit Implementation\n==================================================\nF = B'C + CE' + CD\n\nGate connections:\n1.  G1 = B NAND B           (generates B')\n2.  G2 = E NAND E           (generates E')\n3.  G3 = G1 NAND C          (intermediate for B'C)\n4.  G4 = G3 NAND G3         (generates B'C)\n5.  G5 = C NAND G2          (intermediate for CE')\n6.  G6 = G5 NAND G5         (generates CE')\n7.  G7 = C NAND D           (intermediate for CD)\n8.  G8 = G7 NAND G7         (generates CD)\n9.  G9 = G4 NAND G4         (generates (B'C)')\n10. G10 = G6 NAND G6        (generates (CE')')\n11. G11 = G8 NAND G8        (generates (CD)')\n12. G12 = G9 NAND G10       (intermediate)\n13. G13 = G12 NAND G12      (generates (G9\u00b7G10))\n14. G14 = G13 NAND G11      (intermediate)\n15. G15 = G14 NAND G14      (generates (G13\u00b7G11))\n16. G16 = G15 NAND G15      (final output F)\n\nTotal NAND gates required: 16\n\nTruth Table Verification\n============================================================\nB | C | D | E || Original | NAND Impl | Match\n------------------------------------------------------------\n0 | 0 | 0 | 0 ||    0     |     0     |  \u2713\n0 | 0 | 0 | 1 ||    0     |     0     |  \u2713\n0 | 0 | 1 | 0 ||    0     |     0     |  \u2713\n0 | 0 | 1 | 1 ||    0     |     0     |  \u2713\n0 | 1 | 0 | 0 ||    1     |     1     |  \u2713\n0 | 1 | 0 | 1 ||    1     |     1     |  \u2713\n0 | 1 | 1 | 0 ||    1     |     1     |  \u2713\n0 | 1 | 1 | 1 ||    1     |     1     |  \u2713\n1 | 0 | 0 | 0 ||    0     |     0     |  \u2713\n1 | 0 | 0 | 1 ||    0     |     0     |  \u2713\n1 | 0 | 1 | 0 ||    0     |     0     |  \u2713\n1 | 0 | 1 | 1 ||    0     |     0     |  \u2713\n1 | 1 | 0 | 0 ||    1     |     1     |  \u2713\n1 | 1 | 0 | 1 ||    0     |     0     |  \u2713\n1 | 1 | 1 | 0 ||    1     |     1     |  \u2713\n1 | 1 | 1 | 1 ||    1     |     1     |  \u2713\n------------------------------------------------------------\nImplementation CORRECT\n\n\u2713 Implementation verified successfully!\nThe NAND gate circuit correctly implements F = B'C + CE' + CD\n(base) root@ubuntu24:\/home\/waskita# python  z.py\n=== NAND Gate Minimization for F = B'C + CE' + CD ===\n\nGenerating truth table for F = B'C + CE' + CD...\n\nTruth Table:\nB C D E | F\n---------\n0 0 0 0 | 0\n0 0 0 1 | 0\n0 0 1 0 | 0\n0 0 1 1 | 0\n0 1 0 0 | 1\n0 1 0 1 | 1\n0 1 1 0 | 1\n0 1 1 1 | 1\n1 0 0 0 | 0\n1 0 0 1 | 0\n1 0 1 0 | 0\n1 0 1 1 | 0\n1 1 0 0 | 1\n1 1 0 1 | 0\n1 1 1 0 | 1\n1 1 1 1 | 1\n\nSearching for minimal NAND implementation (up to 8 gates)...\n\nTesting 1-gate circuits...\n\nTesting 2-gate circuits...\n\nTesting 3-gate circuits...\n  Tested 1000 circuits...\n  Tested 2000 circuits...\n  Tested 3000 circuits...\n\nTesting 4-gate circuits...\n  Tested 1000 circuits...\n  Tested 2000 circuits...\n  Tested 3000 circuits...\n  Tested 4000 circuits...\n  Tested 5000 circuits...\n  Tested 6000 circuits...\n  Tested 7000 circuits...\n  Tested 8000 circuits...\n  Tested 9000 circuits...\n  Tested 10000 circuits...\n  Tested 11000 circuits...\n  Tested 12000 circuits...\n  Tested 13000 circuits...\n  Tested 14000 circuits...\n  Tested 15000 circuits...\n  Tested 16000 circuits...\n  Tested 17000 circuits...\n  Tested 18000 circuits...\n  Tested 19000 circuits...\n  Tested 20000 circuits...\n  Tested 21000 circuits...\n  Tested 22000 circuits...\n  Tested 23000 circuits...\n  Tested 24000 circuits...\n  Tested 25000 circuits...\n  Tested 26000 circuits...\n  Tested 27000 circuits...\n  Tested 28000 circuits...\n  Tested 29000 circuits...\n  Tested 30000 circuits...\n  Tested 31000 circuits...\n  Tested 32000 circuits...\n  Tested 33000 circuits...\n\n\ud83c\udf89 Found minimal implementation with 4 NAND gates!\nGate connections: &#91;(0, 3), (1, 2), (1, 4), (5, 6)]\n\nCircuit Description:\nG1 = NAND(B, E)\nG2 = NAND(C, D)\nG3 = NAND(C, G1)\nF = NAND(G2, G3)\n\nVerification:\nB C D E | Original | NAND Circuit | Match\n-----------------------------------------\n0 0 0 0 |    0     |      0       | \u2713\n0 0 0 1 |    0     |      0       | \u2713\n0 0 1 0 |    0     |      0       | \u2713\n0 0 1 1 |    0     |      0       | \u2713\n0 1 0 0 |    1     |      1       | \u2713\n0 1 0 1 |    1     |      1       | \u2713\n0 1 1 0 |    1     |      1       | \u2713\n0 1 1 1 |    1     |      1       | \u2713\n1 0 0 0 |    0     |      0       | \u2713\n1 0 0 1 |    0     |      0       | \u2713\n1 0 1 0 |    0     |      0       | \u2713\n1 0 1 1 |    0     |      0       | \u2713\n1 1 0 0 |    1     |      1       | \u2713\n1 1 0 1 |    0     |      0       | \u2713\n1 1 1 0 |    1     |      1       | \u2713\n1 1 1 1 |    1     |      1       | \u2713\n\nAll outputs match: \u2713\n\nThe minimal NAND implementation uses 4 gates.\nEach NAND gate implements: NAND(A,B) = (AB)'\n\n=== Additional Analysis ===\nOriginal function: F = B'C + CE' + CD\nThis can be factored as: F = C(B' + E' + D)\nUsing De Morgan's laws and NAND equivalencies:\nF = C \u00b7 (B' + E' + D)\nF = C \u00b7 ((BE)' + D)  &#91;since B' + E' = (BE)']\nF = C \u00b7 (BED')'      &#91;since (BE)' + D = (BED')']\n\n=== Systematic Search Results ===\nThe algorithm systematically tests all possible NAND gate configurations\nstarting from 1 gate up to the specified maximum, ensuring the\nminimal solution is found first.\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Prompt: Hasil: https:\/\/claude.ai\/share\/c0418058-d739-488b-bd63-ddc09af78091 Output dari program python: Tahap selanjutnya membuat dengan NAND gates: Hasil: https:\/\/claude.ai\/public\/artifacts\/99ce4712-ab81-4f9e-8ead-2a25bee86cda Output program python:<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-95","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blogs.stei.itb.ac.id\/waskita\/wp-json\/wp\/v2\/posts\/95","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.stei.itb.ac.id\/waskita\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.stei.itb.ac.id\/waskita\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.stei.itb.ac.id\/waskita\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.stei.itb.ac.id\/waskita\/wp-json\/wp\/v2\/comments?post=95"}],"version-history":[{"count":2,"href":"https:\/\/blogs.stei.itb.ac.id\/waskita\/wp-json\/wp\/v2\/posts\/95\/revisions"}],"predecessor-version":[{"id":98,"href":"https:\/\/blogs.stei.itb.ac.id\/waskita\/wp-json\/wp\/v2\/posts\/95\/revisions\/98"}],"wp:attachment":[{"href":"https:\/\/blogs.stei.itb.ac.id\/waskita\/wp-json\/wp\/v2\/media?parent=95"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.stei.itb.ac.id\/waskita\/wp-json\/wp\/v2\/categories?post=95"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.stei.itb.ac.id\/waskita\/wp-json\/wp\/v2\/tags?post=95"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}