Write the primitive flow table of a release detector with no clock, merge its compatible rows, and count the rows left.
Hardware context: An asynchronous controller that must behave the same on every chip, whatever its loop delays. Write the primitive flow table of a two-hand release detector and merge its compatible rows.
A two-hand press control has no clock. The press may run only after the operator lets go of button a while still holding button b. Letting go of b stops it.
This is an Implement problem with no logic to write. Write one constant per entry of the primitive flow table, then the number of compatible pairs and of merged rows.
The first three entries are worked examples. The check compares every constant with a table built from the word rule and names the first wrong one.
Signals in the Timeline
| Signal | Width | Role |
|---|---|---|
question | 8 | input of each check |
Full specification
| Rule | Detail |
|---|---|
| Inputs | a and b. Fundamental mode: only one input changes at a time, and the circuit settles before the next change. |
| Output z | z rises when a falls while b = 1. z falls when b falls. Every other change leaves z as it was. |
| Start | ab = 00, z = 0. |
| Row numbers | One row per stable total state (ab, z) that can be reached. Number them by ab in the order 00, 01, 11, 10, then z = 0 before z = 1. |
| Entries | Columns ab = 00, 01, 11, 10. An entry is the row the circuit settles in; the row's own column holds its own number. Write 7 for a dash. |
| Compatible | Two rows are compatible when their z agree and no column has two different entries. A dash agrees with anything. |
| Constant | What to write |
|---|---|
| N1_AB00 | The entry of row 1 under ab = 00: the row it goes to, or 7 for a dash. |
| N1_AB01 | The entry of row 1 under ab = 01: the row it goes to, or 7 for a dash. |
| N1_AB11 | The entry of row 1 under ab = 11: the row it goes to, or 7 for a dash. |
| N1_AB10 | The entry of row 1 under ab = 10: the row it goes to, or 7 for a dash. |
| N2_AB00 | The entry of row 2 under ab = 00: the row it goes to, or 7 for a dash. |
| N2_AB01 | The entry of row 2 under ab = 01: the row it goes to, or 7 for a dash. |
| N2_AB11 | The entry of row 2 under ab = 11: the row it goes to, or 7 for a dash. |
| N2_AB10 | The entry of row 2 under ab = 10: the row it goes to, or 7 for a dash. |
| N3_AB00 | The entry of row 3 under ab = 00: the row it goes to, or 7 for a dash. |
| N3_AB01 | The entry of row 3 under ab = 01: the row it goes to, or 7 for a dash. |
| N3_AB11 | The entry of row 3 under ab = 11: the row it goes to, or 7 for a dash. |
| N3_AB10 | The entry of row 3 under ab = 10: the row it goes to, or 7 for a dash. |
| N4_AB00 | The entry of row 4 under ab = 00: the row it goes to, or 7 for a dash. |
| N4_AB01 | The entry of row 4 under ab = 01: the row it goes to, or 7 for a dash. |
| N4_AB11 | The entry of row 4 under ab = 11: the row it goes to, or 7 for a dash. |
| N4_AB10 | The entry of row 4 under ab = 10: the row it goes to, or 7 for a dash. |
| N5_AB00 | The entry of row 5 under ab = 00: the row it goes to, or 7 for a dash. |
| N5_AB01 | The entry of row 5 under ab = 01: the row it goes to, or 7 for a dash. |
| N5_AB11 | The entry of row 5 under ab = 11: the row it goes to, or 7 for a dash. |
| N5_AB10 | The entry of row 5 under ab = 10: the row it goes to, or 7 for a dash. |
| N6_AB00 | The entry of row 6 under ab = 00: the row it goes to, or 7 for a dash. |
| N6_AB01 | The entry of row 6 under ab = 01: the row it goes to, or 7 for a dash. |
| N6_AB11 | The entry of row 6 under ab = 11: the row it goes to, or 7 for a dash. |
| N6_AB10 | The entry of row 6 under ab = 10: the row it goes to, or 7 for a dash. |
| PRIM_ROWS | How many rows the primitive flow table has. |
| COMPAT_PAIRS | How many pairs of rows are compatible. |
| MERGED_ROWS | The fewest rows after merging compatible rows. |
Examples
Example 1
Worked Example: Row 1, Ab = 00- Input
the entry of row 1 under ab = 00: the row it goes to, or 7 for a dash
- Output
n1_ab00 = 1
Row 1 is the start, ab = 00 with z = 0. Its own column holds its own number, 1.
Example 2
Worked Example: Row 1, Ab = 01- Input
the entry of row 1 under ab = 01: the row it goes to, or 7 for a dash
- Output
n1_ab01 = 2
From ab = 00, b rises with a = 0. z stays 0, and the circuit settles in the row of ab = 01, z = 0: row 2.
Example 3
Worked Example: Row 1, Ab = 11- Input
the entry of row 1 under ab = 11: the row it goes to, or 7 for a dash
- Output
n1_ab11 = 7
From ab = 00, reaching 11 would change both inputs at once. Fundamental mode forbids that: a dash, written 7.
Constraints and Contract
- Keep the module name answer and the names of the constants.
- Entries are 1 to 7; counts are 0 to 15.
Hints
Hint 1
List the total states (ab, z) that are stable: in which columns can z be 1, and in which only 0? Then number them by the rule.
Hint 2
From each row, change one input at a time and ask where z ends. The column that changes both inputs is a dash.
Hint 3
For merging, every pair inside one merged row must be compatible. A chain of compatible pairs is not enough.
What the grader checks: The check reads each constant and compares it with a table built in JavaScript from the word rule. It cannot see how a value was found.
27 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