



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
These lab notes from the 6.004 finite state machines (fsm) course at mit, spring 2009, cover various topics related to fsms, including combinational logic, timing assumptions, designing a digital binary combination lock, and state transition diagrams. The notes also discuss moore and mealy machines, rom implementation, and dealing with corners in mazes.
Typology: Slides
1 / 7
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 ā¦