There described a real application of state machine about turnstile in Fig. 2.3. An example of a simple mechanism that can be modeled by a state machine is a turnstile \cite{wikipedia}. We mainly used a turnstile for control access to subways and amusement park rides, is a gate with three rotating arms at waist height, one across the entryway. Basically, arms are locked initially, blocking the entry, preventing patrons from passing through. After putting a coin or token in a slot on the turnstile then unlocks the arms, allowing a single customer to push through. When the customer passes through after arms are locked again until another coin is inserted. The Fig. 2.4 shows the state transition table of the turnstile.

If we considered as a state machine, here is two possible states of the turnstile: Locked and Unlocked. There are two possible inputs that affect its state: putting a coin in the slot (coin) and pushing the arm (push). In the locked state, pushing on the arm has no effect; no matter how many times the input push is given, it stays in the locked state. When putting a coin in the machine that is, giving the machine a coin input shifts the state from Locked to Unlocked. In the unlocked state, putting additional coins in has no effect; that is, giving additional coin inputs does not change the state. However, a customer pushing through the arms, giving a push input, shifts the state back to Locked.

We Will Write a Custom Essay Specifically
For You For Only $13.90/page!

order now