Loading simulator…
The two provided state flip-flops use the following meanings:
| State | Meaning |
|---|---|
00 | Waiting for first digit |
01 | First digit 7 accepted |
10 | Digits 78 accepted |
11 | Unlocked |
The supplied front end generates these event signals; the learner does not rebuild this logic:
K7 = D_valid'·C_valid·B_valid·A_valid
K8 = D_valid·C_valid'·B_valid'·A_valid'
K4 = D_valid'·C_valid·B_valid'·A_valid'
NP = D_valid'·C_valid'·B_valid'·A_valid'
PRESS = NP'
The excitation table is:
| Present State | Input Event | Next State | D1 | D0 | INVALID | UNLOCK |
|---|---|---|---|---|---|---|
00 | No press | 00 | 0 | 0 | 0 | 0 |
00 | Digit 7 | 01 | 0 | 1 | 0 | 0 |
00 | Other digit | 00 | 0 | 0 | 1 | 0 |
01 | No press | 01 | 0 | 1 | 0 | 0 |
01 | Digit 8 | 10 | 1 | 0 | 0 | 0 |
01 | Other digit | 00 | 0 | 0 | 1 | 0 |
10 | No press | 10 | 1 | 0 | 0 | 0 |
10 | Digit 4 | 11 | 1 | 1 | 0 | 0 |
10 | Other digit | 00 | 0 | 0 | 1 | 0 |
11 | Any event | 11 | 1 | 1 | 0 | 1 |
The missing D-input logic is:
D1 = Q1'·Q0·K8
+ Q1·(Q0 + NP + K4)
D0 = Q0'·(Q1'·K7 + Q1·K4)
+ Q0·(Q1 + NP)
The missing output logic is:
UNLOCK = Q1·Q0
CORRECT = Q1'·Q0'·K7
+ Q1'·Q0·K8
+ Q1·Q0'·K4
INVALID = PRESS·CORRECT'·(Q1·Q0)'
UNLOCK is a Moore output and remains HIGH in state 11. INVALID is a Mealy output because it depends on the present state and the current key event. The third accepted term uses K4, so 784 unlocks while 787 is treated as an incorrect third digit and returns progress to 00. After unlock, the Q1Q0 = 11 retention terms dominate all later key events until nRESET is asserted.