G2.8.2 Minterms to Maxterms

EasyImplementIcarus · browser samples / server checksReview the topic

Read the minterm numbers of a sum of full product terms, and convert them into the maxterm list of the same function.

Hardware context: A measured four-input decoder with two unused input rows, and a legacy fault flag written as seven full product terms. Convert a full sum of products into its product of maxterms.

A legacy design gives a fault flag f as a sum of seven full product terms of a, b, c and d. The new library builds functions from sum terms, so the team needs f as a product of maxterms.

This is an Implement problem with no logic in it. Write two 16-bit masks: the minterms of f and the maxterms of f. Bit m is 1 when row m is in the list.

The row number m is the input abcd read as a binary number, with a as the most significant bit.

Signals in the Timeline

SignalWidthRole
item8input of each check
Full specification
The flag as given (ab is AND, a + b is OR, a' is NOT)
f = a'b'c'd + a'bc'd' + a'bcd' + ab'c'd + ab'cd + abc'd' + abcd'
ListHolds the rows where
Minterms of ff = 1
Maxterms of ff = 0
How a mask is written: rows 0 and 3 listed
localparam logic [15:0] MAXTERMS = 16'h0009;   // bits 3 and 0 set

Keep the module name answer and its two outputs. Change only the two constants.

Examples

Example 1

One Minterm per Product Term
Input
the minterm mask
Output
one_bit_per_product = yes

f is written as seven full product terms, so its minterm mask has seven bits set.

Example 2

The Two Lists Split the Rows
Input
both masks
Output
lists_split_all_rows = yes

Every row is a 1 or a 0 of f. So each row is in exactly one of the two lists.

Example 3

Row 0 Is a Maxterm
Input
abcd = 0000
Output
in_maxterm_list = yes

No product term is a'b'c'd', so f is 0 for abcd = 0000. Row 0 is in the maxterm list.

Constraints and Contract

  • Keep the module name answer and its two outputs.
  • Each mask is 16 bits. Bit m stands for row m.

Hints

Hint 1

Each product term is one minterm. Read it as a row: a b' c' d is abcd = 1001, row 9.

Hint 2

The maxterms are the rows that are not minterms. There is no other rule.

Hint 3

Check the count: the two lists together hold all sixteen rows, each once.

What the grader checks: The check compares the minterm mask as a whole with the list from the expression. It compares each of the 16 bits of the maxterm mask. It tests your conversion, not a circuit.

20 checks on Icarus · browser samples / server checks. Run the examples first, then check the full regression. Full checks use the server judge. Downloads contain public samples only. A passing result establishes the tested cases, not a proof for all possible inputs.

See all 2 steps and the final capstone

Report a problem with this page

Your code SystemVerilogSaved locally
Ln 1, Col 1Tab indents · Ctrl/⌘ + Enter runs samples
Not run yet

One Minterm per Product Term

Input
the minterm mask
Expected output
one_bit_per_product = yes

f is written as seven full product terms, so its minterm mask has seven bits set.

Run samples executes all 3 public checks. Check all tests runs 20 checks on the server.

Icarus · browser samples / server checks