Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Consider the controller of an elevator that connects the 1st, 2nd, 3rd, and 4th

ID: 3769009 • Letter: C

Question

Consider the controller of an elevator that connects the 1st, 2nd, 3rd, and 4th floors of a building as an example of a finite state machine.

The states of this FSM correspond to the elevator stopped at each of the four floors, either with the doors closed, or with the doors open (i.e. "doors open" and "doors closed" are separate states).

Transitions between states will thus correspond to the elevator moving between floors, including "express" transitions between non-adjacent floors, and opening and closing doors while stopped at any given floor (obviously, the elevator can move only if the doors are closed). External inputs are determined by the elevator call buttons

1) How many distinct transitions are there between states (not including "null transitions", i.e. transitions from a state back to itself)?

2) How many bits would the Storage Logic component of the FSM have to store?

Explanation / Answer

the distinct transitions are:

a).no transition

b).8 (each of the three buttons can take two states(on or off)=>2^3=8

c)12 (two from each floor +two possible value of each button)=2+2+2+2+2+2+2+2=16

d)4 (one from each floor)

e)8(two from each floor)

total=8+16+4+8=36

bits required to label all states

a)1(no transition)

b)2 (for buttons)

c)4( for each of the floors)

d)5(1 extra bit from transition up and down)

e)9(1 extra bit for transition up and down )

total=1+2+4+5+9

=21 bits