14. Complete the Authentication Controller

Loading simulator…

The two provided state flip-flops use the following meanings:

StateMeaning
00Waiting for first digit
01First digit 7 accepted
10Digits 78 accepted
11Unlocked

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 StateInput EventNext StateD1D0INVALIDUNLOCK
00No press000000
00Digit 7010100
00Other digit000010
01No press010100
01Digit 8101000
01Other digit000010
10No press101000
10Digit 4111100
10Other digit000010
11Any event111101

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.