Académique Documents
Professionnel Documents
Culture Documents
Great - Theory!
L10 9/18/97 1
IN
Comb. Logic
NEXT STATE
Comb. Logic
CURRENT STATE
OUT
Clock
Clock Period 4
Clock Period 5
L10 9/18/97 2
Clocked FSM
L10 9/18/97 3
FSM Example:
Lets build an ant. SENSORS: antennae L and R, each 1 if in contact with something. ACTUATORS: Forward Step F, one- degree turns TL and TR (left, right). GOAL: Make our ant smart enough to get out of a maze like:
8 situations ants know how to deal with Situation A: Following wall on right, Right antenna just touching. Turn left a little, getting to Situation B: Following wall, antenna not quite touching. Turn right a little, look for wall (A) or possibly a break in the wall (C).
Ant Psychology
Situation C: a break in the wall. Turn right & step until we hit the perpendicular wall, as shown in
Situation F, which we can treat like B. G: turn left until we don't touch.
6.004 Fall 97... L10 9/18/97 5
?
SAW 8/7/00 09:43
EorG
TL R L
A
TL,F
__ LR
BorC
TR,F
_ R
C
TR,F
_ R
ROMs for NEXT STATE, OUTPUT Logic. ENCODE each state as unique value of some set of STATE VARIABLES... Fill in truth tables from TRANSITION DIAGRAM and OUTPUT SPECIFICATION.
ARBITRARY encoding may work... BUT Choice may effect COMPLEXITY, COST!
ROM
ROM
ROM
MAY COMBINE next state and output logic into single ROM:
L10 9/18/97 7
ROM
X',Y',Z'
=000 =001 =010 =011 =100 F TR 1 0 1 0 .... .... 1 0 1 0 1 0 1 0 1 1 1 1 .... .... TL 0 0 .... 1 1 1 1 0 0 ....
LOST .... A
BorC ....
L10 9/18/97 8
MOORE Machines: Outputs depend ONLY on current state. MEALY Machines: Outputs may depend on INPUTS as well as current state.
ROM ROM ROM
MOORE
MEALY
BUG in handout!
SYNCHRONY of INPUTs -- what assumptions? Nonsense states? Worse? UNASSIGNED STATES: What about 101 in example?
6.004 Fall 97... L10 9/18/97 9
What about those unused ROM locations -- eg, for xyz = 101, etc?
L+R L+R _ LR
Unreachable States
000
__ LR
001
_ _ LR R
010
__ LR
110
011
_ R
100
_ R
Unreachable states
Can't be reached from starting state by any input sequence May waste nearly 50% of ROM Might (depending on design) be entered on startup, or for illegal inputs... ... often its important to specify transitions out (eg to starting state). 6.004 Fall 97... L10 9/18/97 10
ROM
______________________
2. Same question:
m States
n States
______________________
0 1
FSM
FSM
If you know NOTHING about the FSM, youre ____________________________! If you have a BOUND on the number of states, you can discover its _______________________________
FSM Metaphysics
1 0 0 1 0 0 0 0 0 1 1 1 vs.
L10 9/18/97 13
FSM Equivalence
1 0 0 1 0 0 0 0 0 1 1 1 vs.
ARE THEY DIFFERENT? NOT in any practical sense! They are EXTERNALLY INDISTINGUISHABLE, hence interchangeable. New notion: FSMs EQUIVALENT iff every input sequence yields ______________________ output sequences.
ENGINEERING GOAL:
FSM Simplification
GOAL: Given FSM, find reduced-state equivalent FSM. METHOD: Detect indistinguishable ("equivalent") states, merge into single state.
EXAMPLE:
1 0 0 0 0 0 1 1 1 1
DISCOVER that all of the "ON" states are EQUIVALENT, merge them to yield:
1 0 0 1
"________________________" algorithm: Iterative application of simplification rule until no further simplifications can be found.
6.004 Fall 97... L10 9/18/97 1 5
1. States have identical outputs; AND 2. Every input equivalent states. Reduction Strategy: Find pairs of equivalent states, MERGE them.
L+R
LOST
F __ LR
L+R
EorG
TL _ _ LR R L
A
TL,F
_ LR
__ LR
BorC
TR,F
_ R
C
TR,F
_ R
LOST
F
L+R
EorG
TL _ _ LR R __ LR L
A
TL,F
_ LR
__ LR
BorC
TR,F _ R
Behaves exactly as previous (5-state) FSM, but requires half the ROM in its implementation!
6.004 Fall 97... L10 9/18/97 17
ROM
s
OUTPUTS
STATE (Hmmm, looks a lot like the circuit of the Bldg 36 Elevator Controller...)
L10 9/18/97 18
Registers Counters RAM chips Cash machines Video games Personal computers Mainframe processors.
FSM view of system state identifies STATES ; Alternative MEMORY view of system state identifies BITS. NUMBER OF STATES can grow EXPONENTIALLY with hardware:
Add 1 flip flop => DOUBLE number of states k-bit memory has 2 states!
GENERALLY:
FSM view useful for optimizing SIMPLE devices; MEMORY view useful for designing large systems.
6.004 Fall 97... L10 9/18/97 19
SAW 8/7/00 09:43
L10 9/18/97 20
Consciousness Explained?
Bee awareness of being on the road...
Is a bee conscious of its distance from home? What dictates the bees feeding behavior -Social responsibility? Peer pressure? Level of hunger?
Apparent answer:
One combinational input bit (FOOD HERE); and One state bit (got here via air).
L10 9/18/97 21
L10 9/18/97 22