Loading simulator…
The provided five-flip-flop register uses the following one-hot assignment. The completion logic drives each existing D input; the register itself is not rebuilt.
| State | Q4Q3Q2Q1Q0 |
|---|---|
| CLOSE | 00001 |
| OPENING | 00010 |
| OPEN | 00100 |
| CLOSING | 01000 |
| WAIT | 10000 |
X means either HIGH or LOW; the input does not affect that row.
| Current State | obs | opn | cls | cof | Next State | D4D3D2D1D0 |
|---|---|---|---|---|---|---|
| CLOSE | X | 0 | X | X | CLOSE | 00001 |
| CLOSE | X | 1 | X | X | OPENING | 00010 |
| OPENING | X | X | X | X | OPEN | 00100 |
| OPEN | X | X | 0 | X | OPEN | 00100 |
| OPEN | X | X | 1 | X | CLOSING | 01000 |
| CLOSING | 1 | X | X | X | WAIT | 10000 |
| CLOSING | 0 | 1 | X | X | WAIT | 10000 |
| CLOSING | 0 | 0 | X | X | CLOSE | 00001 |
| WAIT | X | X | X | 0 | WAIT | 10000 |
| WAIT | X | X | X | 1 | OPENING | 00010 |
The missing combinational next-state networks are:
D_WAIT = Q3·(obs + opn) + Q4·cof'
D_CLOSING = Q2·cls
D_OPEN = Q1 + Q2·cls'
D_OPENING = Q0·opn + Q4·cof
D_CLOSE = opn'·(Q0 + Q3·obs')
The learner also adds the 2-bit timeout section, which is not pre-placed in the template.
Both counter flip-flops are asynchronously cleared outside WAIT.
In EWsim, their active-LOW clear inputs are nClear0 and nClear1.
While WAIT = 1, the counter advances 00 → 01 → 10 → 11. The logical equations are:
Clear0' = Q4
Clear1' = Q4
cof = C1·C0
With this arrangement, cof requests OPENING after three complete counter increments.
The exact clock-edge alignment must match the final validation sequence.
The five supplied state outputs are direct Moore decodes of the one-hot register:
CLOSE = Q0 OPENING = Q1 OPEN = Q2
CLOSING = Q3 WAIT = Q4