lecture15.ppt

Download Report

Transcript lecture15.ppt

State Machine Homework
Solution
oPUSH=0
/iBLK
oPUSH=0
sWAIT1
iBLK
S0
sPASS2
sPUSH1
iBLK
iEXT
sWAIT2
oPUSH=0
oPUSH=1
sRET1
iRET/iBLK
oPUSH=0
Big State Machine Example
sBLKIDLE
iBLKIN
vBLKNUM>=6
vBLKNUM=0
load BLKTBL[BLKNUM] into vCURRBLK
sBLKWAIT
sBLKGO
/iBLKIN
increment vBLKNUM
vSLOTNUM = 0
vSLOTNUM>=4
vBLKNUM<6
vSLOTNUM<4
cCUTRET
sCUTDONE
sSLOTINCR
sSLOTCHK
/vCURRSLOT.0
increment vSLOTNUM
load vCURRBLK, shift right by vSLOTNUM,
store into vCURRSLOT
vCURRSLOT.0
cCUTEXT
oCUT=1
sCUTGO
sSLOTPOS output position
sSLOTPWAIT
cPOSDN
/cPOSDN
oPOSSTART=1
Big State Machine Example
vBLKNUM=0
iBLKIN
sBLKIDLE
load BLKTBL[BLKNUM] into vCURRBLK
increment vBLKNUM
sBLKGO
vSLOTNUM = 0
/iBLKIN
sBLKWAIT
vSLOTNUM>=4
vBLKNUM>=6
sBLKGO2
vSLOTNUM<4
cCUTRET
sCUTDONE
vBLKNUM<6
sSLOTINCR
sSLOTCHK
load vCURRBLK, shift right by vSLOTNUM,
store into vCURRSLOT
/vCURRSLOT.0
increment vSLOTNUM
vCURRSLOT.0
cCUTEXT
sCUTGO
sSLOTPOS
cPOSDN
oCUT=1
output position