G2.9.1 What Does This Circuit Compute?

EasyImplementIcarus · browser samples / server checksReview the topic

Analyse a five-gate netlist net by net, and give the column of one internal net and the minterm list of the output.

Hardware context: An undocumented five-gate block that drives a status line in an old controller. Analyse a five-gate netlist and give an internal column and the output minterms.

An undocumented block in an old controller drives a status line y from four inputs. Before anyone changes it, the team wants its truth table.

This is an Implement problem with no logic in it. Analyse the netlist below. Give two 16-bit masks: the rows where the internal net n3 is 1, and the minterms of y.

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
circuit.sv: the netlist (read-only). A gate line is the gate type, a name, then (output, inputs).
// circuit.sv: the netlist under analysis (read-only).
module circuit (input logic a, b, c, d, output wire y);
  wire n1, n2, n3, n4;
  nand g1 (n1, a, b);
  nor  g2 (n2, c, d);
  xor  g3 (n3, n1, c);
  and  g4 (n4, a, n2);
  or   g5 (y, n3, n4);
endmodule
ConstantWhat to write
N3_ROWSBit m is 1 when the net n3 is 1 for abcd = m.
MINTERMSBit m is 1 when y is 1 for abcd = m.

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

Examples

Example 1

No Value May Stay Unknown
Input
the two masks
Output
no_unknown_values = yes

Both masks must be known 16-bit values.

Example 2

The OR Gate Keeps Every Row of n3
Input
the two masks
Output
or_gate_keeps_n3 = yes

y = n3 + n4. Wherever n3 is 1, y is 1 too, whatever n4 does.

Example 3

Rows That Only n4 Can Add
Input
the two masks
Output
extra_rows_need_n4 = yes

n4 = a·n2 needs a = 1 and c = d = 0: rows 8 and 12. Any other row of y must come from n3.

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

Write the equation of each net in level order: n1 and n2 first, then n3 and n4, then y.

Hint 2

Fill a table with one column per net. Check two rows of each column by hand before you go on.

Hint 3

A mask sets bit m for every row m where the column is 1. Write it in hexadecimal.

What the grader checks: The check compares the n3 mask as a whole, and each of the 16 bits of the y mask. The expected columns come from the netlist, evaluated in JavaScript. It tests your analysis, not a circuit of yours.

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 1 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

No Value May Stay Unknown

Input
the two masks
Expected output
no_unknown_values = yes

Both masks must be known 16-bit values.

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

Icarus · browser samples / server checks