



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




L06 – FSMs 1
Great - Theory! Finally!Some ENGINEERING!
modified 2/23/09 09:^
6.004 – Spring 2009^
2/24/ Our New Machine
NewState
Input^
Output
k^
k
m^
n
2/24/ Must Respect Timing Assumptions!Questions:^ • ^ Constraints on T
for the logic?CD
NewState
Input^
Output
Clock^
t= ?CD,L^ t = 5nsPD,L^ t= 1nsCD,R^ t= 3nsPD,R^ t^ = 2nsS,R^ t^ = 2nsH,R^
t> 1 nsCD,L^ t= t^ + t^ S^ PD,L^ S,R
= 7 nS (^) t= t - t = 1 nSH H,R CD,L
We know how fast it goes… But what can it do?
t(1 ns) + t^ CD,R^ CD,L
(?) > t(2 ns)H,R^ t^ > t^ +t^ CLK^ PD,RPD,L
6.004 – Spring 2009^
2/24/ A simple sequential circuit…Lets make a digital binary
Combination Lock: Specification: • One input ( “0” or “1”) • One output (“Unlock” signal) • UNLOCK is 1 if and only if:Last 4 inputs were the“combination”: 0110
IN^ Lock How manyregisters doI need?
U CLK
L06 – FSMs 5
2/24/ Abstraction
du jour: Finite State Machines • A FINITE STATE MACHINE has m^ ClockedFSM
n
6.004 – Spring 2009^
2/24/ State Transition DiagramSXS0 (^0) U=0U=
1
0 0
0
(^11)
NAME of state OUTPUT when in thisstate
Heavy circleMeans INITIAL^ state^0 INPUTcausingtransition
Designing our lock …^ • ^ Need an initial state; call it SX.^ • ^ Must have a separate state for each stepof the proper entry sequence^ • ^ Must handle other (erroneous) entries
Why do thesego to S0 and S01?
L06 – FSMs 7
2/24/ Yet Another SpecificationSXS0S01U=0U=0 0 U=0^1
S011S0110U=0 1 U=1^0 1
0 1 001
000000 00 100 10 1 10 1 10 100 10^100100
00 1 000 00 10 1 100 10 101 00 000 00 10 1 1 The assignment of codes tostates can be arbitrary, however,if you choose them carefully youcan greatly reduce your logicrequirements.
6.004 – Spring 2009^
2/24/ Valid State Diagrams
0
0/
L06 – FSMs 13
6.004 – Spring 2009^
2/24/
vs.
0= "
OFF,1=ON?111" =Surprise!
L06 – FSMs 14
6.004 – Spring 2009^
2/24/
vs.
L06 – FSMs 15
6.004 – Spring 2009^
2/24/
L06 – FSMs 16
6.004 – Spring 2009^
Figure by MIT OpenCourseWare.
L06 – FSMs 17
Bonk! 2/24/ LOSTL+RF _ _L R
Action: Turn left (CCW) until we don’t touch anymore
6.004 – Spring 2009^
2/24/ A little to the right…LOSTF
L+R RCCWL+RTL R Wall1_TR,FR _ _L R
_ _L R Action: Step and turn right a little, look for wall
L06 – FSMs 19
2/24/ Then a little to the leftLOSTF
L+R RCCWL+RTL R Wall1_TR,FR _ _L R
_ _L R^
Wall2TL,FL _ _L R _L R
Action: Step and turn left a little, till not touching (again)
6.004 – Spring 2009^
2/24/ Dealing with cornersLOSTF
Wall2TL,F L+R RCCWL+RLTL R Wall1_TR,FR _ _L R
_ _L R^
_ _L R
_L R R _RCornerTR,F
Action: Step and turn right until we hit perpendicular wall
L06 – FSMs 25
Ant Schematic 2/24/
6.004 – Spring 2009^
Roboant® 2/24/
Mazeselection
FSM statetable Statusdisplay
Plan viewof mazeSimulationcontrols
Featuring the new Mark-II ant: can add (M),erase (E), and sense (S) marks along its path.
L06 – FSMs 27
2/24/ Housekeeping issues…ROMorgatesNEXT inputs^ STATE
outputs s s
IN CLK
U Now, that’s a funnylooking state machine
6.004 – Spring 2009^
2/24/ Twisting you Further…
-^ MORE THAN ANTS:Swarming, flocking, and schooling can resultfrom collections of very simple FSMs• PERHAPS MOST PHYSICS:Cellular automata, arrays of simple FSMs,can more accurately model fluilds thannumerical solutions to PDEs• WHAT IF:We replaced the ROM with a RAM and haveoutputs that modify the RAM?... You'll see FSMs for the rest of your life!
Did we all descend from FSMs??? I prefer to think we^ ascended …