Prévia do material em texto
Step 1 of 1 7.045E The ABEL program for the clocked synchronous state machine of Exercise 7.44 is as follows: module SMEX title 'ABEL version of a state machine' " Input and Outputt pins CLOCK, RESET_L, INIT, X pin; Q1, Q2, Q3 pin istype 'reg'; Z pin istype 'com'; " Definitions QSTATE = [Q1, Q2, Q3]; " State variables = [0, 0, 0]; S1 = [0, 0, 1]; SE0 = [1, 0, 0]; SE1 = [1, 0, 1]; SZ0 = [0, 1, 1]; SZ1 = [1, 1, 1]; RESET = !RESET_L; state_diagram QSTATE state if RESET then else if (INIT==0) & (X==0) then SE0 else if (INIT==0) & (X==1) then SE1 else SZ1; state S1: if RESET then S0 else if (INIT==0) & (X==0) then else if (INIT==0) & (X==1) then SE1 else SZ1; state SE0: if RESET then else if (INIT==0) & (X==0) then SZ0 else if (INIT==0) & (X==1) then SE1 else SZ1; state SE1: if RESET then S0 else if (INIT==0) & (X==0) then SE0 else if (INIT==0) & (X==1) then SZ0 else SZ1; state SZ0: if RESET then else if (INIT==0) then SZ0 else SZ1; state SZ1: if RESET then S0 else if (INIT==0) & (X==0) then S0 else if (INIT==0) & (X==1) then S1 else SZ1; equations QSTATE.CLK = CLOCK; Z = (QSTATE==SZ1); end SMEX