module comblckf title 'Combination-Lock State Machine' "COMBLCKF device ’P16V8R’; " Input and output pins CLOCK, RESET, X pin 1, 2, 3; X1..X7 pin 12..18 istype 'reg'; UNLK pin 19; " Sets XHISTORY = [X7..X1]; SHIFTX = [X6..X1, X]; equations XHISTORY.CLK = CLOCK; XHISTORY := !RESET & SHIFTX; UNLK = !RESET & (X == 0) & (XHISTORY == [0,1,1,0,1,1,1]); END comblckf