Nepedia
Back to Discover
Fluent Reader
🔢

Finite-state machine

math Maturity 11-13 Next article →

A finite-state machine is a way to model how a system works. It is an abstract machine that can be in exactly one state at any time. A state is a description of what the system is doing while it waits for something to happen. When the machine receives an input, it can change from one state to another. This change is called a transition.

Turnstile state machine colored
Turnstile state machine colored

These machines are very important for understanding how different things function. They help us map out a set of rules for a machine to follow.

To understand how they work, imagine a simple turnstile at a subway station.

Tornelli
Tornelli

A turnstile has two possible states: Locked and Unlocked. If the machine is in the Locked state, pushing the arm does nothing. However, if you provide the input of a coin, the machine undergoes a transition to the Unlocked state. Once a person pushes through the gate, the machine moves back to the Locked state.

Finite state machine example with comments
Finite state machine example with comments

You can draw these movements using a state diagram. In these diagrams, circles represent the states and arrows show the transitions.

People use these models in many different areas of study. Scientists and experts study them in a field called automata theory. This field looks at how machines process information. You can find these ideas in electrical engineering and computer science. They are also used in biology, philosophy, and even video game programming.

SdlStateMachine
SdlStateMachine

These models help engineers design hardware and software that works correctly. They are also used to study how languages are formed.

There are different types of these machines based on what they do. Acceptors are machines that look at a sequence of symbols. They decide if the input is accepted or rejected based on a rule.

Fsm parsing word nice
Fsm parsing word nice

For example, an acceptor might check if a binary number has an even number of zeros. Transducers are another type that produce an output.

Fsm mealy model door control
Fsm mealy model door control

Some transducers are called Moore machines, where the output depends only on the state. Others are called Mealy machines, where the output depends on both the state and the input.

These machines are much simpler than some other models of computation. A famous model called a Turing machine is much more powerful. This is because a finite-state machine has limited memory. Its memory is restricted by the total number of states it has.

DFAexample
DFAexample

You can see these ideas in your daily life all the time. Vending machines, elevators, and traffic lights all follow a set sequence of actions. Even a combination lock uses these rules to check your numbers in the right order. They all rely on moving through states to finish a task.

437 words

Where will your curiosity go next?

Keep exploring at your chosen reading level.

🖼️ Images & Media (10)
File:Turnstile state machine colored.svg
Turnstile state machine colored.svg
File:Tornelli.jpg
Tornelli.jpg
File:UML state machine Fig5.png
UML state machine Fig5.png
File:SdlStateMachine.png
SdlStateMachine.png
File:Finite state machine example with comments.svg
Finite state machine example with comments.svg
File:Fsm parsing word nice.svg
Fsm parsing word nice.svg
File:DFAexample.svg
DFAexample.svg
File:Fsm Moore model door control.svg
Fsm Moore model door control.svg
File:Fsm mealy model door control.svg
Fsm mealy model door control.svg
File:4 bit counter.svg
4 bit counter.svg
More to explore

What is Nepedia?

A free, ad-free encyclopedia for children. Every article is written at five reading levels, so the same page works for a five-year-old and a fifteen-year-old — use the level switcher above to see this one change. No account needed to read.