Ohmforge Logic Minimiser (multi-output, Petrick, K-map groups)
Truth table with several outputs → all minimal SOP/POS forms, grouped K-maps, gates and Verilog.
How it works
Paste a truth table with up to 6 inputs and 8 outputs (rows with - for "either value", x for don't care) or a list of equations. For each output you get every minimum sum of products or product of sums (Quine–McCluskey primes and Petrick's method), the Karnaugh map with the chosen groups drawn in, the prime implicant chart, a two-level gate schematic, a Verilog module and a simulator netlist that is simulated and compared with the table. Compare mode checks whether two Boolean expressions are equivalent and lists counterexamples.
- Truth table: every row with - in an input stands for both values; rows not listed are 0 or don't care (your choice); a row given twice with different outputs is an error that names both lines.
- Quine–McCluskey: for each output the 1 rows and don't cares are merged into prime implicants (the 0 rows and don't cares for the product of sums).
- Petrick's method: "each 1 row must be covered" is written as a product of sums over the primes that are not essential and multiplied out with absorption (X + XY = X); every product with the fewest terms, then the fewest literals, is a minimum cover. The expansion is pruned with the cost of a branch-and-bound cover, which cannot remove a minimum; above 20,000 partial products only that one cover is returned and marked as incomplete.
- Karnaugh maps use Gray-code order; 5 and 6 inputs are drawn as 2 or 4 maps selected by the first inputs. Each group of the chosen cover is a numbered, coloured outline (groups that wrap around the edge appear as pieces on both sides).
- The gate schematic and the Verilog module realise the chosen cover with NOT, AND and OR gates. The same cover is written as a netlist for the logic simulator (shared inverters and terms, 1 time unit per gate), simulated for every input row and compared with the table, so the result is checked independently of the minimiser.
- Equivalence checks evaluate both sides for every input combination (don't-care rows excluded when checking against the table).
Each output is minimised on its own as a two-level circuit (terms, then literals); shared terms between outputs are reused in the netlist but not optimised for. Multi-level, XOR-based or FPGA LUT mappings can be smaller. Simulation and learning, not FPGA synthesis.
Sources
- S. R. Petrick, A Direct Determination of the Irredundant Forms of a Boolean Function from the Set of Prime Implicants, AFCRC-TR-56-110, 1956 (Air Force Cambridge Research Center)
- E. J. McCluskey, Minimization of Boolean Functions, Bell System Technical Journal 35(6), 1956 (Bell Labs / Wiley)
- M. Karnaugh, The Map Method for Synthesis of Combinational Logic Circuits, Trans. AIEE 72(5), 1953 (IEEE)
Part of Ohmforge
-
Ohmforge Virtual electronics workbench
Draw a circuit, switch it on, and measure it with real-feeling bench instruments.
Related tools
- Ohmforge Truth Table & Logic Minimiser – Boolean expression or minterms → truth table, minimal SOP/POS, Karnaugh map and a gate circuit.
- Ohmforge Logic Simulator (VCD) – Gate-level netlist + stimuli → event-driven waveforms, timing diagram, VCD and truth table.
How to use the Ohmforge Logic Minimiser
Minimise a truth table with several outputs and don't cares, see every minimum cover, read the grouped Karnaugh map and check your own answer.
What it is for
You have a truth table — a 7-segment decoder, a small controller, a homework function — and you want the smallest two-level circuit for each output. This tool takes the table as text, with up to six inputs and eight outputs, and returns the minimal sum of products (or product of sums) for every output.
Many functions have several smallest answers, and the tool lists all of them, so you can see why your textbook's answer differs from yours and both are right.
A second mode compares two Boolean expressions and lists the input rows where they differ. It is for learning and checking logic, not FPGA synthesis: each output is minimised on its own as AND–OR (or OR–AND) logic.
Worked example
Paste this table (rows not listed are 0, x marks a don't care):
A B C D | F
0 1 0 0 | 1
1 0 0 0 | 1
1 0 1 0 | 1
1 0 1 1 | 1
1 1 0 0 | 1
1 1 1 1 | 1
1 0 0 1 | x
1 1 1 0 | x
The 1 rows are 4, 8, 10, 11, 12 and 15; rows 9 and 14 are don't cares. The tool finds four prime implicants and marks two of them essential: A·C (cube 1-1-) and B·C'·D' (cube -100). Row 8 can then be covered by A·B' or by A·D' at the same cost, so the result lists two minimum covers, each with 3 terms and 7 literals:
- F = A·B' + A·C + B·C'·D'
- F = A·C + A·D' + B·C'·D'
The generated netlist has 7 gates; all 16 input rows were simulated and match the table.
Now type your own attempt into Check against: F = BC'D' + AB' + AD'. The tool compares it on the 14 rows that are not don't cares and finds one wrong row, row 15 (1111): the table says 1, your expression gives 0. You forgot A·C. Switch Minimal form to product of sums and the answer becomes (A + B)·(A + C')·(C + D').
How to read the result
- Minimal sums of products (or products of sums): the first minimum cover of each output.
- Karnaugh map: Gray-coded rows and columns, cell numbers in the corner, × for don't cares. Each group of the chosen cover is a numbered outline; a group that wraps around an edge is drawn as pieces on both sides. Five and six inputs give two or four maps.
- Minimum covers table: every cover of equal cost, found with Petrick's method. If the search hits its limit, only one cover is listed and the caption says so.
- Prime implicant chart: which prime covers which 1 row, and which primes are essential.
- Gate circuit: NOT gates on the inputs, one AND per product, one OR. The same cover is exported as Verilog and as a netlist for the logic simulator.
Tips and common mistakes
- The first input is the most significant bit of the row number: in
A B C D, row 4 is0100. - A
-in an input column covers both values, so1 1 - - | x x xmarks four rows as don't care in one line. - Set Rows not listed to don't care when you only want to list the rows that matter.
- Output names must not be Verilog keywords (
and,wire…), and input names are a letter with an optional number, becauseABmeans A·B in expressions.
FAQ
Why does my solution differ from the tool's?
Check the minimum covers table. If your expression is listed there, both are equally small. If not, put it into Check against to see the rows where it is wrong.
Does it share terms between outputs?
Identical terms are built once in the exported netlist, but each output is minimised on its own; a true multi-output minimiser could sometimes save more gates.
Can I open the result in Ohmforge?
Yes. Instruments → Logic designer… in Ohmforge uses the same engine. From there you can add the gate circuit to the schematic or open it in the logic simulator.
How many inputs are supported?
Up to six (the practical limit for Karnaugh maps); the compare mode accepts up to 16 variables.
Guide last updated:
For scripts and AI agents
- JSON API:
POST https://ohmforgelogicminimizer.usefulweb.app/api/v1/calculate(same calculation as this page) - Interface description: OpenAPI 3.1 · AI guide: llms.txt
- MCP server (Streamable HTTP):
https://ohmforgelogicminimizer.usefulweb.app/mcp· tool nameohmforge_logic_minimizer
Example request
curl -s -X POST https://ohmforgelogicminimizer.usefulweb.app/api/v1/calculate \
-H 'content-type: application/json' \
-d '{"mode":"table","table":"# name: BCD to 7-segment (a, b, c)\nB3 B2 B1 B0 | a b c\n0 0 0 0 | 1 1 1\n0 0 0 1 | 0 1 1\n0 0 1 0 | 1 1 0\n0 0 1 1 | 1 1 1\n0 1 0 0 | 0 1 1\n0 1 0 1 | 1 0 1\n0 1 1 0 | 1 0 1\n0 1 1 1 | 1 1 1\n1 0 0 0 | 1 1 1\n1 0 0 1 | 1 1 1\n1 0 1 - | x x x\n1 1 - - | x x x\n"}'